From 04a25e4dacfb615b3931984cfbca8ede3bb45024 Mon Sep 17 00:00:00 2001 From: Ranke Johannes Date: Thu, 7 Mar 2024 10:37:07 +0100 Subject: Generalise PEC_sw_drift MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Possibility to use FOCUS drift values (mean over width of waterbody) - Support side angles other than 90°, i.e. 45° (0° to 90°) --- R/PEC_sw_drift.R | 31 +++++++++++++++++++++++----- docs/pkgdown.yml | 2 +- docs/reference/PEC_sw_drift.html | 43 ++++++++++++++++++++++++++++++++++++--- docs/reference/Rplot001.png | Bin 14540 -> 1011 bytes docs/search.json | 2 +- log/build.log | 2 +- log/check.log | 10 ++++----- log/test.log | 8 +++----- man/PEC_sw_drift.Rd | 27 +++++++++++++++++++++--- 9 files changed, 101 insertions(+), 24 deletions(-) diff --git a/R/PEC_sw_drift.R b/R/PEC_sw_drift.R index eccb5bf..22aa012 100644 --- a/R/PEC_sw_drift.R +++ b/R/PEC_sw_drift.R @@ -8,15 +8,19 @@ #' @seealso [drift_parameters_focus], [drift_percentages_rautmann] #' @param rate Application rate in units specified below #' @param drift_percentages Percentage drift values for which to calculate PECsw. -#' 'drift_data' and 'distances' if not NULL. +#' Overrides 'drift_data' and 'distances' if not NULL. #' @param drift_data Source of drift percentage data. If 'JKI', the [drift_data_JKI] -#' included in the package is used. If 'RF', the Rautmann formula is used, if -#' implemented for the crop type and number of applications +#' included in the package is used. If 'RF', the Rautmann drift data are calculated +#' either in the original form or integrated over the width of the water body, depending +#' on the 'formula' argument. #' @param crop_group_JKI When using the 'JKI' drift data, one of the German names #' as used in [drift_parameters_focus]. #' @param water_depth Depth of the water body in cm #' @param rate_units Defaults to g/ha #' @param PEC_units Requested units for the calculated PEC. Only µg/L currently supported +#' @param water_width Width of the water body in cm +#' @param side_angle The angle of the side of the water relative to the bottom which +#' is assumed to be horizontal, in degrees. The SYNOPS model assumes 45 degrees here. #' @return The predicted concentration in surface water #' @export #' @author Johannes Ranke @@ -35,6 +39,14 @@ #' #' # Using custom drift percentages is also supported #' PEC_sw_drift(100, drift_percentages = c(2.77, 0.95, 0.57, 0.48, 0.29, 0.15, 0.06, 0.03)) +#' +#' # The influence of assuming a 45° angle of the sides of the waterbody and the width of the +#' # waterbody can be illustrated +#' PEC_sw_drift(100) +#' PEC_sw_drift(100, drift_data = "RF") +#' PEC_sw_drift(100, drift_data = "RF", formula = "FOCUS") +#' PEC_sw_drift(100, drift_data = "RF", formula = "FOCUS", side_angle = 45) +#' PEC_sw_drift(100, drift_data = "RF", formula = "FOCUS", side_angle = 45, water_width = 200) PEC_sw_drift <- function(rate, applications = 1, water_depth = 30, @@ -46,6 +58,9 @@ PEC_sw_drift <- function(rate, crop_group_focus = c("arable", "hops", "vines, late", "vines, early", "fruit, late", "fruit, early", "aerial"), distances = c(1, 5, 10, 20), + formula = c("Rautmann", "FOCUS"), + water_width = 100, + side_angle = 90, rate_units = "g/ha", PEC_units = "\u00B5g/L") { @@ -54,14 +69,20 @@ PEC_sw_drift <- function(rate, drift_data <- match.arg(drift_data) crop_group_JKI <- match.arg(crop_group_JKI) crop_group_focus <- match.arg(crop_group_focus) - water_volume <- 100 * 100 * (water_depth/100) * 1000 # in L (for 1 ha) + formula <- match.arg(formula) + if (side_angle < 0 | side_angle > 90) stop("The side anglemust be between 0 and 90 degrees") + mean_water_width <- if (side_angle == 90) water_width + else water_width - (water_depth / tanpi(side_angle/180)) + water_volume <- 100 * mean_water_width * (water_depth/100) * 1000 # in L (for 1 ha) PEC_sw_overspray <- rate * 1e6 / water_volume # in µg/L dist_index <- as.character(distances) if (is.null(drift_percentages)) { drift_percentages <- switch(drift_data, JKI = pfm::drift_data_JKI[[applications]][dist_index, crop_group_JKI], - RF = drift_percentages_rautmann(distances, applications, crop_group_focus) + RF = drift_percentages_rautmann(distances, applications, + formula = formula, + crop_group_focus, widths = water_width/100) ) names(drift_percentages) <- paste(dist_index, "m") } else { diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 18a98ee..1bf01ed 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -2,7 +2,7 @@ pandoc: 3.1.1 pkgdown: 2.0.7 pkgdown_sha: ~ articles: {} -last_built: 2024-03-06T15:26Z +last_built: 2024-03-07T09:36Z urls: reference: https://pkgdown.jrwb.de/pfm/reference article: https://pkgdown.jrwb.de/pfm/articles diff --git a/docs/reference/PEC_sw_drift.html b/docs/reference/PEC_sw_drift.html index b7abba7..1fe8465 100644 --- a/docs/reference/PEC_sw_drift.html +++ b/docs/reference/PEC_sw_drift.html @@ -65,6 +65,9 @@ with input via spray drift.

