pyActigraphy.sleep.ScoringMixin.AoffT¶
- ScoringMixin.AoffT(freq='5min', whs=12, binarize=True, threshold=4)[source]¶
Activity offset time.
Activity offset time derived from the daily activity profile.
- Parameters
freq (str, optional) – Data resampling frequency string. Default is ‘5min’.
whs (int, optional) – Window half size. Default is 12.
binarize (bool, optional) – If set to True, the data are binarized. Default is True.
threshold (int, optional) – If binarize is set to True, data above this threshold are set to 1 and to 0 otherwise. Default is 4.
- Returns
aot – Activity offset time.
- Return type
Timedelta
Notes
This automatic detection of the activity offset time is based on the daily activity profile. It returns the time point where relative difference between the mean activity over \(whs\) epochs after and before this time point is maximum:
\[AoffT = \max_{t}( \frac{\sum_{i=1}^{whs} x_{t+i}}{\sum_{i=-whs}^{0} x_{t+i}} - 1 )\]with:
\(x_{i}\) is the activity count at time \(i\).
Examples
>>> import pyActigraphy >>> rawAWD = pyActigraphy.io.read_raw_awd(fpath + 'SUBJECT_01.AWD') >>> raw.AoffT() Timedelta('0 days 23:20:00') >>> raw.AoffT(binarize=False) Timedelta('0 days 23:05:00')