computeNowCastPm25

fun computeNowCastPm25(readings: List<Pair<Long, Double>>, nowEpochSeconds: Long): Double?(source)

Computes the NowCast PM2.5 concentration (µg/m³) from a node's PM2.5 readings (epoch-seconds to µg/m³ pairs), relative to nowEpochSeconds. Readings are binned into hourly buckets (0 = most recent hour) and averaged within each bucket. Returns null if there isn't enough history yet: the most recent hour must have a reading, and at least MIN_VALID_HOURS of the RECENT_WINDOW_HOURS most recent hours must be populated — EPA's minimum-data rule, so stale data spread across the older end of the 12h window can't produce a value.