sleep

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package sleep provides detection of sleep patterns in activity data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectSleepPeriodsWithHalfHours

func DetectSleepPeriodsWithHalfHours(halfHourCounts map[float64]int) []float64

DetectSleepPeriodsWithHalfHours identifies sleep periods using 30-minute resolution data. A rest period is defined as: - 4+ hours of continuous buckets with 0-2 events - Ends when we hit two consecutive buckets with 3+ events - Maximum 12 hours per rest period. - Strongly prefers nighttime periods (starting search at 9pm local time).

func DetectSleepPeriodsWithOffset added in v1.1.0

func DetectSleepPeriodsWithOffset(halfHourCounts map[float64]int, timezoneOffset int) []float64

DetectSleepPeriodsWithOffset identifies sleep periods for a specific timezone offset. The offset parameter adjusts the search to look for sleep at appropriate local times.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL