Skip to contents

Creates a new GRIBhandle object.

Usage

Gcreate(gribformat=2,domain,sample)
  Genc(geofield,gribformat=2,precision=4)

Arguments

gribformat

Denotes the GRIB edition: either 1 or 2.

domain

A geodomain object defining the grid. If domain is not specified, the grid definition of thye sample is unmodified.

sample

Character string. Denotes the name of a GRIBfile to be used as a template for the new message. TIf undefined, the default is "regular_ll_sfc_gribN" where N is the gribedition.

geofield

A 'geofield' object: a data matrix with domain attribute.

precision

Numerical (decimal) precision wanted for the GRIB encoding.

Value

A GRIBhandle for a new GRIB message.

Details

These commands return a GRIBhandle. This message can then be further modified using Gmod.

Genc is in fact just a simple wrapper that calls Gcreate and Gmod.

See also

Examples

if (FALSE) {
#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)
}