Module reference

devicely.EmpaticaReader

Empatica E4 is a wearable device that offers real-time physiological data acquisition such as blood volume pulse, electrodermal activity (EDA), heart rate, interbeat intervals, 3-axis acceleration and skin temperature.

class devicely.empatica.EmpaticaReader(path)

Read, timeshift and write data generated by Empatica E4.

start_times

Contain the timestamp of the first measurement for all measured signals (BVP, ACC, etc.).

Type

dict

sample_freqs

Contain the sampling frequencies of all measured signals in Hz.

Type

dict ]

IBI

Contain inter-beat interval data. The column “seconds_since_start” is the time in seconds between the start of measurements and the column “IBI” is the duration in seconds between consecutive beats.

Type

pandas.DataFrame

ACC

Contain the data measured with the onboard MEMS type 3-axis accelerometer, indexed by time of measurement.

Type

pandas.DataFrame

BVP

Contain blood volume pulse data, indexed by time of measurement.

Type

pandas.DataFrame

EDA

Contain data captured from the electrodermal activity sensor, indexed by time of measurement.

Type

pandas.DataFrame

HR

Contain heart rate data, indexed by time of measurement.

Type

pandas.DataFrame

TEMP

Contain temperature data, indexed by time of measurement.

Type

pandas.DataFrame

data

Joined dataframe of the ACC, BVP, EDA, HR and TEMP dataframes (see above). May contain NaN values because sampling frequencies differ across signals.

Type

pandas.DataFrame

timeshift(shift='random')

Timeshift all time related columns as well as the starting_times dict.

Parameters

shift (None/'random', pd.Timestamp or pd.Timedelta) –

If shift is not specified, shifts the data by a random time interval between one month and two years to the past.

If shift is a timdelta, adds that timedelta to all time-related attributes.

If shift is a timestamp, shifts the data such that the earliest entry has that timestamp. The remaining values will mantain the same time difference to the first entry.

write(dir_path)

Write the signal dataframes back to individual csv files formatted the same way as they were read.

Parameters

path (str) –

Path of the directory in which the csv files are created.

If the directory exists, the csv files are written using writing mode ‘w’ ignoring other files in the directory.

If the directory doe not exist, it will be created.

devicely.SpacelabsReader

Spacelabs (SL 90217) is an oscillometric blood pressure (BP) monitor which can be used to automatically track a person’s BP in specificed time intervals.

class devicely.spacelabs.SpacelabsReader(path)

Read, timeshift, deidentify and write data generated by Spacelabs(SL90217).

data

DataFrame with the values that were read from the abp file.

Type

DataFrame

subject

Contain the sujbect’s id. Can be changed for deidentification.

Type

str

valid_measurements

Contain the number of valid measurements in the abp file.

Type

str

metadata

The measurements’ metadata. Read from the xml at the bottom of the abp file. Can be erased for deidentification.

Type

dict

deidentify(subject_id=None)

Deidentify the data by removing the original XML metadata and subject id.

Parameters

subject_id (str, optional) – New subject id to be written in the deidentified file, by default None.

timeshift(shift='random')

Timeshift the data by shifting all time related columns.

Parameters

shift (None/'random', pd.Timestamp or pd.Timedelta) –

If shift is not specified, shifts the data by a random time interval between one month and two years to the past.

If shift is a timdelta, shifts the data by that timedelta.

If shift is a timestamp, shifts the data such that the earliest entry has that timestamp. The remaining values will mantain the same time difference to the first entry.

write(path)

Write the signals and metadata to the writing path in the same format as it was read.

Parameters

path (str) – Path to writing file. Writing mode: ‘w’. Use the file extension ‘abp’ to keep the SpaceLabs standard.

devicely.FarosReader

1-lead ECG monitor FarosTM 180 from Bittium is a one channel ECG monitor with sampling frequency up to 1000 Hz and a 3D acceleration sampling up to 100Hz.

class devicely.faros.FarosReader(path)

Read, timeshift and write data generated by Bittium Faros devices.

start_time

Start time of all measurements.

Type

pandas.Timestamp

sample_freqs

Sampling frequencies of all signals in Hz.

Type

dict

units

Units of all signals

Type

dict

ECG

ECG signal, indexed by timestamp.

Type

pandas.Series

ACC

Three ACC axes, indexed by timestamp.

Type

pandas.DataFrame

Marker

Markers, indexed by timestamp.

Type

pandas.Series

HRV

HRV signal, indexed by timestamp.

Type

pandas.Series

data

Contain all signals (ECG, ACC, Marker, HRV) indexed by timestamp. Since the signals have different sampling frequencies, many values will be NaN.

Type

DataFrame

join_dataframes()

Join the individual signal dataframes by timestamp. The resulting dataframe is saved in the attribute reader.data.

timeshift(shift='random')

Timeshift the data by shifting all time related values (i.e. start_time and data.index).

Parameters

shift (None/'random', pd.Timestamp or pd.Timedelta) –

If shift is not specified, shifts the data by a random time interval between one month and two years to the past.

If shift is a timdelta, shifts the data by that timedelta.

If shift is a timestamp, shifts the data such that the earliest entry has that timestamp. The remaining values will mantain the same time difference to the first entry.

write(path, file_format='directory')

Write the data either to an EDF file or to several files into a new directory. Because of the special structure of EDF files writing to EDF is only possible for readers that have been created from an EDF file and without any changes to the ACC, ECG, Marker, HRV and sample_freqs attributes. Because we want you to be able to modify the signals, you can write the data back to a directory of individual files. Writing to a directory is the preferred method and works in all cases.

