GlucoseIQ

Time-Series Primitives

Gap detection, day/night split, and uniform-grid resampling.

3 functions

Generated from the source TSDoc — every signature, parameter, and example is the real thing.

alignToGrid

alignToGrid(readings: GlucoseReading[], options?: AlignOptions): GridPoint[]

Resamples readings onto a fixed time grid.

ParameterDescription
readingsGlucose readings with ISO 8601 timestamps
optionsInterval, interpolation window, and output unit

Returns — Grid points from the first to the last reading; genuine gaps are holes

const grid = alignToGrid(readings) // 5-min slots, gaps ≤15 min interpolated

detectGaps

detectGaps(readings: GlucoseReading[], options?: GapDetectionOptions): GlucoseGap[]

Finds gaps (sensor dropouts) between consecutive readings.

ParameterDescription
readingsGlucose readings with ISO 8601 timestamps
optionsGap threshold

Returns — Gaps in chronological order (empty if none)


splitDayNight

splitDayNight(readings: GlucoseReading[], options?: DayNightOptions): DayNightSplit

Splits readings into daytime and nighttime by local hour. The night window may wrap past midnight (e.g. 22:00–06:00).

ParameterDescription
readingsGlucose readings with ISO 8601 timestamps
optionsTime zone and night window

Returns — Readings partitioned into day and night

Throws — If the time zone is invalid

On this page