A class to handle discretized grids of physical quantities.
Grid.new( *axes )Constructor.
RETURN VALUE
axnamesReturns the names of the axes
RETURN VALUE
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
axis(dim_or_dimname)Returns an Axis
ARGUMENTS
RETURN VALUE
dim_index(dimname)Returns the integer id (count from zero) of the dimension
ARGUMENT
RETURN VALUE
set_axis(dim_or_dimname,ax)Sets an axis.
ARGUMENTS
RETURN VALUE
set_lost_axes( lost )Sets info on axes eliminated.
RETURN VALUE
add_lost_axes( lost )Adds info on axes eliminated to existing ones.
RETURN VALUE
delete_axes( at, deleted_by=nil )Delete an axis.
ARGUMENTS
RETURN VALUE
copyMakes a deep clone onto memory.
RETURN VALUE
merge(other)merge two grids by basically using copies of self's axes but using the other's if the length in self is 1 and the length in the other is longer
ARGUMENTS
RETURN VALUE
shapeReturns the shape of self.
RETURN VALUE
[*slicer]Returns a subset.
ARGUMENTS
RETURN VALUE
cut(*args)Similar 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_conserving(*args)Similar to cut, but the rank is conserved by not eliminating any dimension (whose length could be one).
exclude(dim_or_dimname)Returns a Grid in which an axis is eliminated from self.
ARGUMENTS
RETURN VALUE
change_axis(dim, axis)Replaces an axis. (Returns a new object)
ARGUMENTS
RETURN VALUE
change_axis!(dim_or_dimname, axis)Replaces an axis. (overwrites self)
ARGUMENTS
RETURN VALUE
insert_axis(dim_or_dimname, axis)Inserts an axis. (Returns a new object)
ARGUMENTS
RETURN VALUE
insert_axis!(dim_or_dimname, axis)Inserts an axis. (overwrites self)
ARGUMENTS
RETURN VALUE
transpose( *dims )Transpose.
ARGUMENTS
RETURN VALUE