Parameters
  • path (str) – Name of the file or directory to write the data to.

  • file_format ({'directory', 'edf'}, default 'directory') – Format of the written data.

devicely.EverionReader

” Biovotion Everion is a wearable device used for the continuous monitoring of vital signs. Currently, it measures the following vital signs: heart rate, blood pulse wave, heart rate variability, activity, SPO2, blood perfusion, respiration rate, steps, energy expenditure, skin temperature, EDA / galvanic skin response (GSR), barometric pressure and sleep.

class devicely.everion.EverionReader(path, signal_tags=[6, 7, 11, 12, 15, 19, 20, 21, 118, 119], sensor_tags=[80, 81, 82, 83, 84, 85, 86], feature_tags=[14])

Read, timeshift and write data generated by Biovotion Everion. You can find example data here. Each measurement has a tag which is an information about the type of measurement. By default, only some of the tags are read for signals, sensors and features. You can find these tags via self.default_signal_tags, self.default_sensor_tags and self.default_feature_tags. You can find out all available tags and what they mean by accessing the attributes EverionReader.SIGNAL_TAGS, EverionReader.SENSOR_TAGS and EverionReader.FEATURE_TAGS.

raw dataframes

These dataframes are accessible via the attributes aggregates, analytics_events, attributes_dailys, everion_events, features, sensors and signals. Each dataframe corresponds to a file in the reading path.

Type

dataframes

data

Joined version of the raw dataframes (aggregates, analytics_events, attributes_dailys, everion_events, features, sensors and signals).

Type

DataFrame

SIGNAL_TAGS

Signal tag numbers and their meaning.

Type

dict

SENSOR_TAGS

Sensor tag numbers and their meaning.

Type

dict

FEATURE_TAGS

Feature tag numbers and their meaning.

Type

dict

default_signal_tags

Subset of tags that are read by default for signals.

Type

list

default_sensor_tags

Subset of tags that are read by default for sensors.

Type

list

default_feature_tags

Subset of tags that are read by default for features.

Type

list

timeshift(shift='random')

Timeshift the data by shifting all time related columns in the joined dataframe (data) and raw dataframes (aggregates, analytics_events, attributes_dailys, everion_events, features, sensors, signals).

Parameters

shift (None/'random', pd.Timestamp or pd.Timedelta) –

If shift is not specified, shifts the data by a random time interval between one month and two years to the past.

If shift is a timdelta, shifts the data by that timedelta.

If shift is a timestamp, shifts the data such that the earliest entry has that timestamp. The remaining values will mantain the same time difference to the first entry.

write(path)

Write the raw dataframes back to individual files in the same format as they were read. Thus, the resulting directory can be read again using an EverionReader.

Parameters

path (str) – Path to the writing directory.

devicely.ShimmerReader

Shimmer Consensys GSR is a device that is used to collect sensor data in real time and it contains sensors such as GSR / EDA, photoplethysmography (PPG), 3-axis accelerometer, 3-axis gyroscope, 3-axis magnetometer & integrated altimeter.

class devicely.shimmer_plus.ShimmerPlusReader(path)

Read, timeshift and write data generated by Shimmer Consensys GSR.

data

DataFrame with the read signals. The column ‘Shimmer_40AC_Timestamp_Unix_CAL’ contains the timestamps of measurement.

Type

DataFrame

units

A unit for each column in the dataframe.

Type

pandas.Series

timeshift(shift='random')

Timeshift the data by shifting all time related columns.

Parameters

shift (None/'random', pd.Timestamp or pd.Timedelta) –

If shift is not specified, shifts the data by a random time interval between one month and two years to the past.

If shift is a timdelta, shifts the data by that timedelta.

If shift is a timestamp, shifts the data such that the earliest entry has that timestamp. The remaining values will mantain the same time difference to the first entry.

write(path)

Write the DataFrame and units to the writing path in the same format as it was read.

Parameters

path (str) – Path to writing csv file. Writing mode: ‘w’.

devicely.MuseReader

Module to process Muse data from the mind monitor application

class devicely.muse.MuseReader(path)

Parses, timeshifts and writes data generated by the Muse S headband using the Mind Monitor application.

data

dataframe of the read data

Type

DataFrame

timeshift(shift='random')

Shifts the index column ‘TimeStamp’.

Parameters

shift (None/'random', pd.Timestamp or pd.Timedelta) –

If shift is not specified, shifts the data by a random time interval between one month and two years to the past.

If shift is a timdelta, shifts the data by that timedelta.

If shift is a timestamp, shifts the data such that the earliest entry is at that timestamp and the remaining values keep the same time distance to the first entry.

write(path)

Writes the dataframe back into a csv file.

Parameters

path (str) – path to the write file.

devicely.TimeStampReader

TimeStamp for Android allows you to record the timestamp of an event at the time it occurs. It also allows you to create specific tags such as “Running” or “Walking” and timestamp those specific activities.

class devicely.time_stamp.TimeStampReader(path)

Read, timeshift and write data generated by the Android app TimeStamp

data

DataFrame with datetime index and ‘tag’ column.

Type

DataFrame

timeshift(shift='random')

Timeshift the data by shifting the index.

Parameters

shift (None/'random', pd.Timestamp or pd.Timedelta) –

If shift is not specified, shifts the ‘time’ column by a random time interval between one month and two years to the past.

If shift is a timdelta, shift the index by that timedelta.

If shift is a timestamp, shifts the data such that the earliest entry has that timestamp. The remaining values will mantain the same time difference to the first entry.

write(path)

Write the DataFrame stored in ‘data’ to ‘path’ in the same format as it was read.

Parameters

path (str) – Path to writing csv. Writing mode: ‘w’