marsFetchBaroData: Fetch barometric pressure data for a target SMP, date range,...

View source: R/mars_data_fetch_write_functions.R

marsFetchBaroDataR Documentation

Fetch barometric pressure data for a target SMP, date range, and interval

Description

Returns a data frame with datetime, barometric pressure, smp id, and number of neighbors interpolated from to collect the data.

Usage

marsFetchBaroData(
  con,
  target_id,
  start_date,
  end_date,
  data_interval = c("5 mins", "15 mins")
)

Arguments

con

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

target_id

chr, single SMP ID where the user has requested data

start_date

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

end_date

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

data_interval

chr, "5 mins" or "15 mins", interval at which baro data will be returned.

Value

Output will be a dataframe with four columns:

dtime_est

POSIXct, format: "YYYY-MM-DD HH:MM:SS"

baro_psi

num, barometric pressure in psi

smp_id

chr, SMP ID for each baro

neighbors

num, count of baros interpolated from

If the target SMP has an on-site baro with data, the "neighbors" column will be NA. If there are fewer than five baros to interprolate from, based on marsInterpolateBaro, all columns other than "dtime_est" will be NA.

The function will also output and open an html document describing the data request and including a raster plot of barometric pressures. (This feature is currently disabled. 2/2/21 - NM)

See Also

marsInterpolateBaro


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