liz,
what follows is my distillation (dissertation? :) of the situation. please give it some critical review.
executive summary:a sliding window algorithm provides the best approximation to real rain rates, probably with a window size of 15 minutes. this will sometimes result in low estimates for rain rate (e.g., during short, torrential rainfall), but more often result in more accurate estimates (e.g., especially for long, low-intensity rainfall). it provides smooth changes to rainrate, whereas other methods result in spikes that are a function of the characteristics of the recording instrument.
what is the problem?we need an algorithm that works across a range of instruments, weewx configurations, and rainfall conditions.
any rain rate estimate is going to be based on a formula that normalizes the rate to a quantity per hour:
rainRate = 3600 * rain / period
rain - rainfall amount in mm, inches, hogs heads, or whatever
period - time period in seconds
the most immediate illustration of the problem is the algorithm in weewx v3 when applied to loop packets. using the loop interval for the period tends to over-estimate the rain rate, especially for instruments with bad resolution (e.g., a bucket that can only measure down to 0.3 mm).
since the same algorithm is used for archive records, it would also be an issue if the archive interval were small. a 5 minute interval usually results in reasonable estimates of rain rate, but a 1 minute interval would probably over-estimate (it depends on the instrument and the actual rain intensity).
what are the options?1) sliding window
t0 = now - period
rainRate = 3600 * rain_total_since_t0/(now - t0)
issues:
- under-estimates maximum rain rate if period is large
- under-estimates rain rate of short, intense rainfall
- requires a db query, or caching of recent rain events
2) reporting interval
rainRate = 3600 * rain_reported_in_loop_packet / loop_period
rainRate = 3600 * rain_reported_in_archive_record / archive_period
issues:
- over-estimates in loop packets on instruments with low resolution
- results in spikes, even during prolonged, steady rainfall
- spikiness depends on instrument
3) time-since-last-report
rainRate = 3600 * rain_reported_in_loop_packet / (now - last_rain_ts)
rainRate = 3600 * rain_reported_in_archive_record / (now - last_rain_ts)
issues:
- under-estimates or completely misses during intermittent rainfall
- first event reports zero rain rate
- requires definition of what 'first event' is
- results in spikes, even for steady rain
- spikiness depends on instrument
4) time-since-last-report with decay
rainRate = 3600 * rain_last / (now - t_last)
issues:
- first event reports zero rain rate
- results in spikes with decay, even for steady rain
- spikiness depends on instrument
- lags the rain event by a full period
5) davis algorithm
rainRate = f(rain_last, t_last, transmitter_period)
references:davis approachthe davis approach is a variation of a time-since-last-report (type 3), with decay that is a function of the iss calculation period and transmitter period.
the davis approach does not work generically. it might be possible to emulate it, but probably not for every type of hardware. vantage stations do the rainrate calculation at the instrument cluster (in the iss), not the console. the calculation depends on a 10-12 second interval (tracked in the iss) as well as the send-data-to-console interval (is that the same as LOOP?). it uses time between bucket tips, and it uses the send-to-console interval to determine when to reset. the problem with emulating the algorithm on other stations (and perhaps davis) is getting the actual timestamp of a tip vs the timestamp of a LOOP packet or archive packet.
http://www.davisnet.com/product_documents/weather/app_notes/AN_28-derived-weather-variables.pdf
cumulus approachthe cumulus approach is a sliding window approach (type 1), with interval of 5 minutes. when reading archive data, it uses a reporting interval approach (type 2). (note that type 2 and type 1 are identical when the period is an archive interval)
"For stations which supply a rain rate, Cumulus uses that. For stations which don't supply a rain rate (e.g. Fine Offset and La Crosse), Cumulus simply takes the rain total from the last five minutes and calculates a rate based on that; e.g. a single tip of 0.3mm in 5 minutes is a rate of 3.6mm/hr. When data from the station's logger is used, a similar calculation is performed, but the interval used is the logger interval rather than five minutes."
http://wiki.sandaysoft.com/a/Rain_measurement
http://wiki.sandaysoft.com/a/FAQ#How_is_my_rain_rate_calculated.3F
weather display approachweather display uses a time-since-last-event approach, with some kind of decay
according to brian (author of weather display):
"WD uses the time between bucket tips and the rate then starts dropping when the next time is longer than the time before (that data is updated every second)
so WD is providing an instantenous rain rate
the mm/hour is just that mm/min exptrapolated out to 1 hour (i.e *60)
that is different to the rain in the last immediate 1 hour period
a rain rate in WD of 2mm/minute is heavy rain
note that the Met service classivy sustain rain totals of 10mm every hour as heavy rain and enough to warrent warnings (120mm in 12 hours or so at that rate)
but you get times when the rain rate is much higher, i.e if 2mm/min was sustained then that would be 120mm in 1 hour
I have seen the instantenous rate rate (i.e time between tips) each 6mm/minute
the WD rain rate generally works very well for the Davis stations because that station udpates the bucket tip info frequently
other station types the rain gauge info is passed along at much less frequent intervals, which makes the time between tips not as usefull and in accurate"
reaction to weather underground algorithmapparently wu changed to a rolling window of 1 hour to calculate rain rate. user r75173 proposed an instantaneous calculation using the reporting period. the reporting period is typically 5 min or 15 min.
http://help.wunderground.com/forums/176918-personal-weather-stations/suggestions/3472806-please-stop-hour-averaging-the-rainfall-rate