Bin Definition |
Windographer frequently subdivides data into discrete bins. When doing so, it always defines bins as the range:
A bin covering the range from 2.5 to 3.5 m/s, for example, could be expressed as:
This same pattern applies to direction ranges, so for example the sector from 15° to 45° could be expressed as:
This definition causes zero values to fit into the bin that begins at zero.
Imagine a text file that reports wind speeds in m/s to one decimal place, and Windographer is binning the wind speeds into 1 m/s bins. If the file reports a value of '7.0' will that value fall in the 6-7 m/s bin or the 7-8 m/s bin?
The explanation above suggests that the value will fall into the 7-8 m/s bin because the value lands right on the boundary of the two bins, and the lower bin excludes 7 m/s while the upper bin includes it. But that's not a safe assumption because of the way that computers store floating point values.
When Windographer imports that imaginary data file and reads that 7.0 m/s value, the computer will represent that value possibly as 6.999999999999 m/s and possibly as 7.000000000001 m/s. (Windographer has no control over that; it simply results from how computers store such numbers.)
That ‘7.0’ value could therefore fall in the 6-7 m/s bin or the 7-8 m/s bin; we can't predict which.
This ambiguity bothers some people, but it should not. When a data logger reports a wind speed of 7.0 m/s it doesn’t mean 7.000000000000 m/s, it just means the speed was closer to 7.0 than to 6.9 or 7.1. (Still considering the case where the data logger reports only one decimal place of precision.) The true speed, however one might want to define that, could have been 7.04 or 6.96 or anywhere in that vicinity. So theoretically, it’s not wrong to place that value in 6.5-7.0 m/s bin, and it’s not wrong to place it in the 7.0-7.5 m/s bin.
See also