cfdm.core.Data¶
-
class
cfdm.core.
Data
(array=None, units=None, calendar=None, fill_value=None, source=None, copy=True, _use_array=True, _custom_deep_copy=False)[source]¶ Bases:
cfdm.core.abstract.container.Container
An orthogonal multidimensional array with masking and units.
New in version (cfdm): 1.7.0
Initialisation
- Parameters
- array: data_like, optional
The array of values.
A data_like object is any object that can be converted to a
Data
object, i.e.numpy
array_like objects,Data
objects, and cfdm.core instances that containData
objects.Note that for
Data
objects and cfdm.core objects that containData
objects,cfdm.core.Data(array)
is equivalent tocfdm.core.Data(source=array.__data__())
.Ignored if the source parameter is set.
- array:
numpy
array_like, optional The array of values.
Note that if array is another
Data
instance thencfdm.core.Data(array)
is equivalent tocfdm.core.Data(source=array)
.Ignored if the source parameter is set.
- units:
str
, optional The physical units of the data. Ignored if the source parameter is set.
The units may also be set after initialisation with the
set_units
method.- Parameter example:
units='km hr-1'
- Parameter example:
units='days since 2018-12-01'
- calendar:
str
, optional The calendar for reference time units. Ignored if the source parameter is set.
The calendar may also be set after initialisation with the
set_calendar
method.- Parameter example:
calendar='360_day'
- 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.The fill value may also be set after initialisation with the
set_fill_value
method.- Parameter example:
fill_value=-999.
- source: optional
Initialise the data, units, calendar and fill value from those of source.
- copy:
bool
, optional If False then do not deep copy input parameters prior to initialisation. By default arguments are deep copied.
Inspection¶
Attributes
Return an independent numpy array containing the data. |
|
Data-type of the data elements. |
|
Number of data dimensions. |
|
Tuple of data dimension sizes. |
|
Number of elements in the data. |
Units¶
Delete the units. |
|
Return the units. |
|
Whether units have been set. |
|
Set the units. |
|
Delete the calendar. |
|
Return the calendar. |
|
Whether a calendar has been set. |
|
Set the calendar. |
Data creation routines¶
From existing data¶
Return a deep copy of the data. |
Date-time support¶
Delete the calendar. |
|
Return the calendar. |
|
Whether a calendar has been set. |
|
Set the calendar. |
Mask support¶
Delete the fill value. |
|
Return the missing data value. |
|
Whether a fill value has been set. |
|
Set the missing data value. |
Miscellaneous¶
Return the underlying array object. |
Special¶
Called by the |
|
Return repr(self). |
|
Return str(self). |
Docstring substitutions¶
Methods
Return the special docstring substitutions. |
|
Returns the substitutions that apply to methods of the class. |
|
Returns the class {{package}} substitutions package depth. |
|
Returns method names excluded in the class substitutions. |