ada.io.actigraph

ada.io.actigraph#

Classes#

RawActiGraph

A class for storing and handling raw data generated by Actigraph devices.

Module Contents#

class RawActiGraph[source]#

A class for storing and handling raw data generated by Actigraph devices.

cut_by_dates(start_date, end_date)[source]#

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.

Return type:

RawActiGraph

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:

RawActiGraph

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:

RawActiGraph

export(path)[source]#

Export data to .csv file resembling the ones generated by ActiLife.

Parameters:

path (str) – Path to the output file.

static load_file(path)[source]#

Loading file generated by the ActiGraph gt3x-compliant device.

Parameters:

path (str) – Path to .gt3x or .csv file.

Raises:

ValueError – Unsupported file format otherwise.

Returns:

Object containing data.

Return type:

RawActiGraph

static preview_metadata(path)[source]#

Preview of metadata without loading the file.

Parameters:

path (str) – Path to the file

Raises:

ValueError – Wrong format

Returns:

Metadata and channel names.

Return type:

tuple[dict, list[str]]

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 dynamic_range: float#

Dynamic range (in g) of the digital converter.

Return type:

float

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 stationary_variance: float#

Variance of actigraph laying still (transducer noise).

Return type:

float

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. Here equal to vlen.

Return type:

numpy.ndarray

property vlen: numpy.ndarray#

Mean vector magnitude (in g) calculated as |sqrt(x**2 + y**2 + z**2) - 1|.

Return type:

numpy.ndarray

property x: numpy.ndarray#

Acceleration (in g) along x axis.

Return type:

numpy.ndarray

property y: numpy.ndarray#

Acceleration (in g) along y axis.

Return type:

numpy.ndarray

property z: numpy.ndarray#

Acceleration (in g) along z axis.

Return type:

numpy.ndarray