Skip to contents

returns the values stored in the grib record

Usage

Gdec(x, field=1, level = NULL, levelType = "P", 
       get.meta = TRUE, multi = FALSE)

Arguments

x

An object of class "GRIBhandle", a file name or a GRIBlist, in which case field must be specified as an integer or a name. x can also be a GRIB message in raw (byte) format.

field

An integer indicating the position of the field in the file or list. Not used if x is a GRIBhandle.

level, levelType

Possibly add a level (pressure, height above surface).

get.meta

Logical key to retrieve parameter and date-time information.

multi

Setting this to TRUE turns on support for multi-field messages in GRIB2.

Value

A data matrix with class "geofield" and attributes time, domain and description.

Details

takes an object of class "GRIBhandle" as input and returns the actual data. record can also be a filename or GRIBlist object, in which case field must be specified as an integer or a name.

See also

Examples

if (FALSE) {
#Get first 5 records of a file.
h1 <- Ghandle('filename',5)
#decode first record
mydata <- Gdec(h1)
}