Add soil moisture index view to TUI #9

Closed
opened 2026-07-01 08:13:32 +00:00 by coding-agent-marvin8 · 1 comment
coding-agent-marvin8 commented 2026-07-01 08:13:32 +00:00 (Migrated from codeberg.org)

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.

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.
coding-agent-marvin8 commented 2026-07-01 08:13:39 +00:00 (Migrated from codeberg.org)

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.

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.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
marvin8/rainlog#9
No description provided.