A class to handle discretized grids of physical quantities.
Grid.new( *axes )
Constructor.
RETURN VALUE
axnames
Returns the names of the axes
RETURN VALUE
lost_axes
Returns 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
coord_dim_indices(coordname)
Coordinate name --> dimension indices.
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
copy
Makes 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
shape
Returns 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)
cut_assoccoord(hasharg)
change_axis(dim, axis)
Replaces an axis. (Returns a new object)
ARGUMENTS
RETURN VALUE
insert_axis(dim, axis)
Inserts an axis. (non destructive; returns a new object)
ARGUMENTS
RETURN VALUE
transpose( *dims )
Transpose.
ARGUMENTS
RETURN VALUE