ada.data_containers.epoched

ada.data_containers.epoched#

Classes#

EpochedActivityIndex

A class for storing and handling data epoched by the ActivityIndex method.

EpochedCK

A class for storing and handling data epoched by the Cole-Kripke-like method method.

EpochedMIMS

A class for storing and handling data epoched by the MIMS method.

GenericMVM

A class for storing and handling data epoched by the MVM method provided the that was not GeneActivRaw.

Resampled

A class for storing and handling data epoched by the standard downsampling.

Module Contents#

class EpochedActivityIndex[source]#

A class for storing and handling data epoched by the ActivityIndex method.

cut_by_dates(start_date, end_date)#

Create new object with the data cut by given dates.

Parameters:
  • start_date (str) – ISO-formated date of outputa data beginning.

  • end_date (str | None) – ISO-formated date of output data end. If None, last sample of output data will be last sample of input data.

Returns:

Object containing the cutted data of the same type as input data.

Return type:

_ActiData

cut_by_samples(start_sample, end_sample)[source]#

Create new object with the data cut by given indexes.

Parameters:
  • start_sample (int) – First sample of output data.

  • end_sample (int) – Sample after the last sample of output data.

Returns:

Object containing the cutted data.

Return type:

EpochedActivityIndex

cut_by_timestamp(start_ts, end_ts)[source]#

Create new object with the data cut by given timestamps.

Parameters:
  • start_ts (float) – Unix timestamp of output data beginning.

  • end_ts (float | None) – Unix timestamp of output data end. If None, last sample of output data will be last sample of input data.

Returns:

Object containing the cutted data.

Return type:

EpochedActivityIndex

export(path)[source]#

Exports object data to the generic format. All metadata are preserved in the file.

Parameters:

path (str) – Path to the .ada file.

static load_file(path)[source]#

Loading file saved in the generic format provided by this package.

Parameters:

path (str) – Path to the .ada file.

Returns:

Object containing data.

Return type:

EpochedActivityIndex

trim(time_from_start, time_from_end)#

Removes points from the recording beginning and end by given times.

Parameters:
  • time_from_start (str | None) – Time in HH:MM:SS.sss from the recording beginning. Microseconds can be ommited. If None, data is returned from first sample.

  • time_from_end (str | None) – Time in HH:MM:SS.sss from the recording end. Microseconds can be ommited. If None, data is returned to the end sample.

Returns:

Trimmed data container of the same type as input one.

Return type:

_ActiData

ActiData#
property channel_names: list[str]#

List of names for the channels stored in the data field.

Return type:

list[str]

property data: numpy.ndarray#

Actigraphic data in format (n_channels, n_samples).

Return type:

numpy.ndarray

property epoching_method_metadata: dict#

Metadata asssociated with the epoching method and its parameters.

Return type:

dict

property first_sample_timestamp: float#

Unix timestamp of first sample.

Return type:

float

property fs: float#

Sampling frequency of the data (not the same as recording frequency for epoched data).

Return type:

float

property id: str#

ID of the recording set during device configuration.

Return type:

str

property last_sample_timestamp: float#

Unix timestamp of last sample.

Return type:

float

property metadata: dict#

Metadata associated with the raw recording and the device.

Return type:

dict

property timestamp: numpy.ndarray#

Unix timestamp of the data, relative to the recording beginning.

Return type:

numpy.ndarray

property to_score: numpy.ndarray#

Data to be scored by scoring algorithms.

Return type:

numpy.ndarray

class EpochedCK[source]#

A class for storing and handling data epoched by the Cole-Kripke-like method method.

cut_by_dates(start_date, end_date)#

Create new object with the data cut by given dates.

Parameters:
  • start_date (str) – ISO-formated date of outputa data beginning.

  • end_date (str | None) – ISO-formated date of output data end. If None, last sample of output data will be last sample of input data.

Returns:

Object containing the cutted data of the same type as input data.

Return type:

_ActiData

cut_by_samples(start_sample, end_sample)[source]#

Create new object with the data cut by given indexes.

Parameters:
  • start_sample (int) – First sample of output data.

  • end_sample (int) – Sample after the last sample of output data.

Returns:

Object containing the cutted data.

Return type:

EpochedCK

cut_by_timestamp(start_ts, end_ts)[source]#

Create new object with the data cut by given timestamps.

Parameters:
  • start_ts (float) – Unix timestamp of output data beginning.

  • end_ts (float | None) – Unix timestamp of output data end. If None, last sample of output data will be last sample of input data.

Returns:

Object containing the cutted data.

Return type:

EpochedCK

export(path)[source]#

Exports object data to the generic format. All metadata are preserved in the file.

Parameters:

path (str) – Path to the .ada file.

static load_file(path)[source]#

Loading file saved in the generic format provided by this package.

Parameters:

path (str) – Path to the .ada file.

Returns:

Object containing data.

Return type:

EpochedCK

trim(time_from_start, time_from_end)#

Removes points from the recording beginning and end by given times.

