meas_rain_sliding Computes rainfall during the last 60 and last 90 minutes

meas_rain_sliding.py

Computes rainfall during the last 60 minutes and 90 minutes. These rainfall measurements are made every five minutes.

For example, at 08:45, this module will report 60 min rainfall since 07:45. It will also report 90 min rainfall since 07:15.

At 08:50, this module will report 60 min rainfall since 07:50, and 90 min rainfall since 07:20.

A precip accumulation measurement named “RAIN ACCU” must be present in the system.

The 60 and 90 minute measurements compute rainfall by comparing the current rain accumulation reading to the reading logged 60 and 90 minutes ago. For that reason, “RAIN ACCU” must be logged.

Additionally, “RAIN ACCU” measurement must be scheduled at least as frequently as the 60 and 90 minute rainfall measurements.

A Sat/XLink setup is associated with this module: meas_rain_sliding_setup.txt

This module is a variation of: meas_daily_roc.py

meas_rain_sliding.differential_reading(meas_label, period_sec, allow_negative)

Computes the difference between the most recent reading of the specified measurement, and an older reading of the same measurement. Routine reads the log looking for the older reading.

Parameters:
  • meas_label (str) – the label of the measurement in question
  • period_sec (int) – how long ago the old reading was made in seconds
  • allow_negative (bool) – should a negative difference be allowed? set to False for rain accumulation
Returns:

the difference between the two readings

Return type:

float

meas_rain_sliding.rain_60_min(inval)
Computes the rainfall during the last 60 minutes.
Another measurement labeled RAIN ACCU must be recording precip accumulation.
meas_rain_sliding.rain_90_min(meas_index_or_label)
Computes the rainfall during the last 90 minutes.
Another measurement labeled RAIN ACCU must be recording precip accumulation.