Skip to contents

Define a hymetDP method

Usage

define_method(
  L0_flat,
  local_variable_column = "variable_name",
  local_variable = NULL,
  VariableCode = NULL,
  MethodDescription = NULL,
  MethodLink = NULL
)

Arguments

L0_flat

(tbl_df, tbl, data.frame) The fully joined source L0 dataset, in "flat" format (see details).

local_variable_column

(character) Column in L0_flat table containing the L0 variable name.

local_variable

(character) Reference to a value (or values) in the local_variable_column from the L0_flat table to which the new hymetDP method refers.

VariableCode

(character) The auto-generated primary key for a variable (from column VariableCode). Another way to link a method to a value (or values). Takes priority over local_variable. Provide one or multiple codes.

MethodDescription

(character) Text description of the method.

MethodLink

(character) Optional. Link to additional reference material on the method. Should be a single valid URL.

Value

(tbl_df, tbl, data.frame) An augmented version of the original flat table, with all of the original columns plus one additional column for the method description (or two additional columns if a method link is defined). Column name includes the auto-generated MethodCode (i.e. MethodDescription_1), which will become the the primary key in the Methods table.

Details

This function appends columns to the L0_flat table and returns the augmented table.

"flat" format refers to the fully joined source L0 dataset in "wide" form with the exception of the core observation variables, which are in "long" form (i.e. using the variable_name, value, unit columns of the observation table). This "flat" format is the "widest" an L1 hymetDP dataset can be consistently spread due to the frequent occurrence of L0 source datasets with > 1 core observation variable.

Examples


flat <- hymet_L0_flat[1:19]

flat <- hymetDP::define_method(
  L0_flat = flat,
  local_variable_column = "variable_name",
  local_variable = "DSCHRGE_RATE",
  VariableCode = c(1,2,3),
  MethodDescription = paste(
    "Campbell CR10 dataloggers were used to record stream stage, water",
    "temperature, and conductivity in a network of stream gages.",
    "Stage is monitored with pressure transducers; PSS-1 and PS-2 models",
    "form Paroscientific Corporation, and Accubars from Sutron",
    "Corporation. The pressure transducers measure the backpressure in",
    "orifice lines set into or above controls in the stream channel. In",
    "addition, some of the sites monitor water temperature and",
    "conductivity with either USGS minimonitor probes, or Campbell",
    "temperature/conductivity probes. Ratings are developed for the",
    "stage/discharge relationship at each site by measuring streamflow",
    "with current meters or portable flumes, according to standard USGS",
    "methods. Datum corrections to the stage are determined by",
    "periodically surveying the elevation of the orifice line to the",
    "control and nearby reference marks. Calibrations for the",
    "temperature and conductivity are assessed by measuring these",
    "parameters with portable field meters while simultaneously noting",
    "the readings from the gage probes. Data is downloaded into Campbell",
    "storage modules, and retrieved into pcs. From there, the data is",
    "sent to a USGS computer, where time discrepancies are resolved, and",
    "the data is loaded into ADAPS, a database system developed in the",
    "USGS for maintaining and processing water data. A determination for",
    "each site as to when the stream was flowing and when it was not is",
    "made. For water temperature and conductivity, bad data is deleted.",
    "Variable shifts are determined based on field calibration",
    "measurements, and other indicators. The shifts are applied to the",
    "remaining good data inside of ADAPS. The data is pulled out of",
    "ADAPS, and reformatted for input into ORACLE. Cases of water",
    "temperature below reasonable values are set to lower limits. A",
    "quality code is assigned to every value. The resulting data is",
    "uploaded into the ORACLE and the McMurdo database. Before 2011, For",
    "stage/discharge, bad data is deleted. Survey data is reviewed to",
    "compute weir elevations an datum corrections. A rating curve is",
    "developed graphically, based on available data, and entered into",
    "ADAPS. All applicable shifts and datum corrections are entered into",
    "ADAPS. All corrections and ratings are run against the good stage",
    "data to compute the discharge at each recording interval. The data",
    "is pulled out of ADAPS, and reformatted for input into ORACLE. A",
    "quality code is assigned to every value. The resulting data is",
    "uploaded into ORACLE and the McMurdo database. ADAPS deprecated in",
    "favor of Aquarius software in 2012. Similar procedure is used in",
    "Aquarius to convert and curate the data. Metadata was enhanced in",
    "2013 and 2014 by Inigo San Gil. In March 2021, data from the",
    "2016-17 field season was replaced to correct a previously published",
    "error, in which discharge was reported in cubicFeetPerSecond (CFS)",
    "instead of litersPerSecond (l/s)."
    ),
  MethodLink = NULL)