class NumRU::Grid

A class to handle discretized grids of physical quantities.

Class Methods

Grid.new( *axes )

Constructor.

RETURN VALUE

Instance Methods

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

RETURN VALUE

cut_rank_conserving(*args)

Similar to cut, but the rank is conserved by not eliminating any dimension (whose length could be one).

cut_assoccoord(hasharg)

Cut with respect to the asscoated coordinates. Similar to cut, when the argeuemnt is a Hash, but hash keys are the names of the asscoated coordinates.

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