R/airsis_createRawDataframe.R
airsis_createRawDataframe.Rd
Obtains monitor data from an AIRSIS webservice and converts
it into a quality controlled, metadata enhanced "raw" tibble
ready for use with all raw_~
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
airsis_createRawDataframe( startdate = strftime(lubridate::now(tzone = "UTC"), "%Y010100", tz = "UTC"), enddate = strftime(lubridate::now(tzone = "UTC"), "%Y%m%d23", tz = "UTC"), provider = NULL, unitID = NULL, clusterDiameter = 1000, baseUrl = "http://xxxx.airsis.com/vision/common/CSVExport.aspx?", saveFile = NULL, flagAndKeep = FALSE )
startdate | Desired start date (integer or character representing YYYYMMDD[HH]). |
---|---|
enddate | Desired end date (integer or character representing YYYYMMDD[HH]). |
provider | Identifier used to modify baseURL |
unitID | Character or numeric AIRSIS unit identifier. |
clusterDiameter | Diameter in meters used to determine the number of clusters (see |
baseUrl | Base URL for data queries. |
saveFile | Optional filename where raw CSV will be written. |
flagAndKeep | Flag, rather then remove, bad data during the QC process. |
Raw tibble of AIRSIS data.
The downloaded CSV may be saved to a local file by providing an argument
to the saveFile
parameter.
if (FALSE) { # Fail gracefully if any resources are not available try({ library(PWFSLSmoke) raw <- airsis_createRawDataframe(startdate = 20160901, provider = 'USFS', unitID = '1033') raw <- raw_enhance(raw) rawPlot_timeseries(raw, tlim = c(20160908,20160917)) }, silent = FALSE) }