Skip to content

Commit 960efee

Browse files
committed
latest version
1 parent 27a5d0c commit 960efee

1 file changed

Lines changed: 33 additions & 18 deletions

File tree

inst/extdata/scripts/impetus/readData_BerlinWaterModel_v2.R

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Documentation of aggregation and visualization of Qsim results
22

33
project_path <-
4-
"Y:/iGB/Projects/IMPETUS/"
4+
# "Y:/iGB/Projects/IMPETUS/"
55
# "C:/Users/dwicke/Documents/work/IMPETUS"
6+
"C:/Users/dwicke/Documents/R/Github"
67

7-
data_path <- "Work-packages/WP4_Demonstration_KWB/CS-Berlin/04_Modelling/OGewaesser/BerlinWaterModel/Ergebnisse"
8-
file_name <- "qsimVis_input_days_test_250905.csv"
8+
#data_path <- "Work-packages/WP4_Demonstration_KWB/CS-Berlin/04_Modelling/OGewaesser/BerlinWaterModel/Ergebnisse"
9+
data_path <- "kwb.BerlinWaterModel"
10+
file_name <- "qsimVis_input_days_Val_S0.csv"
911

1012
# find out about column names --------------------------------------------------
1113
colNames <- read.csv(
@@ -16,7 +18,7 @@ print(colNames)
1618
# load and prepare qsim data
1719
df_in <- qsimVis::QSIM_prepare(
1820
qsim_output_file = file.path(project_path, data_path, file_name),
19-
parameter_name = "tracer.wwtp",
21+
parameter_name = "Valsartan.g.m3", # "tracer.wwtp", "tracer.rain"
2022
date_column_name = "Datum",
2123
id_column_name = "GewaesserId",
2224
km_column_name = "Km",
@@ -25,8 +27,8 @@ df_in <- qsimVis::QSIM_prepare(
2527
)
2628

2729
# Aggregate data
28-
df_pro <- df_in$para
29-
unit_factor <- 1/2
30+
df_pro <- df_in$para # df_in$para oder df_in$flow
31+
unit_factor <- 1 # Umrechnungsfaktor, z.B. g/m3 in µg/L
3032
df_pro[,-1] <- df_pro[,-1] * unit_factor
3133
reference_vector <- rep(0, nrow(df_pro))
3234

@@ -36,7 +38,7 @@ output <- list(
3638
dataFrame = df_pro,
3739
thresholds = c(5, 10, 15, 20, 40, 60)/100, # Anzahl flexibel
3840
# thresholds = c(0,10, 20, 40, 60, 80)/100,
39-
dev_type = "egt", # auch "elt" = equal or lower than möglich
41+
dev_type = "egt", # "elt" = equal or lower than möglich, "egt", "gt", "lt"
4042
relative = TRUE), # If TRUE --> relative values in %
4143
"adv_deviation" =
4244
qsimVis::adverse_deviation_from_reference(
@@ -63,31 +65,44 @@ output <- list(
6365
head(output$adv_deviation)
6466
head(output$def_hours)
6567
head(output$stats)
66-
head(output$flow_mean) # der Flow ist überall immer 19.37.
68+
head(output$flow_mean)
6769
# es gibt keinen CVK
6870

6971
output_table <-
7072
"adv_deviation"
73+
# "stats"
7174
# "def_hours"
7275

73-
if(output_table == "adv_deviation"){
74-
output_column <- "adverse_dev"
75-
classBreaks <- c(0, 0.05, 0.1, 0.15, 0.25, 0.5, 1)
76-
colorVector <- NULL # -> MisaColor
77-
LegendTitle <- "Durchschnittliger Abwassergehalt"
78-
}
76+
7977
if(output_table == "def_hours"){
8078
output_column <- "above_0.2"
8179
classBreaks <- c(0, 5, 10, 15, 25, 50, 100)
80+
# classBreaks <- c(seq(0,50, 5), seq(60,100,10))
8281
colorVector <- NULL # -> MisaColor
8382
LegendTitle <- "Anteil mit mehr als 20% Abwasser in %"
8483
}
8584

8685
if(output_table == "def_hours"){
87-
output_column <- "above_0.2"
88-
classBreaks <- c(seq(0,50, 5), seq(60,100,10))
89-
colorVector <- c("blue", "green", "yellow", "orange", "darkred")
90-
LegendTitle <- "Anteil mit mehr als 20% Abwasser in %"
86+
output_column <- "above_0.1"
87+
classBreaks <- c(0, 5, 10, 220, 33, 50, 100)
88+
colorVector <- NULL # -> MisaColor
89+
LegendTitle <- "Zeitanteil mit mehr als 10% Regenabfluss 2002-2022 [%]"
90+
}
91+
92+
# Durchfluss < 0
93+
if(output_table == "def_hours"){
94+
output_column <- "below_0"
95+
classBreaks <- c(0, 1, 10, 15, 25, 50, 75, 100)
96+
colorVector <- c("dodgerblue4", "yellow", "orange", "darkorange3", "red", "red3", "darkred")
97+
LegendTitle <- "Zeitanteil mit Durchfluss<0 in 2019 [%]"
98+
}
99+
100+
# Valsartansäure
101+
if(output_table == "stats"){
102+
output_column <- "mean"
103+
classBreaks <- c(0, 0.25, 0.5, 1, 2.5, 4, 6)
104+
colorVector <- NULL
105+
LegendTitle <- "Konzentration Valsartansäure 2019 [µg/L]"
91106
}
92107

93108
# Combine river stretch and simulations data

0 commit comments

Comments
 (0)