Skip to contents

Similar to find_ts_id() for Kiwis in spirit

Usage

find_hydstra_request(
  portal,
  gauge,
  datasource = "A",
  var_list = NULL,
  variable = NULL,
  units = NULL,
  statistic = "mean",
  timeunit = "day",
  multiplier = 1,
  warnmissing = TRUE,
  ignore_fromderived = TRUE
)

Arguments

portal

character for the data portal (case insensitive). Default 'victoria'

gauge

character vector of gauge numbers, as site_list for Hydstra functions (station_no for Kiwis functions)

datasource

character for datasource code. To my knowledge, options are "A", "TELEM", "TELEMCOPY". Passing multiple not currently supported.

var_list

as in get_ts_traces(), but can also take "all" to get all available variables at each site in site_list. If 'all', overrides variable and units, though using var_list with those is always dangerous.

variable

allows searching by variable name, e.g. 'discharge' with grepl as in fetch_kiwis_timeseries()

units

allows searching by the units of the variable, e.g. 'ML/d' with grepl as in fetch_kiwis_timeseries()

statistic

same as data_type in get_ts_traces(). Name changed for consistency and interpretation. Can be a single character or a vector the same length as var_list. If single value, behaves as in get_ts_traces(), applying that function to all variables. If a vector, it applies the given function to the variable in the matching position of var_list. This allows us to ask for many variables that might need different statistics. Note- if var_list = "all", there is no way to match since the variables are unknown and may change between sits, and so statistic should be a single function.

timeunit

same as interval in get_ts_traces(). Name changed for consistency and interpretation.

multiplier

character, interval multiplier. I think this allows intervals like 5 days, by passing interval = 'day' and multiplier = 5. Not tested other than 1 at present.

warnmissing

warns if a gauge is missing. TRUE by default, but able to be silenced for programmatic use.

ignore_fromderived

logical, default TRUE. Sometimes a derived variable (140, 141) is also available as a var_from, seemingly usually with a longer historical record. TRUE (the default) ignores that, and uses just the e.g. var_from = 100, var_to = 140. FALSE returns both sets, e.g. all records with the derived variable as var_to. If FALSE, look at the output carefully, it's often very strange

Value

a tibble, each row of which has the information needed for a Hydstra request