$dayswithrain and Climate/NOAA reports rainfall issue

I searched and I know there are lots of old topics about $dayswithrain, but I noticed an interesting behavior in this variable in the testtags.php file.

Any day that I received rainfall, it would show:
$dayswithrain = ‘1’, but it would never increment.

Today, I converted my January log file to data files, and lo and behold, it updated with the correct data:

$dayswithrain =  '7';	// Days with rain for the month

However, after about 10 mins, it changed back to:

$dayswithrain =  '1';	// Days with rain for the month

I was able to get it to return to 7 temporarily by converting this month’s log file to data file again, but after about 10 mins, it went back to 1.

The $dayswithrainyear variable has remained unaffected and increments properly:

$dayswithrainyear =  '6';	// Days with rain for the year

Has anyone else experienced this particular behavior?

If it is helpful, here is my current testtags.php file: https://www.marylandwx.com/wxdisplay/testtags.php?sce=view

I’m adding to my original post as I’ve noticed an inconsistency in other areas as well and it appears to be related.

Every so often, but at least once a week, I lose the rainfall history in my climatedataout.html, dailyreport.htm, dailynoaareport.htm, and various other NOAA style reports that get uploaded every day after midnight. The oddity is that it shows the rain amounts for some of the days, but most are just zero.

If I convert logfile to data file, it restores the data, and then I can re-run the reports and all is well…until it randomly happens again. The next time it happens, I’ll grab a screenshot of a report to better illustrate the before and after.

I had this issue with today’s reports.

Attached are screenshots of the dailyreport.htm file before I converted this month’s log file (with missing/incorrect rain), and then after (with correct rain). The same thing happens with dailynoaareport.htm, and climatedataout.html.

Interestingly, the monthly and yearly rain totals are correct in the reports, even with the incorrect daily rain values.


What station you running? IIRC the rain data from my VP2 is queried from the console rather than WD recording tips. Not sure why Brian coded it this way. I don’t know how other stations data is gathered by WD. The fact it was correct after you did the convert but then changed is a clue that most likely means WD failed to update where it stores the data. I think WD first stores the data to the inf file then writes it out to the log file, and eventually some data points are stored in the ini file. Try checking them before and then after you do the convert looking for changes. Sorry, best idea I can come up with…

Dan

Hi Dan,

Thanks for the input and thoughts. I am also running a VP2, but I have unchecked the option to use the console rainfall totals, so WD is doing the recording. Good thoughts about the troubleshooting ideas. I would assume that since the logfiles have the correct data, there is something wonky with either the inf file or the ini file. What is odd is that there is data there, it is just incorrect (on 1/5 it has .01 and on 1/16 it has .08). After converting the logfile, the proper values for those days populates (along with all of the other days with missing rainfall).

I am familiar with the ini file and can check that next time, but I’m not sure I know where to find the inf file.

Do you create these daily NOAA/climate files? If so, what time do you have them run? I tried messing around with the timing, in hopes that it may deconflict whatever could be causing the issue, but I haven’t had any success yet.

My reports were ok today, so I couldn’t peek at the ini file to see if there was anything out of sorts there, but I did check it with the $dayswithrain issue since that was incorrect.

I closed WD and looked at the ini file and saw [Days with rain] number=1. I then restarted WD, converted this month’s log file to data file and saw the testtags.php $dayswithrain update to the correct value (12).

I then closed out WD again, checked the ini file, and the [Days with rain] parameter there still showed 1.

After restarting WD, $dayswithrain is still correct in testtags.php. So didn’t change back to 1 when WD reinitialized.

https://saratoga-weather.org/wdparser.php

Field 483 shows days with rain MTD

I am not very familiar with testtags file. clientraw.txt “should” contain relevant data.

The ini file is where WD stores some variables needed at startup.

The inf files are not easily readable, but I believe it is where WD stores the data initially, like machine code that is faster for WD to read/write then the logfiles. You can convert logfiles to inf files but I do NOT recommend doing that.

For whatever reason WD is changing the value based on what it is reading in. I have to assume that WD re-reads the logfile values while running. You do a convert and the variable is correct, but then at the top of the minute WD is re-reading the file and changing the value back based on what it read in the file. That leads me to think the logfile is corrupt. I believe whatever is wrong is most likely caused by the log file. It’s been my experience that the logfiles are easily corrupted, especially when shutting down WD or if power is lost to the computer.

I also run the VP2 and do not have ticked to use console rain cloud settings.

My climate files are done after midnight as far as I know…never messed with the schedule.

Did you run your logfile through the checker? http://www.stella-maris.org.uk/checklogs.php

Hi Dan,

I have run the logfile through the parser and results are below. I’m not sure if any of these errors would be contributing (or if I need to fix them). We did have power outages at the times flagged for the “Timestamp does not increase” errors, and looking at the logfile, it appears that data is simply out of order there. I would assume that when the power came back, data was backfilled and resulted in the out of order times.

By the way, I noticed when I manually update the climateout.html file, it shows that it is parsing the month12022.inf file, so I am suspecting that file may be my issue.

Error Description Record Contents
Year value incorrect expected 2022 1 1 2021 0 0 50.5 98 50.0 29.869 0.0 0.0 89 0.000 0.000 0.890 46.550 50.5
Timestamp does not increase (from 03 01 2022 13 27) in record 3 1 2022 13 25 27.6 97 26.9 30.026 0.0 0.0 45 0.000 0.090 0.820 0.820 27.6
Timestamp does not increase (from 03 01 2022 17 59) in record 3 1 2022 17 55 24.5 91 22.2 30.197 0.0 0.0 45 0.000 0.090 0.820 0.820 24.6
Timestamp does not increase (from 03 01 2022 21 45) in record 3 1 2022 21 45 19.9 92 18.0 30.299 0.0 0.0 45 0.000 0.090 0.820 0.820 19.9
Record at 23:59 missing after 20 1 2022 23 58 25.6 56 12.1 30.420 1.5 2.0 44 0.000 0.330 3.350 3.350 25.6


Yes, fix those errors. Yes, anytime WD imports data from the datalogger you can end up with duplicate times. I have to repair mine all the time. I shutdown WD, load the log file into a text editor, then remove/delete the lines BEFORE the import data. Continue until the logfile checker reports no errors. These errors in time could easily cause the problem you have and I suspect once you fix the logfile you will have no more issues.

Thanks. I made the corrections, and the parser is now reporting no errors. Fingers crossed!

I’ve given this some time and additional rainfall and snowfall and have not had any more issues with the climate reports since correcting the logfile.

Thanks so much, Dan!

Unfortunately, the $dayswithrain tag still seems to not be correct (but I am less concerned with this issue).

I am going to see if the change to February (and new logfile) has any affect on it.

I read a post from Budgie that said “once you correct your logfile with notepad++ or other text editor, then convert the log file to an .inf” of course backup the files before http://discourse.weather-watch.com/p/430451

Thanks for this tip. I did convert the logfile to data file, but I had not done the “Re-create the last 31 days graph data” that Budgie mentioned there. I just did that, and now I will wait for some rain in this month to see if it works properly :slight_smile: