multimodemodel.Variable#
- class multimodemodel.Variable(data, grid, time)[source]#
Variable class consisting of the data, a Grid instance and a time stamp.
A Variable object contains the data for a single time slice of a variable as a Array, the grid object describing the grid arrangement and a single time stamp. The data attribute can take the value of
Nonewhich is treated like an array of zeros when adding the variable to another variable.Variable implement summation with another Variable object, see
Variable.__add__().- Parameters:
data (
Array, defaultNone) – Array containing a single time slice of a variable. If it is None, it will be interpreted as zero. To ensure andarrayas return type, use the propertysafe_data.grid (
Grid) – Grid on which the variable is defined.time (
datetime64) – Time stamp of the time slice.
- Raises:
ValueError – Raised if data.shape does not match grid.shape.
- __init__(data, grid, time)#
Initialize Variable object with given data and grid.
Methods
__init__(data, grid, time)Initialize Variable object with given data and grid.
copy()Return a copy.
merge(others, merger)Merge variable.
split(splitter)Split variable.
Attributes
Return variable as
xarray.DataArray.Return data or, if it is None, a zero array of appropriate shape.