GPhys.new(grid, data)Constructor.
ARGUMENTS
RETURN VALUE
NOTE
GPhys.each_along_dims(gphyses, *loopdims){...} # a block is expectedIterator to process GPhys objects too big to read on memory at once.
Makes a loop (loops) by dividing the GPhys object(s) (gphyses) with the dimension(s) specified by loopdims. If the return value of the block is an Array, it is assumed to consist of GPhys objects, and the return value of this method is an Array in which the whole of the results are reconstructed as if no iteration is made, which is the same behavior as GPhys::IO.each_along_dims_write. If the return value of the block is not an Array, this methods returns nil.
WARNING: Unlike GPhys::IO.each_along_dims_write, the results of this method is NOT written in file(s), so be careful about memory usage if you put an Array of GPhys as the return value of the block. You will probably need to have the size of them smaller than input data.
ARGUMENTS
RETURN VALUE
ERRORS
The following raise exceptions (in addition to errors in arguments).
USAGE
See the manual of GPhys::IO.each_along_dims_write.
dataReturns the data object
RETURN VALUE
NOTE
grid_copyReturns a copy (deep clone) of the grid object.
RETURN VALUE
NOTE
copyMake a deep clone onto memory
RETURN VALUE
nameReturns the name of the GPhys object, which is equal to the name of the data object in the GPhys object.
RETURN VALUE
name=(nm)Set the name of the GPhys object.
ARGUMENTS
RETURN VALUE
rename(nm)Same as name=, but self is returned.
ARGUMENTS
RETURN VALUE
valReturns data values
RETURN VALUE
val=(v)Writes in data values.
ARGUMENTS
RETURN VALUE
NOTE
replace_val(v)Replace the data values.
ARGUMENTS
RETURN VALUE
NOTE
att_namesReturns attribute names of the data object.
RETURN VALUE
get_att(name)Get the value of the attribute named name.
ARGUMENTS
RETURN VALUE
set_att(name, val)
put_att(name, val)Set an attribute of the data object
ARGUMENTS
RETURN VALUE
del_att(name)Delete an attribute of the data object.
ARGUMENTS
RETURN VALUE
ntypeReturns the numeric type of the data object.
RETURN VALUE
NOTE
typecodeReturns the numeric type of the data object.
RETURN VALUE
NOTE
unitsReturns the units of the data object
RETURN VALUE
units=(units)Changes the units of the data object
ARGUMENTS
RETURN VALUE
convert_units(to)Convert the units of the data object
ARGUMENTS
RETURN VALUE
long_nameReturns the "long_name" attribute the data object
RETURN VALUE
long_name=(to)Changes/sets the "long_name" attribute the data object
ARGUMENTS
RETURN VALUE
[]Returns a subset.
ARGUMENTS
RETURN VALUE
[] = Sets values of a subset
RETURN VALUE
cutSimilar to [], but the subset is specified by physical coordinate.
ARGUMENTS
EXAMPLES
Pattern 1
gphys.cut(135.5,0..20.5,false)
Pattern 2
gphys.cut({'lon'=>135.5,'lat'=>0..20})RETURN VALUE
cut_rank_conservingSimilar to cut, but the rank is conserved by not eliminating any dimension (whose length could be one).
axnamesReturns the names of the axes
RETURN VALUE
rankReturns the rank
RETURN VALUE
axis(dim)Returns the Axis object of a dimension.
ARGEMENTS
RETURN VALUE
coord(dim)
coordinate(dim)Returns the coordinate variable
ARGUMENTS
RETURN VALUE
NOTE
lost_axesReturns info on axes eliminated during operations.
Useful for annotation in plots, for example (See the code of GGraph for an application).
RETURN VALUE
dim_index( dimname )Returns the integer id (count from zero) of the dimension
ARGUMENT
RETURN VALUE
integrate(dim)Integration along a dimension.
RETURN VALUE
NOTE
average(dim)Averaging along a dimension.
RETURN VALUE
NOTE
first1DReturns a 1D subset selecting the first elements of 2nd, 3rd, .. dimensions, i.e., self[true, 0, 0, ...]. (For graphics)
ARGUMENTS
RETURN VALUE
first2DReturns a 2D subset selecting the first elements of 3rd, 4th, .. dimensions, i.e., self[true, true, 0, 0, ...]. (For graphics)
ARGUMENTS
RETURN VALUE
coerce(other)You know what it is.
shape_coerce(other)Like coerce, but just changes shape without changing numeric type.
transpose(*dims)Transpose.
ARGUMENTS
RETURN VALUE
shape_currentReturns the current shape of the GPhys object.
RETURN VALUE
shapeAliased to shape_current
cyclic_ext(dim_or_dimname, modulo)Extend a dimension cyclically.
The extension is done only when adding one grid point makes a full circle. Thus, data at coordinate values [0,90,180,270] with modulo 360 are extended (to at [0,90,180,270,360]), but data at [0,90,180] are not extended with the same modulo: in this case, self is returned.
ARGUMENTS
RETURN VALUE
These methods returns a NArray (not a GPhys).