Gmod: Modify parameters or data from a GRIB message

View source: R/Rgrib.R

GmodR Documentation

Modify parameters or data from a GRIB message

Description

Modifies parameter entries and/or data in a GRIBhandle.

Usage

  Gmod(gribhandle,IntPar=list(),DblPar=list(),StrPar=list(),data=NULL,
       precision=NULL, nbits=NULL)

Arguments

gribhandle

An object of class GRIBhandle.

IntPar, DblPar, StrPar

Lists (or character vectors) giving the names of integer, character (string) and numeric (double) parameters to be modified in the message(s), and the new values.

data

Data vector to be encoded in x.

precision

Integer value for decimal precision of the GRIB packing. Alternatively, one may fix the number of bits per value.

nbits

Bits per value in the GRIB packing. If it is not precisied, GRIB\_API defaults to 24 bits.

Value

No return value (NULL).

See Also

Gdec, Gopen, Gmod, Gwrite

Examples

## Not run: 
#Get first 5 records of a file.
mygrib <-Gopen('filename')
#return level info from all messages in the file:
a <- Ghandle(mygrib,1)
Gmod(a,IntPar=list(typeOfLevel=105,level=500),data=Gdec(a)*5)
Gwrite(a,file=newfile,append=TRUE)

## End(Not run)

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