Page 1 of 1

Rain conversion from inches to mm

Posted: Fri 23 Jul 2021 1:34 pm
by david3
I have a US version davis vantage vue that measures rain in inches, and I have cumulusmx set to metric/mm.

I just checked the daily rain up until now, and it's at 7.25 inches, but cumulusmx reads 145mm (should be 184mm).

I recall there is some conversion error that is introduced, but is it that much? Is there any work-around to get it closer? Thanks.

Re: Rain conversion from inches to mm

Posted: Fri 23 Jul 2021 3:22 pm
by Mapantz
Why not change the setting in CumulusMX to inches?

Station settings -> General settings -> Units

Re: Rain conversion from inches to mm

Posted: Fri 23 Jul 2021 7:55 pm
by sfws
Unlike previous answer, I assume you do want metric output from Cumulus despite having an imperial gauge.

Is Station settings -> Davis VP/VP2/Vue -> Davis Advanced Options -> Rain gauge Type set to Imperial (0.01 in) ?

Is Station settings -> General settings -> Units -> Advanced options -> Rainfall decimals set to 2?

Your conversion from imperial to metric calculations will need both of those advanced options set correctly.

Re: Rain conversion from inches to mm

Posted: Fri 23 Jul 2021 10:00 pm
by RayProudfoot
I can’t speak for Cumulus MX but with Cumulus Steve posted a warning that changing the setting from imperial to metric or vice-versa would mess up every entry in dayfile.txt and the monthly and all-time records.

Be careful!

Re: Rain conversion from inches to mm

Posted: Fri 23 Jul 2021 10:40 pm
by mcrossley
The previous two post are both correct.

If you configure Cumulus to use mm for rain it assumes you have a metric (0.2mm) rain gauge. If you have an imperial gauge then you have to override that behaviour as @sfw posted.

But as Ray posted, if you change the gauge type then that will mess up some entries you already have in the day file which record the number of bucket tips as well as rainfall in your chosen units.

Re: Rain conversion from inches to mm

Posted: Sat 24 Jul 2021 2:33 pm
by david3
sfws wrote: Fri 23 Jul 2021 7:55 pm Unlike previous answer, I assume you do want metric output from Cumulus despite having an imperial gauge.

Is Station settings -> Davis VP/VP2/Vue -> Davis Advanced Options -> Rain gauge Type set to Imperial (0.01 in) ?

Is Station settings -> General settings -> Units -> Advanced options -> Rainfall decimals set to 2?

Your conversion from imperial to metric calculations will need both of those advanced options set correctly.
I'm looking in the Cumulus MX admin web page/dashboard, but I don't see those entries under Station settings. The closest thing I see is Station settings -> Units -> Rain = mm.
mcrossley wrote: Fri 23 Jul 2021 10:40 pm The previous two post are both correct.

If you configure Cumulus to use mm for rain it assumes you have a metric (0.2mm) rain gauge. If you have an imperial gauge then you have to override that behaviour as @sfw posted.

But as Ray posted, if you change the gauge type then that will mess up some entries you already have in the day file which record the number of bucket tips as well as rainfall in your chosen units.
I thought for sure I'd gone through this before and it checked out, reasonably close (not perfect). But that was with the old windows version. I can't find the settings for Rain gauge type and rainfall decimals in cumulusmx.

