Measuring rain
A rain gauge collects rain falling into a funnel of known size and measures how much has fallen, usually in millimetres or inches. The standard US National Weather Service gauge is a metal cylinder with an 8-inch funnel, which channels water into a narrow tube so small amounts can be read accurately.
Automatic gauges
Many modern stations use automatic gauges, such as tipping-bucket gauges, which tip each time a small amount of water collects and record each tip electronically. Readings are stored with timestamps, often every few minutes, building detailed records of rainfall.
Two kinds of empty
In a data file, an empty cell for a particular hour could mean two different things. It might mean that no rain fell, a real observation of zero. Or it might mean that no measurement was made, because the gauge was blocked, broken, being serviced or had lost power.
Why it matters
If a missing reading is treated as zero, the record will show dry weather when it may actually have been raining. A model learning from this data could underestimate rainfall, misjudge drought conditions or fail to predict floods correctly.
A separate flag
The solution is to keep a separate flag that marks whether each value was actually measured. A measured zero is recorded as 0 with a flag showing a valid observation. A missing value is recorded as missing, not zero. Many data formats include a special code for missing values for this reason.
Daily totals
When calculating a daily rainfall total, missing hours cause problems. Adding up the available values and ignoring the gaps would give a total that is too low if rain fell during the gap. The daily total should be flagged as incomplete, or estimated using a documented method, such as comparing with nearby stations.
A deliberate test
A good way to test a system is to take a period of known rainfall and remove some readings during a rainy interval, creating a gap. If the system reports that interval as dry, it is confusing missing with zero. If it flags the gap or estimates sensibly, it is handling missing data correctly.
Trace amounts
Weather services sometimes report a trace of rain, meaning a very small amount too small to measure. A trace is different from zero and from missing. Clear labels for each case help users and models interpret the data correctly.
Other sources of error
Rain gauges can underestimate rainfall in strong winds, which blow raindrops past the funnel, and may struggle with snow. Debris such as leaves can block funnels. Quality control checks look for unusual patterns that might indicate faults.
Responsible data use
The NIST AI Risk Management Framework encourages developers to understand the quality of their data, including gaps and errors. Handling missing values correctly is a basic part of this.
Station networks
National weather services operate networks of rain gauges, supported by volunteer observers in many countries. Combining data from many stations helps fill gaps and check unusual readings. Radar and satellites also estimate rainfall, providing another check where gauges are sparse.
Documenting gaps
Good records note when and why data were missing, such as maintenance or faults.
Snow and frozen gauges
In winter, snow or ice can block a gauge, so readings stop even while precipitation continues.
Clear codes
Using a distinct code for missing values avoids confusing blanks with real zero readings.
Try the arithmetic
If a station records 2 mm per hour for 20 hours and misses 4 hours of heavy rain at 5 mm per hour, treating the gap as zero gives a daily total of 40 mm instead of 60 mm, a third too low.
The idea to take away
A dry interval and an instrument outage can both appear as an empty cell. Keep a separate missing-data flag, so a model does not turn an absence of information into an observation that no rain fell.
Sources & further reading
Figures in the example are illustrative. Photograph: 2013-10-14 12 27 49 National Weather Service Standard Rain Gauge.JPG by Famartin, CC BY-SA 3.0, via Wikimedia Commons; cropped and resized. Reference organisations do not endorse this website.

