childmindresearch / wristpy

https://childmindresearch.github.io/wristpy/
GNU Lesser General Public License v2.1
4 stars 5 forks source link

[BLOCKED] Task: Investigate "idle_sleep_mode_on" behaviour and implement a handling function #102

Open Asanto32 opened 1 month ago

Asanto32 commented 1 month ago

Description

Data with the actigraph watches can be collected with "idle_sleep_mode" = true. This is the case with some of the HBN data. This creates large time gaps in the data (no samples), an initial investigation has shown that our non-wear and sleep detection algorithms fail under these circumstances (or at best, are unreliable). GGIR handles these cases by imputing the data in the time gaps, and then running the processing steps.

Tasks

Freeform Notes

No response

ReinderVosDeWael commented 3 days ago

@gkiar @vitoetc

Before coming up with technical solutions, is this missing data issue one we want to handle with (flawed) imputations (similar to GGIR) or with data discarding (e.g. set times where this happened to nonwear, discard nights where this happens, etc...)

Asanto32 commented 2 days ago

Feedback from DAIR meeting:

Impute during the time gaps with one of the following three possibilities, for acceleration, expressed as [X,Y,Z]:

  1. (np.finfo(float).eps, np.finfo(float).eps, -1)
  2. (min || accelX ||, min || accelY ||, -1)
  3. (0.5x0.04, 0.5x0.04, -1) where 0.04 taken from Actigraph description "Devices with Idle Sleep Mode enabled will enter a sleep or low power state after experiencing 10 seconds of inactivity (fluctuation on the accelerometer < +/- 40 milliGs"

Sampling rate based on time gap between samples and effective sampling rate from metadata. Linearly spaced number of samples = (time_gap * meta_data.sampling_rate)