(that's when I was checking it out before, with the old windows version)
viewtopic.php?f=6&t=9555&p=78809

Re: Rain conversion from inches to mm

Posted: Sat 24 Jul 2021 2:55 pm
by mcrossley
VP Advanced settings...
davis-advanced.jpg
Units Advanced settings...
units-advanced.jpg
Unless you are running quite an old version of MX for course?

Re: Rain conversion from inches to mm

Posted: Sat 24 Jul 2021 3:11 pm
by david3
I'm running cumulusmx b3043. I had tried to upgrade before but ran into too many problems getting the ftp transfer to work, so went back to that since the ftp transfer worked well with that version.
cumulusmx_2021_07_24.png

Re: Rain conversion from inches to mm

Posted: Sat 24 Jul 2021 5:14 pm
by david3
OK, I updated to the latest version, 3133. The ftp transfer is working, and I made the changes.

Before:
cumulusmx_update_2021_07_25_before_1.png
cumulusmx_update_2021_07_25_before_2.png
After:
cumulusmx_update_2021_07_25_after_1.png
cumulusmx_update_2021_07_25_after_2.png
It looks like that "Rain Gauge Type" was just not there in the older cumulusmx version, though I'm pretty certain there was something like that in the old windows version. I'd guess the last 3 years I've been running mx the rain data has been off. You'd think I would have noticed earlier.

I'll see if the change helps or makes it worse, and then try to figure out how to correct the old data.

Re: Rain conversion from inches to mm

Posted: Sat 24 Jul 2021 5:36 pm
by mcrossley
The rain gauge setting was there in old versions of MX, but you had to set it via the Cumulus.ini file (the same with C1 I think). Newer version expose it via the settings, I've been trying to expose all the settings so people no longer need to edit the .ini file manually.

Re: Rain conversion from inches to mm

Posted: Sun 25 Jul 2021 2:33 am
by david3
Thanks. The new version seems to be working properly, and doing the conversion correctly with the 2 setting changes.

Now I'll try to figure out how to correct the old data. I think I can write a script to do it, but I need to read up on the purposes for the different data files.

Re: Rain conversion from inches to mm

Posted: Mon 26 Jul 2021 8:52 am
by david3
I corrected the rain data from the old version of CumulusMX, in the dayfile.txt and the month files (MonYYlog.txt).

Do you know if the month*.ini and year*.ini files will get regenerated by the software, maybe at midnight? Or is there a process I can run to regenerate them? Or do I need to correct those manually?

For future reference, the fields affected in the dayfile.txt were:
field 13 = Maximum rainfall rate
field 15 = Total rainfall for the day
field 32 = High hourly rain

And for the month files:
field 9 = current rainfall rate
field 10 = today rainfall so far
field 27 = total rainfall since midnight

I used awk to correct the field data. As an example, $9 (referenced twice) is the field number. The second reference does the correction ($9*1.27).

Code: Select all

awk 'BEGIN {FS=",";OFS=","} {$9=sprintf("%.2f",$9*1.27);print}' copy-of-logfile.txt > copy-of-logfile-2.txt

Re: Rain conversion from inches to mm

Posted: Mon 26 Jul 2021 9:41 am
by sfws
david3 wrote: Mon 26 Jul 2021 8:52 am Do you know if the month*.ini and year*.ini files will get regenerated by the software, maybe at midnight?
NO!
david3 wrote: Mon 26 Jul 2021 8:52 am Or is there a process I can run to regenerate them
NO! (Although Mark has mentioned plans for a "CreateRecords" utility)
david3 wrote: Mon 26 Jul 2021 8:52 am I need to correct those manually?
For future reference, the fields affected in the dayfile.txt were:
field 13 = Maximum rainfall rate
field 15 = Total rainfall for the day
field 32 = High hourly rain
No need to use that multiplier to edit the few rainfall values within extreme record files.

It will not take you long to work through the rainfall values using Edit menu -> This Year's records to see if the rainfall values (the times/dates are not affected) shown on left (in year.ini) need editing because values on right (your corrected dayfile.txt) are now different,

There are other extreme files, look for those extremes in edit menu, or read https://cumuluswiki.org/a/Correcting_Extremes for the full instructions.

Re: Rain conversion from inches to mm

Posted: Mon 26 Jul 2021 10:10 am
by david3
sfws wrote: Mon 26 Jul 2021 9:41 am It will not take you long to work through the rainfall values using Edit menu -> This Year's records to see if the rainfall values (the times/dates are not affected) shown on left (in year.ini) need editing because values on right (your corrected dayfile.txt) are now different,

There are other extreme files, look for those extremes in edit menu, or read https://cumuluswiki.org/a/Correcting_Extremes for the full instructions.
Thanks.

Re: Rain conversion from inches to mm

Posted: Wed 28 Jul 2021 4:04 pm
by david3
I looked at the data some more, and I think the problem started in April 2020, not in June 2018 (when I converted from windows to CumulusMX).

In April 2020 my Cumulus.ini file got corrupted; I think due to rebooting without stopping the process cleanly, but I'm not sure. In any case, I had to redo the setup. I suspect the original Cumulus.ini file brought over from windows had the appropriate rain gauge setting. And when I had to redo the setup, it was no longer there and not possible to set it from the CumulusMX admin web interface.

Looking at field 10 & 12 from the monthly log files:

field 10 = today rainfall so far
field 12 = total rainfall counter

Prior to the Cumulus.ini re-setup, I saw the values increase in odd increments often, suggesting it was doing the imperial to metric conversion (like going from *.2 to *.5). Afterwards, it was even increments, multiples of 0.2.