Dimensions

The Dimensions class keeps track of the different dimensions in an ARTS atmosphere. The purpose of this class is to allow the inferral of dimensions from the provided data, but at the same time to be able to identify inconsistencies.

Attributes:

p(Dimension): Dimension object representing the size of the
ARTS pressure grid
lat(Dimension) Dimension object representing the size of the
latitude grid
lon(Dimension) Dimension object representing the size of the
longitude grid
joker(Joker) Dimension object representing a dimensions that
can take an arbitrary value.
class parts.dimensions.Dimension(name)[source]

Bases: object

Dimensions of data arrays in ARTS.

The required dimensions of most array data used in an ARTS simulation are fixed by the dimensions of the atmosphere. The Dimension class provides a symbolic representation of these dimensions in an ARTS simulation, so that these can be inferred and checked for consistency.

Dimension objects are used to define the dimensions of ARTS data and keep track of the different values inferred from user-provided data.

add_deduction(ws, value, who)[source]

If a value of a dimension becomes apparent from data it should be signaled to the Dimension object. The dimension object keeps track of these “deductions” for each workspace separately.

Parameters:

ws(typhon.arts.workspace.Workspace): Workspace object
for which the dimension was deduced.

value(Int): The deduced dimenions

who(str): The name of the variable from which this
value was deduced.
check(ws, n, who)[source]

Check given value for consistency.

Parameters:

ws(typhon.arts.workspace.Workspace): The workspace for which
to check the deduction.

n(int): The value which to check against previous deduced values.

Returns:

True if this is the first deduction or is previous deuctions agree with the current value. False otherwise.
get_value(ws)[source]

Get the deduced value of the dimension.

Parameters:

ws(typhon.arts.workspace.Workspace) The workspace object for
which the value of the dimension should be deduced.

Raises:

Exception: If no or inconsistent values have been deduced.
class parts.dimensions.Joker(name)[source]

Bases: parts.dimensions.Dimension

A dimension that can take an arbitrary value.

add_deduction(ws, value, who)[source]

This function does nothing.

check(*args, **kwargs)[source]

This function does nothing.

get_value(*args, **kwargs)[source]

Raises an exception because it doesn’t make sense to try an get a value from a joker dimension.

Raises:

Exception: If no or inconsistent values have been deduced.