marsFetchMonitoringData: Fetch monitoring data for an SMP

View source: R/mars_data_fetch_write_functions.R

marsFetchMonitoringDataR Documentation

Fetch monitoring data for an SMP

Description

Returns a list with data frames with rain data and rain event data from the rain gage closest to the request SMP, and level data

Usage

marsFetchMonitoringData(
  con,
  target_id,
  ow_suffix,
  source = c("gage", "radar"),
  start_date,
  end_date,
  sump_correct = TRUE,
  rain_events = TRUE,
  rainfall = TRUE,
  level = TRUE,
  daylight_savings = FALSE,
  debug = FALSE,
  browser = FALSE
)

Arguments

con

An ODBC connection to the MARS Analysis database returned by odbc::dbConnect

target_id

vector of chr, SMP ID, where the user has requested data

ow_suffix

vector of chr, OW suffixes corresponding to SMP IDs, where the user has requested data

source

string, one of "gage" or "radar" to select rain gage events or radar rainfall events

start_date

string, format: "YYYY-MM-DD", start of data request range

end_date

string, format: "YYYY-MM-DD", end of data request range

sump_correct

logical, TRUE if water level should be corrected for to account for sump depth

rain_events

logical, TRUE if rain event data should be included in result

rainfall

logical, TRUE if rainfall data should be included in result

level

logical, TRUE if water level should be included in result

daylight_savings

logical, Adjust for daylight savings time? when doing QAQC this should be FALSE because the water level data does not spring forward

debug

logical, whether to print lookup times and outputs

Value

Output will be a list consisting of a combination of the following:

Rain Event Data

dataframe, output from marsFetchRainEventData

Rain Gage Data

dataframe, output from marsFetchRainfallData

Level Data

dataframe, output from marsFetchLevelData, plus rainfall_gage_event_uids

See Also

marsFetchRainfallData, marsFetchLevelData, marsFetchRainEventData


taywater/pwdgsi documentation built on April 19, 2024, 11:10 a.m.