Humidity Fix

My weather data has been flagged as having an issue on the quality checking from CWOP.  Specifically, the humidity readings have been too high compared to neighboring stations.  I had purchased a replacement humidity sensor chip several months ago, but never had the opportunity to install it.  Yesterday that opportunity presented itself.  I shut down the station, took it apart enough to get to the old sensor and brought it inside to the workbench.  It wasn’t very difficult to unsolder the old sensor and solder the new one in its’ place.  Then I reassembled the station and started it back up.  The humidity readings appear to be more reasonable.  I’ll have to wait a few days and see how the quality checking goes.

While i was at it, I modified the code to use System.nanoTime() rather than System.currentTimeMillis() for calculating the wind speed.  The reason for the change wasn’t specifically to gain additional precision (although that is an OK bonus). My concern is that it is possible for the time to be corrected (such as via NTP or by the admin) in the midst of doing the timing for the wind speed.  This could cause an incorrect value to be calculated, and has led to readings of wind speeds in excess of 100 mph in some other weather software packages.  Mine is most likely susceptible to this bug as well.  While this is a rare occurrence and the probability of it happening is slim, the Java recommended method for doing timing is using nanoTime(), which is based on a relative time and is only useful for comparing to other nanoTime() values.  Again, I’ll follow my data for the next few days and see  how it looks.