cfdm.core.Data¶
-
class
cfdm.core.
Data
(array=None, units=None, calendar=None, fill_value=None, source=None, copy=True, _use_array=True)[source]¶ Bases:
cfdm.core.abstract.container.Container
An orthogonal multidimensional array with masked values and units.
New in version 1.7.0.
Initialization
Parameters: - array: subclass of
Array
The array of values. Ignored if the source parameter is set.
- units:
str
, optional The physical units of the data. Ignored if the source parameter is set.
- Parameter example:
units='km hr-1'
- Parameter example:
units='days since 2018-12-01'
The units may also be set after initialisation with the
set_units
method.- calendar:
str
, optional The calendar for reference time units. Ignored if the source parameter is set.
- Parameter example:
calendar='360_day'
The calendar may also be set after initialisation with the
set_calendar
method.- fill_value: optional
The fill value of the data. By default, or if set to
None
, thenumpy
fill value appropriate to the array’s data type will be used (seenumpy.ma.default_fill_value
). Ignored if the source parameter is set.- Parameter example:
fill_value=-999.
The fill value may also be set after initialisation with the
set_fill_value
method.- source: optional
Initialize the data, units, calendar and fill value from those of source.
- source: optional
Initialize the array, units, calendar and fill value from those of source.
- copy:
bool
, optional If False then do not deep copy input parameters prior to initialization. By default arguments are deep copied.
- array: subclass of
Inspection¶
Attributes
array |
Return an independent numpy array containing the data. |
dtype |
Data-type of the data elements. |
ndim |
Number of data dimensions. |
shape |
Tuple of data dimension sizes. |
size |
Number of elements in the data. |
Units¶
Methods
get_units |
Return the units. |
set_units |
Set the units. |
set_calendar |
Set the calendar. |
get_calendar |
Return the calendar. |
Fill value¶
Methods
get_fill_value |
Return the missing data value. |
set_fill_value |
Set the missing data value. |