项目作者: Simularia

项目描述 :
Tools 🧰 to pre and post process data for air quality assessment.
高级语言: R
项目地址: git://github.com/Simularia/simulariatools.git
创建时间: 2014-03-03T17:12:30Z
项目社区:https://github.com/Simularia/simulariatools

开源协议:GNU General Public License v2.0

下载


simulariatools

R-CMD-check
CRAN
status
CRAN
downloads
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:

  1. install.packages("simulariatools")

Or install the development version from GitHub with:

  1. 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:

  1. library(simulariatools)
  2. mydata <- importRaster(file = "./development/conc_avg.nc",
  3. k = 1000,
  4. destaggering = TRUE,
  5. variable = "nox",
  6. verbose = TRUE)
  7. #>
  8. #> Raster statistics -----------------------------------------------
  9. #> X (min, max, dx) : 496000.000 519250.000 250.000
  10. #> Y (min, max, dy) : 4943000.000 4955250.000 250.000
  11. #> nox (min, max, mean): 0.00e+00 2.71e+00 1.52e-01
  12. #> -----------------------------------------------------------------

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

  1. contourPlot2(mydata)

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

  1. library(ggplot2)
  2. contourPlot2(mydata,
  3. domain = c(502000, 519000, 4943125, 4955125, 5, 5),
  4. levels = c(-Inf, 0.5, 1, 1.5, 2, Inf),
  5. legend = "NOx [ug/m3]") +
  6. labs(x = NULL, y = NULL) +
  7. theme_minimal()

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

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

Use tile optional argument to produce a plot without interpolation:

  1. library(ggplot2)
  2. contourPlot2(mydata,
  3. tile = TRUE,
  4. legend = "NOx [ug/m3]") +
  5. labs(x = NULL, y = NULL) +
  6. theme_minimal()

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:

  1. Giuseppe Carlino
  2. Simularia s.r.l.
  3. g.carlino@simularia.it

Contributors

Matteo Paolo Costa