[wfrog] r959 committed - Add rain_gauge_diameter to wmr928NX station

2 views
Skip to first unread message

wf...@googlecode.com

unread,
Oct 23, 2013, 4:10:41 PM10/23/13
to wfrog-a...@googlegroups.com
Revision: 959
Author: jordi.p...@gmail.com
Date: Wed Oct 23 20:10:24 2013 UTC
Log: Add rain_gauge_diameter to wmr928NX station
http://code.google.com/p/wfrog/source/detail?r=959

Modified:
/trunk/wfdriver/station/wmr928nx.py

=======================================
--- /trunk/wfdriver/station/wmr928nx.py Sun Mar 3 17:17:51 2013 UTC
+++ /trunk/wfdriver/station/wmr928nx.py Wed Oct 23 20:10:24 2013 UTC
@@ -45,10 +45,15 @@

pressure_cal [numeric] (optional):
Pressure calibration offset in mb. Defaults to 0.
+
+ rain_gauge_diameter [numeric] (optional):
+ Rain gauge diamater in mm. When specified the driver will do the
necessary
+ conversions to adjust rain to the new gauge size. Defaults to 0 (=
no calculation)
'''

port = 1
pressure_cal = 0
+ rain_gauge_diameter = 0

logger = logging.getLogger('station.wmr928nx')

@@ -253,6 +258,12 @@
monthT = self._decode_bcd(record[11])
yearT = 2000 + self._decode_bcd(record[12])

+ # Convert rain if the rain gauge is modified
+ if self.rain_gauge_diameter != 0:
+ x = 100.0 ** 2 / self.rain_gauge_diameter ** 2
+ total = x * total
+ rate = x * rate
+
self._report_rain(total, rate)

self.logger.info("Rain batteryOK Ok: %s, Rate %g, Yesterday %g,
Total %g since %d/%d/%d %d:%d",
Reply all
Reply to author
Forward
0 new messages