Programming · free software · the open webSubscribe via RSS

Separating Water Observations from Derived Summaries

From the earlier reference collection. Read the current software blog.

Preserve each measured value with its observation context, then compute chart summaries separately so corrections and transformations remain traceable.

Keep the observation intact

A sensor observation should preserve the value as received, its unit, observation time, and source context. Include a station or sensor identifier when the source provides one, and record retrieval time separately. A fetch at noon may retrieve a measurement taken earlier; those timestamps answer different questions.

Do not replace the raw value with a rounded display string. If a reading arrives as 18.46 degrees, retain that numeric value and unit even if a chart labels it 18.5. The display is a presentation choice, not the measurement itself.

Compute summaries in another layer

A daily average, minimum, or maximum is derived data. Store it as a result with its method, interval, input set or version, and units. For example, an average for local calendar day might be calculated from observations assigned to that day in a stated time zone. A different time zone or missing readings could produce a different result.

Keep the summary rebuildable from source observations where feasible. If a late correction changes one reading, recompute the affected interval rather than editing a chart value by hand. When storing a summary for performance, retain enough metadata to show how it was produced and when it was last recalculated.

Make corrections traceable

Sources can revise a measurement, and importers can discover parsing mistakes. Preserve the original record or a revision history, then link the corrected observation to its prior version. Record why the value changed, such as a source correction or a unit conversion bug, without overwriting the evidence needed to reproduce the earlier result.

For instance, if an importer mistakenly interprets Fahrenheit as Celsius, correcting the stored value should also identify the original unit and the transformation rule. Otherwise an operator may see a plausible chart and have no way to explain its history. Derived summaries should then be regenerated from corrected observations.

Read charts with context

A charted line may connect sparse observations or show a rolling average rather than a direct sensor sample. Label the statistic, interval, unit, and observation basis. A gap should remain a gap when no observation exists; interpolation is a separate estimate and should be marked as such.

A water temperature resource gives readers a useful place to practice this distinction: ask whether a displayed value is a single observation or a summary, and what time it describes. The page is a reading context, not evidence about a particular sensor, sampling rate, or calculation method.

Suggest a correction · All posts