wristpy.processing.idle_sleep_mode_imputation

Handle idle sleep mode special case.

Functions

impute_idle_sleep_mode_gaps(acceleration)

This function imputes the gaps in the idle sleep mode data.

wristpy.processing.idle_sleep_mode_imputation.impute_idle_sleep_mode_gaps(acceleration: Measurement) Measurement[source]

This function imputes the gaps in the idle sleep mode data.

Gaps in the acceleration data are filled by assuming the watch is idle in a face up position. The acceleration data is filled in at a linear sampling rate, estimated based on the first 100 samples timestamps, with (0, 0, -1).

In cases when the sampling rate leads to unevenly spaced samples within one second, e.g. 30Hz sampling rate has samples spaced at 33333333ns and 33333343ns within one second, the entire data set will be resampled at the highest effective sampling rate that allows for linearly spaced samples within one second, to nanosecond precision.

Parameters:

acceleration – The raw acceleration data.

Returns:

A Measurement object with the modified acceleration data.