MyNixOS website logo
Description

Simularia Tools for the Analysis of Air Pollution Data.

A set of tools developed at Simularia for Simularia, to help preprocessing and post-processing of meteorological and air quality data.

simulariatools

R-CMD-check CRANstatus CRANdownloads DOI

simulariatools is a free collection collection of functions and tools useful to pre and post process data for air quality modelling and assessment. The package is developed and maintained by the people at Simularia and it is extensively used for their daily job.

If you use this package in your work, please consider citing it. Refer to its Zenodo DOI to cite it.

Table of Contents

Installation

Install the released version of simulariatools from CRAN:

install.packages("simulariatools")

Or install the development version from GitHub with:

pak::pkg_install("Simularia/simulariatools")

Note: in order to use importADSOBIN() to import ADSO/BIN data files, a working installation of Python 3 is required. For more information about R and Python interoperability, please refer to reticulate documentation.

Brief examples

Contour plot

First, import air quality data from NetCDF or ADSO/BIN files with the appropriate convenience function:

library(simulariatools)
mydata <- importRaster(file = "./test/conc_avg.nc",
                       k = 1000,
                       destaggering = TRUE,
                       variable = "nox",
                       verbose = TRUE)
#> 
#> Raster statistics -----------------------------------------------
#>        X (min, max, dx)  :  496000.000   519250.000      250.000
#>        Y (min, max, dy)  : 4943000.000  4955250.000      250.000
#>      nox (min, max, mean):    0.00e+00     2.71e+00     1.52e-01
#> -----------------------------------------------------------------

A quick contour plot with default configuration can be easily obtained by running contourPlot2() without any argument:

contourPlot2(mydata)

The plot is customisable by using contourPlot2() arguments and by piping ggplot2 instructions:

library(ggplot2)
contourPlot2(mydata, 
             domain = c(502000, 519000, 4943125, 4955125, 5, 5),
             levels = c(-Inf, 0.5, 1, 1.5, 2, Inf),
             legend = "NOx [ug/m3]") + 
  labs(x = NULL, y = NULL) +
  theme_minimal()
#> Warning: Removed 1225 rows containing non-finite values
#> (`stat_contour_filled()`).

Use ggsave() to save the last plot to file:

ggsave(filename = "~/path/to/myplot.png", width = 7, height = 6, dpi = 300)

Use tile optional argument to produce a plot without interpolation:

library(ggplot2)
contourPlot2(mydata, 
             tile = TRUE,
             legend = "NOx [ug/m3]") + 
  labs(x = NULL, y = NULL) +
  theme_minimal()
#> Warning: Removed 280 rows containing missing values (`geom_raster()`).

List of functions

Available functions are listed below:

  • contpourPlot2()
  • downloadBasemap()
  • importRaster()
  • importADSOBIN()
  • importSurferGrd()
  • plotAvgRad()
  • plotAvgTemp()
  • plotStabilityClass()
  • removeOutliers()
  • rollingMax()
  • stabilityClass()
  • vectorField()
  • contourPlot() (deprecated)
  • createBaseMap() (deprecated)

Deprecated functions will be removed in the near future.

Contact

Contact person:

Giuseppe Carlino
Simularia s.r.l.
[email protected]

Contributors

Matteo Paolo Costa.

Metadata

Version

2.5.1

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows