marsFetchRainfallData: Return a dataframe with rain gage data

View source: R/mars_data_fetch_write_functions.R

marsFetchRainfallDataR Documentation

Return a dataframe with rain gage data

Description

Return data from the rain gage nearest a target SMP, for a specified date range.

Usage

marsFetchRainfallData(
  con,
  target_id,
  source = c("gage", "radar"),
  start_date,
  end_date,
  daylightsavings
)

Arguments

con

Formal class 'PostgreSQL', a connection to the MARS Analysis database

target_id

chr, an SMP_ID that where the user has requested data

source

chr, either "gage" or "radar" to retrieve rain gage data or radar rainfall data

start_date

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

end_date

stringor POSIXCT date, format: "YYYY-MM-DD", end of data request range

daylightsavings

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

Value

Output will be a data frame with four columns, which corresponds to the specified SMP and date range:

dtime_est OR dtime_edt

POSIXct datetime with tz = EST or EDT as specified by daylight_savings

rainfall_in

num, rainfall for the 15 minute preceding the corresponding datetime

gage_uid OR radar_uid

Unique identifier for where the data came from

event_id

event number during this timestep

See Also

marsGapFillEventID, marsDetectEvents


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