cedalion.dataclasses.recording
Recording class definition for timeseries data.
Classes
|
Main container for analysis objects. |
- class cedalion.dataclasses.recording.Recording(
- timeseries: ~collections.OrderedDict[str,
- cdt.NDTimeSeries] = <factory>,
- masks: ~collections.OrderedDict[str,
- ~xarray.core.dataarray.DataArray] = <factory>,
- geo3d: cdt.LabeledPointCloud = <factory>,
- geo2d: cdt.LabeledPointCloud = <factory>,
- stim: ~pandas.core.frame.DataFrame = <factory>,
- aux_ts: ~collections.OrderedDict[str,
- cdt.NDTimeSeries] = <factory>,
- aux_obj: ~collections.OrderedDict[str,
- ~typing.Any] = <factory>,
- head_model: ~typing.Any | None = None,
- meta_data: ~collections.OrderedDict[str,
- ~typing.Any] = <factory>,
- _measurement_lists: ~collections.OrderedDict[str,
- ~pandas.core.frame.DataFrame] = <factory>,
Bases:
object
Main container for analysis objects.
The Recording class holds timeseries adjunct objects in ordered dictionaries. It maps to the NirsElement in the snirf format but it also holds additional attributes (masks, headmodel, aux_obj) for which there is no corresponding entity in the snirf format.
- timeseries[source]
A dictionary of timeseries objects. The keys are the names of the timeseries.
- Type:
OrderedDict[str, NDTimeSeries]
- masks[source]
A dictionary of masks. The keys are the names of the masks.
- Type:
OrderedDict[str, xr.DataArray]
- geo3d[source]
A labeled point cloud representing the 3D geometry of the recording.
- Type:
LabeledPointCloud
- geo2d[source]
A labeled point cloud representing the 2D geometry of the recording.
- Type:
LabeledPointCloud
- get_timeseries(key: str | None = None) cdt.NDTimeSeries [source]
Get a timeseries object by key.
- Parameters:
key (Optional[str]) – The key of the timeseries to retrieve. If None, the last timeseries is returned.
- Returns:
The requested timeseries object.
- Return type:
NDTimeSeries
- get_mask(key: str | None = None) DataArray [source]
Get a mask by key.
- Parameters:
key (Optional[str]) – The key of the mask to retrieve. If None, the last mask is returned.
- Returns:
The requested mask.
- Return type:
xr.DataArray
- set_mask(
- key: str,
- value: DataArray,
- overwrite: bool = False,
Set a mask.
- Parameters:
key (str) – The key of the mask to set.
value (xr.DataArray) – The mask to set.
overwrite (bool) – Whether to overwrite an existing mask with the same key. Defaults to False.
- get_timeseries_type(key)[source]
Get the type of a timeseries.
- Parameters:
key (str) – The key of the timeseries.
- Returns:
The type of the timeseries.
- Return type:
str
- property source_labels[source]
Get the unique source labels from the timeseries.
- Returns:
A list of unique source labels.
- Return type:
list
- property detector_labels[source]
Get the unique detector labels from the timeseries.
- Returns:
A list of unique detector labels.
- Return type:
list