readZAMGGRIB | R Documentation |
Read a GRIB-1 file provided by the ZAMG using wgrib and extract a specific raster set.
readZAMGGRIB(
gribfile,
ex = NULL,
crs = NULL,
wgrib = NULL,
recnr = NULL,
variable = NULL,
remove = FALSE
)
gribfile |
Absolute path to a gribfile |
ex |
Either an |
crs |
Either a |
wgrib |
Absolute path to the executable of wgrib. If NULL, wgrib must be installed properly on the system. |
recnr |
numeric giving the record number of the respective variable within GRIB file |
variable |
character string giving the abbreviated variable within the GRIB file. |
remove |
either TRUE/FALSE for removing / not removing the gribfile after reading or ”success'/fail' for only removing files that have / haven't been successfully read. |
If ex and/or crs are supplied, the returned raster will be projected. If ex and/or crs are specified as "alaro", "arome", or "ecmwf" the respective extent and crs are used.
Either recnr or variable must be specified to extract the information of interest. If both are given the latter is ignored.
This function relies on the package TigR, which is available on Github
Note that wgrib (64Bit) must be installed on the machine. It can be downloaded from http://www.cpc.ncep.noaa.gov/products/wesley/wgrib.html
ZAMG per default flips their rasters by "y", so the output will be flipped back that the raster is projected correctly.
A (projected) raster with the extracted information
Simon Frey
For reading INCA files, see readINCABIL
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.