Parameters:
  • time_from_start (str | None) – Time in HH:MM:SS.sss from the recording beginning. Microseconds can be ommited. If None, data is returned from first sample.

  • time_from_end (str | None) – Time in HH:MM:SS.sss from the recording end. Microseconds can be ommited. If None, data is returned to the end sample.

Returns:

Trimmed data container of the same type as input one.

Return type:

_ActiData

ActiData#
property channel_names: list[str]#

List of names for the channels stored in the data field.

Return type:

list[str]

property data: numpy.ndarray#

Actigraphic data in format (n_channels, n_samples).

Return type:

numpy.ndarray

property epoching_method_metadata: dict#

Metadata asssociated with the epoching method and its parameters.

Return type:

dict

property first_sample_timestamp: float#

Unix timestamp of first sample.

Return type:

float

property fs: float#

Sampling frequency of the data (not the same as recording frequency for epoched data).

Return type:

float

property id: str#

ID of the recording set during device configuration.

Return type:

str

property last_sample_timestamp: float#

Unix timestamp of last sample.

Return type:

float

property metadata: dict#

Metadata associated with the raw recording and the device.

Return type:

dict

property timestamp: numpy.ndarray#

Unix timestamp of the data, relative to the recording beginning.

Return type:

numpy.ndarray

property to_score: numpy.ndarray#

Data to be scored by scoring algorithms.

Return type:

numpy.ndarray

class EpochedMIMS[source]#

A class for storing and handling data epoched by the MIMS method.

cut_by_dates(start_date, end_date)#

Create new object with the data cut by given dates.

Parameters:
  • start_date (str) – ISO-formated date of outputa data beginning.

  • end_date (str | None) – ISO-formated date of output data end. If None, last sample of output data will be last sample of input data.

Returns:

Object containing the cutted data of the same type as input data.

Return type:

_ActiData

cut_by_samples(start_sample, end_sample)[source]#

Create new object with the data cut by given indexes.

Parameters:
  • start_sample (int) – First sample of output data.

  • end_sample (int) – Sample after the last sample of output data.

Returns:

Object containing the cutted data.

Return type:

Resampled

cut_by_timestamp(start_ts, end_ts)[source]#

Create new object with the data cut by given timestamps.

Parameters:
  • start_ts (float) – Unix timestamp of output data beginning.

  • end_ts (float | None) – Unix timestamp of output data end. If None, last sample of output data will be last sample of input data.

Returns:

Object containing the cutted data.

Return type:

Resampled

export(path)[source]#

Exports object data to the generic format. All metadata are preserved in the file.

Parameters:

path (str) – Path to the .ada file.

static load_file(path)[source]#

Loading file saved in the generic format provided by this package.

Parameters:

path (str) – Path to the .ada file.

Returns:

Object containing data.

Return type:

Resampled

trim(time_from_start, time_from_end)#

Removes points from the recording beginning and end by given times.

Parameters:
  • time_from_start (str | None) – Time in HH:MM:SS.sss from the recording beginning. Microseconds can be ommited. If None, data is returned from first sample.

  • time_from_end (str | None) – Time in HH:MM:SS.sss from the recording end. Microseconds can be ommited. If None, data is returned to the end sample.

Returns:

Trimmed data container of the same type as input one.

Return type:

_ActiData

ActiData#
property channel_names: list[str]#

List of names for the channels stored in the data field.

Return type:

list[str]

property data: numpy.ndarray#

Actigraphic data in format (n_channels, n_samples).

Return type:

numpy.ndarray

property epoching_method_metadata: dict#

Metadata asssociated with the epoching method and its parameters.

Return type:

dict

property first_sample_timestamp: float#

Unix timestamp of first sample.

Return type:

float

property fs: float#

Sampling frequency of the data (not the same as recording frequency for epoched data).

Return type:

float

property id: str#

ID of the recording set during device configuration.

Return type:

str

property last_sample_timestamp: float#

Unix timestamp of last sample.

Return type:

float

property metadata: dict#

Metadata associated with the raw recording and the device.

Return type:

dict

property timestamp: numpy.ndarray#

Unix timestamp of the data, relative to the recording beginning.

Return type:

numpy.ndarray

property to_score: numpy.ndarray#

Data to be scored by scoring algorithms.

Return type:

numpy.ndarray

class GenericMVM[source]#

A class for storing and handling data epoched by the MVM method provided the that was not GeneActivRaw.

cut_by_dates(start_date, end_date)#

Create new object with the data cut by given dates.

Parameters:
  • start_date (str) – ISO-formated date of outputa data beginning.

  • end_date (str | None) – ISO-formated date of output data end. If None, last sample of output data will be last sample of input data.

Returns:

Object containing the cutted data of the same type as input data.

Return type:

_ActiData

cut_by_samples(start_sample, end_sample)[source]#

Create new object with the data cut by given indexes.

Parameters:
  • start_sample (int) – First sample of output data.

  • end_sample (int) – Sample after the last sample of output data.

Returns:

Object containing the cutted data.

Return type:

GenericMVM

