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, for now, this should always be FALSE

Value

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

dtime

POSIXct datetime in America/New_York

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 June 14, 2025, 9 p.m.