Skip to main content
`Ctrl`+`K`

# ada.database_utils.summary

## Functions

`daily_profile`(acti_data[, wlen]) | Daily profile averaging activity from multiple days over a 24 hours. Can plot multiple subjects. Plotting epoched data (rather than Raw) is recommended.
`metadata_summary`(path) |
`plot`(acti_data[, acti_score, cosinor_fit, timestamp, ...]) | Plot actgigraphic data aggregating information from multiple processing stages.
`summary_long_report`(data, path) | Create a summary of parameters of the long model for all recordings as a comma-separated CSV.
`summary_sleep_report`(data, path[, minutes, length]) | Create a summary of sleep metrics for all recordings as a comma-separated CSV. Sleep onset and WASO are None if there were no sleep long enough to calculate them.

## Module Contents

daily_profile(acti_data, wlen=15)

  Daily profile averaging activity from multiple days over a 24 hours. Can plot multiple subjects. Plotting epoched data (rather than Raw) is recommended.

  Parameters:

    - acti_data (list[_Raw | _Epoched] | _Raw | _Epoched) – Data to be plotted.

    - wlen (int | None, optional) – Length of a window (in minutes) in which data will be smoothed by moving average. No smoothing if None. Defaults to 15.

  Returns:

    Object with the plot, which can be saved or displayed.

  Return type:

    matplotlib.figure.Figure

metadata_summary(path)

plot(acti_data, acti_score=None, cosinor_fit=None, timestamp=True, window_name=None)

  Plot actgigraphic data aggregating information from multiple processing stages.

  Parameters:

    - acti_data (_Raw | _Epoched) – Data to be plotted.

    - acti_score (ScoredShort | None, optional) – Sleep/wake score for the plotted data. Not plotted if None. Defaults to None.

    - cosinor_fit (CosinorResults | None, optional) – Cosinor model fitted to the data. Not plotted if None. Defaults to None.

    - timestamp (bool, optional) – If True, x axis will be labeled using relative timestamp in hours. If False, the absolute dates will be used. Defaults to True.

    - window_name (str | None, optional) – Name of the window in which interactive figure will be displayed. Default (figure number) if None. Defaults to None.

  Returns:

    Object with the plot, which can be saved or displayed.

  Return type:

    matplotlib.figure.Figure

summary_long_report(data, path)

  Create a summary of parameters of the long model for all recordings as a comma-separated CSV.

  Parameters:

    - data (list[_LongContainer]) – List with objects containing parameters of fitted long model.

    - path (str | TextIO) – Path to the output .csv file or an output buffer.

summary_sleep_report(data, path, minutes=20, length=5)

  Create a summary of sleep metrics for all recordings as a comma-separated CSV. Sleep onset and WASO are None if there were no sleep long enough to calculate them.

  Parameters:

    - data (list[ScoredShort]) – List with objects containing actigraphic sleep/wake scoring.

    - path (str | TextIO) – Path to the output .csv file or an output buffer.

    - minutes (int, optional) – Time of continous sleep (in minutes) needed for a sleep onset estimate. Defaults to 20.

    - length (int, optional) – Length in minutes of sleep episode to be counted as long. Defaults to 5.