readZAMGGRIB: Read a GRIB-1 file using wgrib

View source: R/readZAMGGRIB.r

readZAMGGRIBR Documentation

Read a GRIB-1 file using wgrib

Description

Read a GRIB-1 file provided by the ZAMG using wgrib and extract a specific raster set.

Usage

readZAMGGRIB(
  gribfile,
  ex = NULL,
  crs = NULL,
  wgrib = NULL,
  recnr = NULL,
  variable = NULL,
  remove = FALSE
)

Arguments

gribfile

Absolute path to a gribfile

ex

Either an extent object, NULL, 'alaro', 'arome', or 'ecmwf'.

crs

Either a crs string, NULL, 'alaro', 'arome', or 'ecmwf'.

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.

Details

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.

Value

A (projected) raster with the extracted information

Author(s)

Simon Frey

See Also

For reading INCA files, see readINCABIL


freysimon/ZAMGR documentation built on Nov. 3, 2023, 9:44 p.m.