This function is a front-end to the REST query functionality of the Henry Mount Soil Temperature and Water Database.
fetchHenry( what = "all", usersiteid = NULL, project = NULL, sso = NULL, gran = "day", start.date = NULL, stop.date = NULL, pad.missing.days = TRUE, soiltemp.summaries = TRUE )
type of data to return: 'sensors': sensor metadata only | 'soiltemp': sensor metadata + soil temperature data | 'soilVWC': sensor metadata + soil moisture data | 'airtemp': sensor metadata + air temperature data | 'waterlevel': sensor metadata + water level data |'all': sensor metadata + all sensor data
(optional) filter results using a NASIS user site ID
(optional) filter results using a project ID
(optional) filter results using a soil survey office code
data granularity: "day", "week", "month", "year"; returned data are averages
(optional) starting date filter
(optional) ending date filter
should missing data ("day" granularity) be filled with NA? see details
should soil temperature ("day" granularity only) be summarized? see details
a list containing:
object containing site-level information
data.frame object containing soil temperature timeseries data
data.frame object containing soil moisture
data.frame object containing air
temperature timeseries data
containing water level timeseries data
Filling missing days with NA is useful for computing and index of how complete the data are, and for estimating (mostly) unbiased MAST and seasonal mean soil temperatures. Summaries are computed by first averaging over Julian day, then averaging over all days of the year (MAST) or just those days that occur within "summer" or "winter". This approach makes it possible to estimate summaries in the presence of missing data. The quality of summaries should be weighted by the number of "functional years" (number of years with non-missing data after combining data by Julian day) and "complete years" (number of years of data with >= 365 days of non-missing data).
This function and the back-end database are very much a work in progress.