crop_group_focus = c("arable", "hops", "vines, late", "vines, early", "fruit, late", "fruit, early", "aerial"), distances = c(1, 5, 10, 20), + formula = c("Rautmann", "FOCUS"), + water_width = 100, + side_angle = 90, rate_units = "g/ha", PEC_units = "µg/L" ) @@ -86,13 +89,14 @@ with input via spray drift.

drift_percentages

Percentage drift values for which to calculate PECsw. -'drift_data' and 'distances' if not NULL.

+Overrides 'drift_data' and 'distances' if not NULL.

drift_data

Source of drift percentage data. If 'JKI', the drift_data_JKI -included in the package is used. If 'RF', the Rautmann formula is used, if -implemented for the crop type and number of applications

+included in the package is used. If 'RF', the Rautmann drift data are calculated +either in the original form or integrated over the width of the water body, depending +on the 'formula' argument.

crop_group_JKI
@@ -108,6 +112,21 @@ as used in drift_parameters_focus.

The distances in m for which to get PEC values

+
formula
+

By default, the original Rautmann formula is used. If you +specify "FOCUS", mean drift input over the width of the water body is +calculated as described in Chapter 5.4.5 of the FOCUS surface water guidance

+ + +
water_width
+

Width of the water body in cm

+ + +
side_angle
+

The angle of the side of the water relative to the bottom which +is assumed to be horizontal, in degrees. The SYNOPS model assumes 45 degrees here.

+ +
rate_units

Defaults to g/ha

@@ -163,6 +182,24 @@ as used in drift_parameters_focus.

#> 0.92333333 0.31666667 0.19000000 0.16000000 0.09666667 0.05000000 0.02000000 #> 0.03 % #> 0.01000000 + +# The influence of assuming a 45° angle of the sides of the waterbody and the width of the +# waterbody can be illustrated +PEC_sw_drift(100) +#> 1 m 5 m 10 m 20 m +#> 0.92333333 0.19000000 0.09666667 0.05000000 +PEC_sw_drift(100, drift_data = "RF") +#> 1 m 5 m 10 m 20 m +#> 0.91976667 0.19064473 0.09680051 0.04915079 +PEC_sw_drift(100, drift_data = "RF", formula = "FOCUS") +#> 1 m 5 m 10 m 20 m +#> 0.64246407 0.17414541 0.09235842 0.04798749 +PEC_sw_drift(100, drift_data = "RF", formula = "FOCUS", side_angle = 45) +#> 1 m 5 m 10 m 20 m +#> 0.91780582 0.24877916 0.13194060 0.06855356 +PEC_sw_drift(100, drift_data = "RF", formula = "FOCUS", side_angle = 45, water_width = 200) +#> 1 m 5 m 10 m 20 m +#> 0.30085000 0.09468652 0.05201349 0.02758547