Ginfo: Extract information from a GRIB message or file

View source: R/Ginfo.R

GinfoR Documentation

Extract information from a GRIB message or file

Description

Reads a list information of a Grib file (not the encoded data itself).

Usage

  Ginfo(x,...)
## S3 method for class 'GRIBhandle'
Ginfo(x,IntPar=c(),DblPar=c(),StrPar=c(),...)
## S3 method for class 'GRIBlist'
Ginfo(x,IntPar=c(),DblPar=c(),StrPar=c(),rList=NULL,multi=FALSE,...)
## S3 method for class 'character'
Ginfo(x,IntPar=c(),DblPar=c(),StrPar=c(),rList=NULL,multi=FALSE,...)

Arguments

x

An object of class GRIBhandle, a file name or a GRIBlist. In the first case, the

IntPar, StrPar, DblPar

Character vectors giving the names of integer, character (string) and numeric (double) parameters to be decoded from the message(s). The parameter names are as described in the GRIB_API documentation.

rList

An numeric vector indicating the position of the messages in the file. Not used if x is a GRIBhandle. The default is 1 (read only first message). If rList is NULL, all messages in the file are read.

multi

Logical. Setting it to TRUE allows for multi-data messages (UNTESTED!)

...

Not used.

Details

.

Value

A data.frame with one column per parameter and one row per GRIB message.

See Also

Gdec, Gopen, Gmod

Examples

## Not run: 
#Get first 5 records of a file.
mygrib <-Gopen('filename')
#return level info from all messages in the file:
Ginfo(mygrib,IntPar=c("typeOfLevel","level"),rList=NULL)

## End(Not run)

harphub/Rgrib2 documentation built on June 4, 2024, 7:27 a.m.