Beteljuice
Experiment:
The number_format problem has returned for apparent temps and DP. I solved it by adding a (float) to DoTemp at approx line 393
Code: Select all
} else { // no change
return number_format((float)$value, $temp_dec, '.' , '');
}
The problem I had with missing wind speed values has been solved, see Oct 2013 at
http://poundstockpacket.org.uk/weather/basic700.php
The values recorded as zero when the anemometer was being repaired are shown as blank and ignored in calculating averages.
However the wind direction for the period is shown as E. I think this is the default value set by Cumulus when the anemometer was down. I can't see what can be done about this because E is a frequent valid value.
You included sun hours in the sanitize routine but zero is a frequent valid value for sun hours and so I have removed it from the $zero_as_null array.
Thanks for the excellent work on the experiment to deal with zeroes/nulls but I don't think it provides a fool-proof solution. For example, the wind direction problem and also I notice that there was one day in 2012 when my wind speed was genuinely (I think) zero but your routine has set it to blank. I suppose that the only way will be to either alter the DayFile values to null Using Cumulus or use a database.
Once again thanks for an excellent program, I will incorporate it into my website when I get home.
EDIT See later posts for more on wind direction values