MazamaScience/RAWSmet

handle inconsistent WRCC data

jonathancallahan opened this issue · 0 comments

With crazy wildfires in Oregon today, I tried to look at this RAWs station:

Horse Creek 
NWS ID: 350727 
WRCC ID: orOHOR 
Agency: BLM 
Elevation: 610 m
Country Code: US 
State Code: OR 
Timezone: America/Los_Angeles

Unfortunately, wrcc_identifyMonitortype() failed to recognize the following header:

> print(lines[1:4])
[1] "Horse Creek              Oregon "                                                                              
[2] ":       LST\t mm  \t m/s \t Deg \tDeg C\tDeg C\t  %  \tvolts\t  %  \t Deg \t m/s \t W/m2"                      
[3] ": Date/Time\t Precip\t  Wind \t Wind  \t Av Air\t  Fuel \t  Rel  \tBattery\t  Fuel \t   Dir \tMx Gust\t Solar "
[4] ":YYMMDDhhmm\t       \t  Speed\t Direc \t  Temp \t  Temp \tHumidty\tVoltage\tMoistur\t MxGust\t Speed \t  Rad. "

Sadly, this is ever so slightly different from the Enumclaw, WA header:

> print(lines[1:4])
[1] "Enumclaw  Washington "                                                                                         
[2] ":       LST\t mm  \t m/s \t Deg \tDeg C\tDeg C\t  %  \tvolts\t  %  \t Deg \t m/s \t W/m2"                      
[3] ": Date/Time\t Precip\t  Wind \t Wind  \t Av Air\t  Fuel \t  Rel  \tBattery\tAv Fuel\t   Dir \tMx Gust\t Solar "
[4] ":YYMMDDhhmm\t       \t  Speed\t Direc \t  Temp \t  Temp \tHumidty\tVoltage\t Moistr\t MxGust\t Speed \t  Rad. "

Horse Creek has "Fuel Moistur" while Enumclaw has "Av Fuel Moistr". (Sigh.)

So you will have to add another WRCC_TYPE to handle files like Horse Creek.

Please poke around at several other locations in Oregon and Washington and test wrcc_load() on a variety of locations or write an R script to automate this. In my experience, individuals responsible for devising data systems often end up with ad hoc formats that change. And our job is to be the data janitors who can handle all of them.