aboutsummaryrefslogtreecommitdiff
path: root/pkg/R/TOXSWA_cwa.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2016-06-08 08:29:39 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2016-06-08 08:33:19 +0200
commit234a20018fe9fe9824bcfaae2c391e59d09f9871 (patch)
tree1e17c0198e6283eef9efd1193b0531d9a63ebcac /pkg/R/TOXSWA_cwa.R
parent057d53d0faed7b297bbb99de8cd4bf3e3e448538 (diff)
Use the concentration at the end of the hour
This is also what TOXSWA presents in the summary files
Diffstat (limited to 'pkg/R/TOXSWA_cwa.R')
-rw-r--r--pkg/R/TOXSWA_cwa.R8
1 files changed, 5 insertions, 3 deletions
diff --git a/pkg/R/TOXSWA_cwa.R b/pkg/R/TOXSWA_cwa.R
index d2720a9..5f32860 100644
--- a/pkg/R/TOXSWA_cwa.R
+++ b/pkg/R/TOXSWA_cwa.R
@@ -1,4 +1,4 @@
-# Copyright (C) 2014,2015 Johannes Ranke
+# Copyright (C) 2014,2015,2016 Johannes Ranke
# Contact: jranke@uni-bremen.de
# This file is part of the R package pfm
@@ -19,7 +19,9 @@
#'
#' Read TOXSWA hourly concentrations of a chemical substance in a specific
#' segment of a TOXSWA surface water body. Per default, the data for the last
-#' segment are imported.
+#' segment are imported. As TOXSWA reports the values at the end of the hour
+#' (ConLiqWatLayCur) in its summary file, we use this value as well instead
+#' of the hourly averages (ConLiqWatLay).
#'
#' @param filename The filename of the cwa file (TOXSWA 2.x.y or similar) or the
#' out file (FOCUS TOXSWA 4, i.e. TOXSWA 4.4.2 or similar).
@@ -225,7 +227,7 @@ TOXSWA_cwa <- R6Class("TOXSWA_cwa",
if (inherits(outfile, "try-error")) {
stop("Could not read ", filename)
} else {
- cwa_lines <- outfile[grep("ConLiqWatLay_", outfile)] # hourly concentrations
+ cwa_lines <- outfile[grep("ConLiqWatLayCur_", outfile)] # concentrations at end of hour
cwa_all_segments <- read_fwf(paste(cwa_lines, collapse = "\n"),
fwf_empty(paste(tail(cwa_lines), collapse = "\n")))

Contact - Imprint