Gcreate: Create a new GRIB handle

View source: R/Genc.R

GcreateR Documentation

Create a new GRIB handle

Description

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.

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.

Value

A GRIBhandle for a new GRIB message.

See Also

GRIBhandle, Gmod, Ghandle

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.