At times, though not in May 2017, the ASOS total differs from the NOAA total by 0.01", and this difference is corrected the next day. You can see in the table below that the ASOS totals, computed above, exactly match the NOAA daily precipitation totals. Left_join( lga % >% select( Historical : day)) Comparison of NOAA and ASOS daily precipitation totals Summarize( 'Daily Precipitation (ASOS) ' = Summarize( hourlyprecip = max( p01i, na.rm = TRUE)) % >% Mutate( date = with_tz(as.POSIXct( valid, tz = 'UCT '),Īrrange(desc( minute). # This was inspired by Hadley Wickham's # weather.r in the R package nycflights13 #x = read_csv('data/asos_lga_.csv' x = read_csv( 'data/asos_lga_.csv ', If you are interested in the issues that arise when measuring precipitation, be sure to take a look at this presentation. I specify the time zone for LGA as "America/New_York" and then undo DST by using the dst function to see if daylight savings time is in effect, and then if so, subtracting 3600 seconds from the time. R has no function for computing the mode, so I use the tabulate function together with which.max to find the most common value for minute. Once maxminute is computed for each hour, the mode of maxminute should be the reset minute.
Since precipitation at 55 minutes will be included in the next hour's total, we would double-count that amount. Note also that we can't simply use the precipitation amount reported at maxminute, because there could be precipitation reported at 55 minutes and not at 51 minutes. There are also times when precipitation at 51 minutes is greater than that at 50 minutes. The result is that unless the data is sorted in descending order by minute, 50 rather than 51 minutes will be selected as the most common minute at which maximum precipitation is recorded, and hours without records at 50 minutes can miss significant amounts of precipitation. However, there are also times when there are no reports for 50 minutes. At those times when there are reports for both 50 and 51 minutes, 50 minutes will almost always be selected. The which.max function will pick out the row with the maximum precipitation if there is a unique maximum, otherwise it will pick out the first row reporting the maximum value. I use the which.max function to find maxminute, but there is a subtlety. I assume that modalminute is the reset minute. I then compute modalminute, which is the most frequent maxminute in the data.
#Noaa precipitation totals code
In the code below, for each hour I compute maxminute, which is the minute at which maximum precipitation for the hour is reported. The algorithm to compute daily precipitation has to take into account all of these issues. For example, the last record in the hour for LGA occurs at. There is sometimes no record for the reset minute. Prior to 2017, there was most commonly only a record for the reset minute.
#Noaa precipitation totals plus
Ignoring DST makes sense, as the days on which DST is adopted and removed would otherwise create either an hour hole or a double-counted hour.īeginning in 2017, there is typically, but not always, a record every 5 minutes, plus a record for the precipitation reset minute. Daylight savings time (DST) is not observed for this purpose. The reported daily total (available from the NOAA site above and widely reported as the official number) is the sum of the hourly values, where a day is defined as midnight to midnight, local standard time. It is obvious by inspection that the LGA reset occurs at 51 minutes, but this is not true for all ASOS. The reported precipitation number is cumulative for an hour, up to a reset minute which is typically between 51 and 57 minutes (thank you Daryl!) So the hourly total is the final value before the reset. There are a number of issues that must be considered when interpreting the ASOS data. The ASOS data was obtained from Iowa State by selecting the New York ASOS and then LGA. Computing LGA precipitation totals from ASOS data The system requires you to submit a request after which they email you a link. Official historical daily precipitation data, by weather station, is available from the National Oceanic and Atmospheric Administration ( NOAA). I think the phrase "down the rabbit hole" occurs to everyone who looks into this topic. If you are interested, there is a presentation on the topic by Daryl Herzmann from Iowa State. You should be aware that the concept of a "daily precipitation total" is fraught. (This data is the source for the weather dataframe in the nycflights13 R package.) The purpose of this document is to illustrate the computation of daily precipitation totals using Automated Surface Observation System (ASOS) data from Iowa State. Calculation of total daily precipitation using ASOS data: Example