NumRu::GrADS_Gridded -- a class for GrADS gridded datasets

by T Horinouchi and R Mizuta

Overview

a GrADS_Gridded object corresponds to a GrADS control file, through which the users can also access its binary data file(s).

Current Limitations

Class Methods

GrADS_Gridded.new(ctlfilename, mode="r")

same as GrADS_Gridded.open

GrADS_Gridded.open(ctlfilename, mode="r")

make a new GrADS_Gridded object.

ARGUMENTS

REMARK

GrADS_Gridded.create(ctlfilename, noclobber=false, share=false)

make a new GrADS_Gridded object with creating a new control file

REMARK

Methods

nvars

returns the number of variables in the file.

path

returns the path of the control file.

var( varname=nil )

opens an existing variable in the file.

ARGUMENTS

RETURN VALUE

vars( names=nil )

opens existing variables in the file.

ARGUMENTS

RETURN VALUE

dim_names

returns the names of all dimensions in the control file.

var_names

returns the names of all variables in the control file.

to_ctl

returns the contents of the corresponding control file as a String.

REMARK

get(name, level, time)

reads the binary data and returns as a NArray.

ARGUMENTS

varnames

Returns names of the variable in the GrADS file as an Array in the order placed.

dimensions

Returns info on the four dimensions.

RETURN VALUE

WARNING

ctlfilename

path of the control file

get_dim(dim)

returns positions of a dimension as an NArray.

ARGUMENTS

RETURN VALUE

title

title=

get/set the title

undef

undef=

get/set the undef value

dset

dset=

get/set the dset string

GrADSVar -- a class for a variable of GrADS gridded datasets

by R Mizuta

Overview

a GrADSVar object corresponds to one variable in a GrADS control file. It is intended to behave as a correspondent of a NetCDFVar object.

Current Limitations

Class Methods

GrADSVar.new(file, varname)

make a new GrADSVar object.

ARGUMENTS

Methods

name

returns the name of the variable.

vartype

returns "sfloat" in order to behave as NetCDFVar#vartype.

dim_names

returns the names of all dimensions in the control file.

shape_ul0

returns the shape of the variable, but the length of the unlimited dimension is set to zero.

RETURN VALUE

shape_current

returns the current shape of the variable.

RETURN VALUE

get(hash=nil)

returns values of the variable.

ARGUMENTS

RETURN VALUE

REMARK "stride","index" is not supported yet.

[]

Same as GrADSVar#get but a subset is specified as in the method [] of NArray.