ms_calc_load | R Documentation |
Determines solute loads from daily stream discharge and corresponding chemistry
data using any of five available methods. For daily stream/precip solute fluxes, see ms_calc_flux()
.
ms_calc_load(chemistry, q, method = "all", verbose = TRUE)
chemistry |
A |
q |
A |
method |
character vector. Any combination of: "pw", "rating", "composite", "beale", "average". Use "all" to run every method. See details. |
verbose |
logical. FALSE for less frequent informational messaging. |
MacroSheds format (only date, site_code, var, and val are required in inputs to this function):
column | definition |
date | Date in YYYY-mm-dd |
site_code | A unique identifier for each MacroSheds site, identical to primary source site code where possible. See ms_load_sites() . |
grab_sample | Boolean integer indicating whether the observation was obtained via grab sample or installed sensor. 1 = TRUE (grab sample), 0 = FALSE (installed sensor). |
var | Variable code. See ms_load_variables() . |
val | Data value. See ms_load_variables() for units. |
ms_status | Boolean integer. 0 = clean value. 1 = questionable value. See "Technical Validation" section of the MacroSheds data paper for details. |
ms_interp | Boolean integer. 0 = measured or imputed by primary source. 1 = interpolated by MacroSheds. See "Temporal Imputation and Aggregation" section of the MacroSheds data paper for details. |
val_err | The combined standard uncertainty associated with the corresponding data point, if estimable. See "Detection Limits and Propagation of Uncertainty" section of the MacroSheds data paper for details. |
Core time-series datasets generated by ms_load_product are in MacroSheds format.
Load methods:
'pw': period-weighted method, described in Aulenbach et al. 2016. Here, C is linearly interpolated. This option uses package RiverLoad.
'rating': AKA regression-model method, described in Aulenbach et al. 2016. This option uses package RiverLoad.
'composite': composite method, described in Aulenbach et al. 2016. This option uses package RiverLoad.
'beale': Beale ratio estimator, described in Meals et al. 2013. This option uses package RiverLoad.
'average': mean Q over the aggregation period times mean C over the aggregation period Consult Figure 10 in Aulenbach et al. 2016 for guidance on method selection. See Figure 1 for some intuition.
Output units are kg/ha/yr, where yr is water-year.
References:
Aulenbach, B. T., Burns, D. A., Shanley, J. B., Yanai, R. D., Bae, K., Wild, A. D., Yang, Y., & Yi, D. (2016). Approaches to stream solute load estimation for solutes with varying dynamics from five diverse small watersheds. Ecosphere, 7(6), e01298.
Meals, D. W., Richards, R. P., & Dressing, S. A. (2013). Pollutant load estimation for water quality monitoring projects. Tech Notes, 8, 1-21.
A list
containing two tibbles, load and diagnostics. Tibble formats are as follows.
load: a tibble
of annual loads.
column | definition |
site_code | short name for MacroSheds site. See MacroSheds format below. |
var | Variable code. See MacroSheds format below. |
water_year | Full year beginning on October 1 and ending on Sept 30 |
load | Annual solute load for the watershed |
method | The method used to compute annual solute load. See Aulenbach et al. 2016 and Gubbins et al. in review |
ms_recommended | The most appropriate load estimation method based on Fig 10 from Aulenbach et al. 2016 and Fig 16 from Gubbins et al. in review. 1 = recommended, 0 = not recommended. NA = insufficient data to generate meaningful load estimate by the corresponding method. |
Output units are kg/ha/yr, where yr is water-year.
diagnostics: a tibble
of quantities that may be used to filter load estimates.
Aulenbach et al. 2016 and
Gubbins et al. in review.
column | definition |
site_code | short name for MacroSheds site. See MacroSheds format below. |
var | Variable code. See MacroSheds format below. |
water_year | Full year beginning on October 1 and ending on Sept 30 |
cq_rsquared | The coefficient of determination from the concentration-discharge relationship |
cq_resid_acf | Autocorrelation coefficient at lag 1 on the residuals of the concentration-discharge relationship |
c_acf | Autocorrelation coefficient at lag 1 for the concentration series |
n_c_obs | Number of concentration observations |
n_q_obs | Number of discharge observations |
n_paired_cq_obs | Number of paired concentration and discharge observations |
unique_c_quarters | Number of unique quarters (even divisions of the calendar year into four parts) represented in the concentration data |
ws_area_ha | The watershed area in hectares |
Wes Slaughter, wslaughter@berkeley.edu
Nick Gubbins, gubbinsnick@gmail.com
Mike Vlah, vlahm13@gmail.com
Spencer Rhea
ms_calc_flux()
ms_root = 'data/macrosheds'
ms_download_core_data(macrosheds_root = ms_root,
domains = 'hbef')
chemistry <- ms_load_product(macrosheds_root = ms_root,
prodname = 'stream_chemistry',
site_codes = c('w1', 'w3'),
filter_vars = c('NO3_N', 'Cl'))
q <- ms_load_product(macrosheds_root = ms_root,
prodname = 'discharge',
site_codes = c('w1', 'w3'))
flux <- ms_calc_load(chemistry = chemistry,
q = q)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.