selecting weather stations used to build Locations.xml.in
Submitted by Steve Tyler
Link to original bug (#574494)
Description
In Bug 567607 Comment 8 it was noted that the current system for selecting weather stations used to build Locations.xml.in may drop stations that have a temporary outage.
The current system selects stations that have reported at least once each on the current day and the previous two days. So stations that have an outage on one of those days, yet have otherwise been reliable, will be dropped from observations.txt.
The problem of a few outages can be solved by computing a moving average of weather report availability over a longer period of time (say 30 days) and selecting stations that have a high, but not 100%, availability.
More specifically, a table of stations with a bit vector for each of the previous 30 days can represent the availability of weather reports on each of the previous 30 days. The number of bits N that are set is the number of days a report was available from the station. The percentage (N/30)*100 gives the 30-day availability as a number between 0 and 100%. The stations in observations.txt can be selected by choosing those with a high 30-day availability, say 95%. Experience will determine what is a useful value.
Example table (this could be a text file or a database table).
The last column is the computed 30-day availability as a percentage
(<number of bits set>
/ 30 * 100).
AABS 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 97 AAXX 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 100 AGGH 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 83
An implementation would update the table each day by shifting the bit vectors one bit and inserting the current weather report availability for each station at the other end of its vector. The table would be initialized with a current list of stations and one-vectors. New stations would be initialized with a zero-vector.
Other information: Since weather stations can never be 100% reliable, it is important to let the user know when a weather report is stale: Bug 574296 – weather apps do not clearly identify stale observations
Version: 2.24.x