by T Horinouchi and R Mizuta
a GrADS_Gridded object corresponds to a GrADS control file, through which the users can also access its binary data file(s).
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
ndimsreturns the number of dimensions in the file (always 4).
nvarsreturns the number of variables in the file.
nattsreturns the number of attributes of the variable.
pathreturns the path of the control file.
put_att( attname, value )set global attribute
ARGUMENTS
def_var(name="noname",nlev=0,option="99",description="")define a variable
ARGUMENTS
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
get_att( key=nil )returns tha value of the global attribute
dim_namesreturns the names of all dimensions in the control file.
var_namesreturns the names of all variables in the control file.
att_namesreturns the names of all the global attributes.
to_ctlreturns the contents of the corresponding control file as a String.
REMARK
get(name, z, t)reads the binary data and returns as a NArray.
ARGUMENTS
put(ary)writes the NArray on the binary data file.
ARGUMENTS
varnamesReturns names of the variable in the GrADS file as an Array in the order placed.
dimensionsReturns info on the four dimensions.
RETURN VALUE
an Array of 4 elements: dimension[0] for x, dimension[1] for y, dimension[2] for z, and dimension[3] for t. Each of them is a Hash like the following:
{:name=>"x",
:len=>132,
:flag=>"LINEAR",
:spec=>"-0.7500 1.5000",
:start=>-0.75, :increment=>1.5,
:description=>"longitude",
:units=>"degrees_east"}
Here, :len, :flag, and :spec are directly from the control file, while others are derived properties for internal use.
WARNING
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
by R Mizuta
a GrADSVar object corresponds to one variable in a GrADS control file. It is intended to behave as a correspondent of a NetCDFVar object.
GrADSVar.new(file, varname)make a new GrADSVar object.
ARGUMENTS
shape_ul0returns the shape of the variable, but the length of the unlimited dimension is set to zero.
RETURN VALUE
shape_currentreturns the current shape of the variable.
RETURN VALUE
dim_namesreturns the names of all dimensions of the variable.
att_namesreturns the names of all attributes of the variable.
namereturns the name of the variable.
ndimsreturns the number of dimensions in the file (always 4).
rankalias of ndims
vartypereturns "sfloat" in order to behave as NetCDFVar#vartype.
nattsreturns the number of attributes of the variable.
filereturns the file name that controls the variable.
get_att( name=nil )returns tha value of the attribute of the variable.
put_att( name, value )set an attribute of the variable.
ARGUMENTS
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.