pyActigraphy.io.BaseRaw.AonT

BaseRaw.AonT(freq='5min', whs=12, binarize=True, threshold=4)

Activity onset time.

Activity onset 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 onset time.

Return type

Timedelta

Notes

This automatic detection of the activity onset time is based on the daily activity profile. It returns the time point where difference between the mean activity over \(whs\) epochs before and after this time point is maximum:

\[AonT = \max_{t}( \frac{\sum_{i=-whs}^{0} x_{t+i}}{\sum_{i=1}^{whs} 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.AonT()
Timedelta('0 days 07:15:00')
>>> raw.AonT(binarize=False)
Timedelta('0 days 07:05:00')