aboutsummaryrefslogtreecommitdiff
path: root/tests/testthat/test_PEC_sw_drift.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2024-08-26 17:11:43 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2024-08-26 17:11:43 +0200
commit913c383880da2a5f4bdb71c8a82107afbad6ef13 (patch)
tree1c5a988748fc49fde4c279a96650deb26039b711 /tests/testthat/test_PEC_sw_drift.R
parent9e62ed638e530a5cebebf491de055caca49a56ef (diff)
parent396ba6c42252426a132be56b9f417786a1f276e3 (diff)
Merge branch 'main' into crop_group
Diffstat (limited to 'tests/testthat/test_PEC_sw_drift.R')
-rw-r--r--tests/testthat/test_PEC_sw_drift.R20
1 files changed, 15 insertions, 5 deletions
diff --git a/tests/testthat/test_PEC_sw_drift.R b/tests/testthat/test_PEC_sw_drift.R
index 7e3b965..1bcb3d4 100644
--- a/tests/testthat/test_PEC_sw_drift.R
+++ b/tests/testthat/test_PEC_sw_drift.R
@@ -1,22 +1,32 @@
library(pfm)
+library(testthat)
+library(units)
context("Simple PEC surface water calculations with drift entry")
test_that("PEC_sw_drift gives the same results as the CRD PEC calculator", {
# One application of 30 g/ha to field crops calculated with UK PEC calculator published by CRD
- expect_equal(round(PEC_sw_drift(30), 3),
- c('1 m' = 0.277, '5 m' = 0.057, '10 m' = 0.029, '20 m' = 0.015))
+ expect_equal(
+ round(PEC_sw_drift(30), 3),
+ set_units(c('1 m' = 0.277, '5 m' = 0.057, '10 m' = 0.029, '20 m' = 0.015), "\u00B5g/L"))
# 7 applications of 30 g/ha to field crops calculated with UK PEC calculator, initial PEC
- expect_equal(round(PEC_sw_drift(30, 7), 3),
- c('1 m' = 0.161, '5 m' = 0.033, '10 m' = 0.017, '20 m' = 0.008))
+ expect_equal(
+ round(PEC_sw_drift(30, 7), 3),
+ set_units(c('1 m' = 0.161, '5 m' = 0.033, '10 m' = 0.017, '20 m' = 0.008), "\u00B5g/L"))
# 4 applications of 30 g/ha to late fruit crops calculated with UK PEC
# calculator published by CRD. CRD uses different drift values from SANCO aquatic
# guidance), except for 50 m
pfm_30_4_obst_spaet <- round(PEC_sw_drift(30, 4, crop_group_JKI = "Obstbau spaet",
distances = c(3, 20, 50)), 3)
- crd_30_4_obst_spaet <- c('3 m' = 1.101, '20 m' = 0.080, '50 m' = 0.013)
+ crd_30_4_obst_spaet <- set_units(c('3 m' = 1.101, '20 m' = 0.080, '50 m' = 0.013), "µg/L")
expect_equal(pfm_30_4_obst_spaet[3], crd_30_4_obst_spaet[3])
+
+ # Synops scenario with 45 m angle. Mean width is 100 cm - (2 * 15 cm).
+ expect_equal(
+ PEC_sw_drift(100) * 100/70,
+ PEC_sw_drift(100, side_angle = 45)
+ )
})
test_that("The Rautmann formula is correctly implemented", {

Contact - Imprint