Gfind: Locate GRIB message inside a file

View source: R/Rgrib.R

GfindR Documentation

Locate GRIB message inside a file

Description

Find the position of a particular message (field) inside a GRIB file.

Usage

  Gfind(griblist, shortName = "t", level = NULL, levelType = "P",
        all = FALSE, ...)

Arguments

griblist

Either a character string (filename) or a GRIBlist object. Anything that has a Ginfo method.

shortName

A character to be matched to the "shortName" field, or an integer to be matched to the parameter index. Currently, table2Version is not taken into account. Use Glocate for more detailed searches.

level, levelType

An integer according to the GRIB level type. It may also be a character similar to FA files ("P"=100,"H"=105 or "S"=107). This is only taken into account if level!=NULL.

all

If TRUE, all fields are returned. if FALSE, only the position(s)

...

Not used. Added for HARP compatibility.

Details

The function works by first calling Ginfo for the list of chosen parameters. Then the list is searched for messages that satisfy all the required values.

Value

A vector with the message indices of all messages that satisfy the required values of the parameters.

See Also

Glocate

Examples

## Not run: 
#Find T2m in a file:
Gfind('filename',"z",levelType="P",level=500)

## End(Not run)

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