ada.io.geneactiv#
Module for reading and cutting GeneActive data.
Classes#
A class for storing and handling epoched data generated by GeneActiv-style MVM method. |
|
A class for storing and handling raw data generated by GeneActiv. |
Module Contents#
- class GeneActivMVM[source]#
A class for storing and handling epoched data generated by GeneActiv-style MVM method.
- cut_by_dates(start_date, end_date=None)[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:
- 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:
- cut_by_timestamp(start_ts, end_ts=None)[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:
- export(path)[source]#
Export object to .csv file fully resembling the manufacturer .csv format.
- Parameters:
path (str) – Path to .csv file to which data will be exported.
- static load_file(path)[source]#
Loading .csv file with epoched data generated by the GeneActiv software or the MVM method.
- Parameters:
path (str) – Path .csv file.
- Raises:
ValueError – Unsupported file format otherwise.
- Returns:
Object containing data.
- Return type:
- static preview_metadata(path)[source]#
Preview metadata without loading the whole file.
- Parameters:
path (str) – Path to a file
- 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 button: numpy.ndarray#
Sum of button values (1=pressed) over epochs.
- Return type:
numpy.ndarray
- 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 lux: numpy.ndarray#
Epoch-wise mean lightmeter values in lux.
- Return type:
numpy.ndarray
- property metadata: dict#
Metadata associated with the raw recording and the device.
- Return type:
dict
- property mvm: numpy.ndarray#
Mean vector magnitude calculated as sum of vlens in the epoch.
- Return type:
numpy.ndarray
- property peak_lux: numpy.ndarray#
Maximum lightmeter value for each epoch (in lux).
- Return type:
numpy.ndarray
- property temperature: numpy.ndarray#
Epoch-wise mean recorded temperature in Celsius degrees.
- Return type:
numpy.ndarray
- property timestamp: numpy.ndarray#
Timestamp of the epoch’s end.
- Return type:
numpy.ndarray
- property to_score: numpy.ndarray#
Data to be scored by scoring algorithms.
- Return type:
numpy.ndarray
- property x: numpy.ndarray#
Mean acceleration (in g) along x axis.
- Return type:
numpy.ndarray
- property x_std: numpy.ndarray#
Epoch-wise standard deviation along x axis.
- Return type:
numpy.ndarray
- property y: numpy.ndarray#
Epoch-wise mean acceleration (in g) along y axis.
- Return type:
numpy.ndarray
- property y_std: numpy.ndarray#
Epoch-wise standard deviation along y axis.
- Return type:
numpy.ndarray
- property z: numpy.ndarray#
Epoch-wise mean acceleration (in g) along z axis.
- Return type:
numpy.ndarray
- property z_std: numpy.ndarray#
Epoch-wise standard deviation along z axis.
- Return type:
numpy.ndarray
- class RawGeneActiv[source]#
A class for storing and handling raw data generated by GeneActiv.
- 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:
- 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:
- 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:
- export(path)[source]#
Export object to .csv file fully resembling the manufacturer .csv format.
- Parameters:
path (str) – Path to .csv file to which data will be exported.
- static load_file(path)[source]#
Loading file generated by the GeneActiv device.
- Parameters:
path (str) – Path to .bin or .csv file.
- Raises:
ValueError – Unsupported file format otherwise.
- Returns:
Object containing data.
- Return type:
- 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 button: numpy.ndarray#
Button values (1=pressed).
- Return type:
numpy.ndarray
- 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 lux: numpy.ndarray#
Lightmeter values in lux.
- Return type:
numpy.ndarray
- 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 temperature: numpy.ndarray#
Recorded temperature in Celsius degrees.
- Return type:
numpy.ndarray
- 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