Obtains monitor data from an WRCC webservice and converts
it into a quality controlled, metadata enhanced ws_monitor object
ready for use with all monitor_~
functions.
Steps involved include:
download CSV text
parse CSV text
apply quality control
apply clustering to determine unique deployments
enhance metadata to include: elevation, timezone, state, country, site name
reshape data into deployment-by-property meta
and and time-by-deployment data
dataframes
QC parameters that can be passed in the …
include the following
valid data ranges as taken from wrcc_EBAMQualityControl()
:
valid_Longitude=c(-180,180)
valid_Latitude=c(-90,90)
remove_Lon_zero = TRUE
remove_Lat_zero = TRUE
valid_Flow = c(16.7*0.95,16.7*1.05)
valid_AT = c(-Inf,45)
valid_RHi = c(-Inf,45)
valid_Conc = c(-Inf,5000)
Note that appropriate values for QC thresholds will depend on the type of monitor.
wrcc_createMonitorObject(startdate = strftime(lubridate::now(), "%Y010100",
tz = "UTC"), enddate = strftime(lubridate::now(), "%Y%m%d23", tz =
"UTC"), unitID = NULL, clusterDiameter = 1000, zeroMinimum = TRUE,
baseUrl = "https://wrcc.dri.edu/cgi-bin/wea_list2.pl", saveFile = NULL,
...)
desired start date (integer or character representing YYYYMMDD[HH])
desired end date (integer or character representing YYYYMMDD[HH])
station identifier (will be upcased)
diameter in meters used to determine the number of clusters (see addClustering
)
logical specifying whether to convert negative values to zero
base URL for data queries
optional filename where raw CSV will be written
additional parameters are passed to type-specific QC functions
A ws_monitor object with WRCC data.
# NOT RUN {
initializeMazamaSpatialUtils()
sm13 <- wrcc_createMonitorObject(20150301, 20150831, unitID='sm13')
monitorLeaflet(sm13)
# }
Run the code above in your browser using DataLab