Add soil moisture index view to TUI #9
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The TUI currently shows only rainfall amounts (mm). A soil moisture approximation is more useful for farm management decisions on a daily basis. A leaky-bucket exponential-decay model applied to daily rainfall totals provides a practical proxy: moisture decays by a fixed factor each day and is replenished by recorded rain. This view should be togglable within the existing TUI bar chart using the m key.
Algorithm: moisture[day] = moisture[prev] × 0.85 + rain[day], applied over all DB records in ascending date order. Decay 0.85 gives approx 4-5 day half-life. Key files: db_helpers.py (new get_moisture_index method), tui.py (ChartMode enum, m binding, updated StatsPanel with mode/group header, new _compute_tentative_moisture_entries for decaying synthetic bars). All groupings work without restriction because every calendar day has a recorded reading (0.0 for dry days). Branch: feat/soil-moisture-tui.