cut_by_timestamp(start_ts, end_ts)[source]#

Create new object with the data cut by given timestamps.

Parameters:
  • start_ts (float) – Unix timestamp of output data beginning.

  • end_ts (float | None) – Unix timestamp of output data end. If None, last sample of output data will be last sample of input data.

Returns:

Object containing the cutted data.

Return type:

GenericMVM

export(path)[source]#

Exports object data to the generic format. All metadata are preserved in the file.

Parameters:

path (str) – Path to the .ada file.

static load_file(path)[source]#

Loading file saved in the generic format provided by this package.

Parameters:

path (str) – Path to the .ada file.

Returns:

Object containing data.

Return type:

GenericMVM

trim(time_from_start, time_from_end)#

Removes points from the recording beginning and end by given times.

Parameters:
  • time_from_start (str | None) – Time in HH:MM:SS.sss from the recording beginning. Microseconds can be ommited. If None, data is returned from first sample.

  • time_from_end (str | None) – Time in HH:MM:SS.sss from the recording end. Microseconds can be ommited. If None, data is returned to the end sample.

Returns:

Trimmed data container of the same type as input one.

Return type:

_ActiData

ActiData#
property channel_names: list[str]#

List of names for the channels stored in the data field.

Return type:

list[str]

property data: numpy.ndarray#

Actigraphic data in format (n_channels, n_samples).

Return type:

numpy.ndarray

property epoching_method_metadata: dict#

Metadata asssociated with the epoching method and its parameters.

Return type:

dict

property first_sample_timestamp: float#

Unix timestamp of first sample.

Return type:

float

property fs: float#

Sampling frequency of the data (not the same as recording frequency for epoched data).

Return type:

float

property id: str#

ID of the recording set during device configuration.

Return type:

str

property last_sample_timestamp: float#

Unix timestamp of last sample.

Return type:

float

property metadata: dict#

Metadata associated with the raw recording and the device.

Return type:

dict

property timestamp: numpy.ndarray#

Unix timestamp of the data, relative to the recording beginning.

Return type:

numpy.ndarray

property to_score: numpy.ndarray#

Data to be scored by scoring algorithms.

Return type:

numpy.ndarray

class Resampled[source]#

A class for storing and handling data epoched by the standard downsampling.

cut_by_dates(start_date, end_date)#

Create new object with the data cut by given dates.

Parameters:
  • start_date (str) – ISO-formated date of outputa data beginning.

  • end_date (str | None) – ISO-formated date of output data end. If None, last sample of output data will be last sample of input data.

Returns:

Object containing the cutted data of the same type as input data.

Return type:

_ActiData

cut_by_samples(start_sample, end_sample)[source]#

Create new object with the data cut by given indexes.

Parameters:
  • start_sample (int) – First sample of output data.

  • end_sample (int) – Sample after the last sample of output data.

Returns:

Object containing the cutted data.

Return type:

Resampled

cut_by_timestamp(start_ts, end_ts)[source]#

Create new object with the data cut by given timestamps.

Parameters:
  • start_ts (float) – Unix timestamp of output data beginning.

  • end_ts (float | None) – Unix timestamp of output data end. If None, last sample of output data will be last sample of input data.

Returns:

Object containing the cutted data.

Return type:

Resampled

export(path)[source]#

Exports object data to the generic format. All metadata are preserved in the file.

Parameters:

path (str) – Path to the .ada file.

static load_file(path)[source]#

Loading file saved in the generic format provided by this package.

Parameters:

path (str) – Path to the .ada file.

Returns:

Object containing data.

Return type:

Resampled

trim(time_from_start, time_from_end)#

Removes points from the recording beginning and end by given times.

Parameters:
  • time_from_start (str | None) – Time in HH:MM:SS.sss from the recording beginning. Microseconds can be ommited. If None, data is returned from first sample.

  • time_from_end (str | None) – Time in HH:MM:SS.sss from the recording end. Microseconds can be ommited. If None, data is returned to the end sample.

Returns:

Trimmed data container of the same type as input one.

Return type:

_ActiData

ActiData#
property channel_names: list[str]#

List of names for the channels stored in the data field.

Return type:

list[str]

property data: numpy.ndarray#

Actigraphic data in format (n_channels, n_samples).

Return type:

numpy.ndarray

property epoching_method_metadata: dict#

Metadata asssociated with the epoching method and its parameters.

Return type:

dict

property first_sample_timestamp: float#

Unix timestamp of first sample.

Return type:

float

property fs: float#

Sampling frequency of the data (not the same as recording frequency for epoched data).

Return type:

float

property id: str#

ID of the recording set during device configuration.

Return type:

str

property last_sample_timestamp: float#

Unix timestamp of last sample.

Return type:

float

property metadata: dict#

Metadata associated with the raw recording and the device.

Return type:

dict

property timestamp: numpy.ndarray#

Unix timestamp of the data, relative to the recording beginning.

Return type:

numpy.ndarray

property to_score: numpy.ndarray#

Data to be scored by scoring algorithms.

Return type:

numpy.ndarray