speasy.core.data_containers module
- class speasy.core.data_containers.DataContainer(values: array, meta: Dict = None, name: str = None, is_time_dependent: bool = True)[source]
Bases:
DataContainerProtocol[DataContainer]- astype(dtype) DataContainer[source]
- property dtype
- static empty_like(other: DataContainer) DataContainer[source]
- static from_dictionary(dictionary: ~typing.Dict[str, str | ~typing.Dict[str, str] | ~typing.List], dtype=<class 'numpy.float64'>) DataContainer[source]
- property meta
- property name
- property ndim
- static ones_like(other: DataContainer) DataContainer[source]
- static reserve_like(other: DataContainer, length: int = 0) DataContainer[source]
- reshape(new_shape) DataContainer[source]
- select(indices, inplace=False) DataContainer[source]
- property shape
- unit_applied(unit: str = None) DataContainer[source]
- property values: array
- static zeros_like(other: DataContainer) DataContainer[source]
- class speasy.core.data_containers.DataContainerProtocol(*args, **kwargs)[source]
Bases:
Protocol[T]- static from_dictionary(dictionary: ~typing.Dict[str, str | ~typing.Dict[str, str] | ~typing.List], dtype=<class 'numpy.float64'>) T[source]
- property shape
- property values: array
- class speasy.core.data_containers.VariableAxis(values: array = None, meta: Dict = None, name: str = '', is_time_dependent: bool = False, data: DataContainer = None)[source]
Bases:
DataContainerProtocol[VariableAxis]- astype(dtype) VariableAxis[source]
- property data_container: DataContainer
- empty_like() VariableAxis[source]
- static from_dictionary(dictionary: Dict[str, str | Dict[str, str] | List], time=None) VariableAxis[source]
- ones_like() VariableAxis[source]
- static reserve_like(other: VariableAxis, length: int = 0) VariableAxis[source]
- select(indices, inplace=False) VariableAxis[source]
- property shape
- property values: array
- view(index_range: slice | ndarray) VariableAxis[source]
- zeros_like() VariableAxis[source]
- class speasy.core.data_containers.VariableTimeAxis(values: array = None, meta: Dict = None, name: str = 'time', data: DataContainer = None)[source]
Bases:
DataContainerProtocol[VariableTimeAxis]- astype(dtype) VariableTimeAxis[source]
- property data_container: DataContainer
- empty_like() VariableTimeAxis[source]
- static from_dictionary(dictionary: Dict[str, str | Dict[str, str] | List], time=None) VariableTimeAxis[source]
- ones_like() VariableTimeAxis[source]
- static reserve_like(other: VariableTimeAxis, length: int = 0) VariableTimeAxis[source]
- select(indices, inplace=False) VariableTimeAxis[source]
- property shape
- property values: array
- view(index_range: slice | ndarray) VariableTimeAxis[source]
- zeros_like() VariableTimeAxis[source]
- speasy.core.data_containers.fill_value_mask(values: ndarray, meta: Dict) ndarray | None[source]
Returns a boolean mask of the entries equal to the ISTP FILLVAL, or None when no mask can be computed at all.
None means undecidable, not “nothing matched”: either FILLVAL is absent, or it is a string while the data is numeric, which warns. That second case is a real ISTP pattern rather than a hypothetical – CDAWeb mis-declares some numeric variables’ FILLVAL with a TT2000/EPOCH attribute type, which the data codec stringifies (e.g. ela_att_solution_date), and there is no reliable way to recover the intended numeric sentinel from that mismatch.
A NaN FILLVAL needs no special case: NaN != NaN, so it simply matches nothing, which is right because such data already carries NaN where it means fill.