Sensitivity analysis for DOC, depth, and time of year
Source:R/sensitivity-kd-depth.R
sens_kd_depth.RdEnter a single location and PAC, and a range of values for DOC or Kd_ref,
water depth, and dates and get back a data.frame of short-term narcotic
guideline, Pabs, and short-term phototoxic guideline values.
Usage
sens_kd_depth(
pac = NULL,
lat = NULL,
lon = NULL,
elev_m = NULL,
DOC = NULL,
Kd_ref = NULL,
depth_m = 0.01,
date = NULL,
time_multiplier = 2,
...
)Arguments
- pac
The PAC of interest, as a
pac_idorpac_namefrompac_list(), which is used to calculate the narcotic benchmark value.- lat
latitude of the site, decimal degrees. Required.
- lon
longitude of the site, decimal degrees. Required.
- elev_m
elevation of the site above sea level, in metres. If
NULL(default), it is0in marine waters, and in freshwater it is looked up from a digital elevation model using lat and lon.- DOC
dissolved organic carbon concentration, in mg/L. Ignored if
Kd_refis set directly.- Kd_ref
Light attenuation coefficient at reference wavelength. In freshwater, can be set directly, or calculated from
DOC. In marine waters, it is calculated from the marine model for the location and date (marine_kd_model()) unless set here.- depth_m
depths at which to calculate the light attenuation coefficient, in metres. Default
0.01(1 cm).- date
date of the calculation, as
Dateobject, or a character in a standard format that can be converted to aDateobject (e.g., "YYYY-MM-DD"). Required.- time_multiplier
If x is a
tuv_resultsdata frame, this is the multiplier to get the total exposure time. I.e., if the tuv_results contains 24 hours of data, and you need a 48h exposure, the multiplier would be 2 (this is the default). Ignored ifxis a numeric value of light absorption.- ...
other parameters passed on to the tuv model. See
tuv()
Value
A data.frame of all of the input parameters, plus pac_id,
pac_name, a list column containing TUV results, and the columns
short_term_narcotic_guideline, pabs and
short_term_phototoxic_guideline. A homologue group name gives the pac_id
of its first parent.
Details
You can add other variables beyond those listed explicitly, but if there are
too many combinations it will create many runs of the TUV model, which can
take a long time. Explicit variable checking is only performed on pac,
lat, lon, elev_m, DOC, Kd_ref, depth, and months. Passing
invalid values of other parameters may cause cryptic errors or unexpected
results.
Note that combinations of many DOC, Kd_ref, depth_m, and date values
will result in many runs of the TUV model and thus take a long time.
Examples
sens_kd_depth(
"Anthracene",
lat = 52,
lon = -113,
Kd_ref = 40:45,
depth_m = c(0.25, 0.5, 1),
date = c("2023-07-01", "2023-08-01")
)
#> # A tibble: 36 × 12
#> lat lon elev_m depth_m date Kd_ref tuv_res pac_id pac_name
#> <dbl> <dbl> <dbl> <dbl> <date> <int> <list> <chr> <chr>
#> 1 52 -113 880 0.25 2023-07-01 40 <tv_rslts> anthracene Anthracene
#> 2 52 -113 880 0.5 2023-07-01 40 <tv_rslts> anthracene Anthracene
#> 3 52 -113 880 1 2023-07-01 40 <tv_rslts> anthracene Anthracene
#> 4 52 -113 880 0.25 2023-08-01 40 <tv_rslts> anthracene Anthracene
#> 5 52 -113 880 0.5 2023-08-01 40 <tv_rslts> anthracene Anthracene
#> 6 52 -113 880 1 2023-08-01 40 <tv_rslts> anthracene Anthracene
#> 7 52 -113 880 0.25 2023-07-01 41 <tv_rslts> anthracene Anthracene
#> 8 52 -113 880 0.5 2023-07-01 41 <tv_rslts> anthracene Anthracene
#> 9 52 -113 880 1 2023-07-01 41 <tv_rslts> anthracene Anthracene
#> 10 52 -113 880 0.25 2023-08-01 41 <tv_rslts> anthracene Anthracene
#> # ℹ 26 more rows
#> # ℹ 3 more variables: short_term_narcotic_guideline <dbl>, pabs <dbl>,
#> # short_term_phototoxic_guideline <dbl>