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

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).

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