cedalion.dataclasses.schemas
Data array schemas and utilities to build labeled data arrays.
Functions
|
Build a labeled point cloud data array. |
|
Build a labeled time series data array. |
|
|
Classes
|
Exceptions
- class cedalion.dataclasses.schemas.DataArraySchema(dims: tuple[str], coords: tuple[tuple[str, tuple[str]]])[source]
Bases:
object
- cedalion.dataclasses.schemas.build_timeseries(
- data: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes],
- dims: List[str],
- time: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes],
- channel: List[str],
- value_units: str,
- time_units: str,
- other_coords: dict[str, _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]] = {},
Build a labeled time series data array.
- Parameters:
data (ArrayLike) – The data values.
dims (List[str]) – The dimension names.
time (ArrayLike) – The time values.
channel (List[str]) – The channel names.
value_units (str) – The units of the data values.
time_units (str) – The units of the time values.
other_coords (dict[str, ArrayLike]) – Additional coordinates.
- Returns:
The labeled time series data array.
- Return type:
da (xr.DataArray)
- cedalion.dataclasses.schemas.build_labeled_points(
- coordinates: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None = None,
- crs: str = 'pos',
- units: Unit | str | None = '1',
- labels: list[str] | None = None,
- types: list[str] | None = None,
Build a labeled point cloud data array.
- Parameters:
coordinates (ArrayLike, optional) – The coordinates of the points. Default: None.
crs (str, optional) – The coordinate system. Defaults to “pos”.
units (Optional[pint.Unit | str], optional) – The units of the coordinates. Defaults to “1”.
labels (Optional[list[str]], optional) – The labels of the points. Defaults to None.
types (Optional[list[str]], optional) – The types of the points. Defaults to None.
- Returns:
The labeled point cloud data array.
- Return type:
xr.DataArray