Commit 905db76d authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v1.2.7.10 UPDATE: ErrorCrit_* fun can now run with SCA and SWE

parent dfad6ac5
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.2.7.9
Version: 1.2.7.10
Date: 2019-03-06
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
......@@ -13,7 +13,7 @@ output:
### 1.2.7.9 Release Notes (2019-03-06)
### 1.2.7.10 Release Notes (2019-03-06)
......@@ -32,7 +32,7 @@ output:
- <code>CreateInputsCrit()</code> now presents a <code>varObs</code> argument in order to prepare an <code>InputsCrit</code> object in order run a criterion on other variable than observed discharges with the <code>ErrorCrit()</code> function (e.g. SCA, SWE).
- <code>CreateInputsCrit()</code> now presents a <code>weights</code> argument in order to prepare an <code>InputsCrit</code> object in order to compute a composite criterion (<code>Compo</code> class) with <code>ErrorCrit()</code> or <code>Calibration_Michel()</code>.
- <code>CreateInputsCrit()</code> now presents a <code>weights</code> argument in order to prepare an <code>InputsCrit</code> object in order to compute a composite criterion (<code>Compo</code> class) with <code>ErrorCrit()</code> or <code>Calibration_Michel()</code>.
- <code>CreateInputsCrit()</code> now presents a <code>warnings</code> argument to replace the verbose action (the <code>verbose</code> argument is keep to print messages).
......@@ -45,7 +45,9 @@ output:
- <code>ErrorCrit_&#42;()</code> functions now return an error message if the <code>InputsCrit</code> object is of class <code>Multi</code> or <code>Compo</code>.
- <code>ErrorCrit()</code> function can now run on a multiple <code>InputsCrit</code>. It returns a list of <code>InputsCrit</code>.
- <code>ErrorCrit()</code> function can now run on a multiple or a composite <code>InputsCrit</code>. It returns a list of <code>InputsCrit</code>.
- <code>ErrorCrit()</code> and <code>ErrorCrit_&#42;()</code> functions can now run on Q, SCA or SWE.
- <code>Calibration_Michel()</code> function can now run on a composite <code>InputsCrit</code>. It returns a composite value of error and the list of <code>InputsCrit</code> used to calculate this composite criterion.
......
......@@ -41,7 +41,15 @@ ErrorCrit_KGE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = T
##Data_preparation_______________________________
VarObs <- InputsCrit$obs
VarObs[!InputsCrit$BoolCrit] <- NA
VarSim <- OutputsModel$Qsim
if (InputsCrit$varObs == "Q") {
VarSim <- OutputsModel$Qsim
}
if (InputsCrit$varObs == "SCA") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$groupLayer], FUN = "[[", "Gratio"))
}
if (InputsCrit$varObs == "SWE") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$groupLayer], FUN = "[[", "SnowPack"))
}
VarSim[!InputsCrit$BoolCrit] <- NA
##Data_transformation
......
......@@ -41,7 +41,15 @@ ErrorCrit_KGE2 <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose =
##Data_preparation_______________________________
VarObs <- InputsCrit$obs
VarObs[!InputsCrit$BoolCrit] <- NA
VarSim <- OutputsModel$Qsim
if (InputsCrit$varObs == "Q") {
VarSim <- OutputsModel$Qsim
}
if (InputsCrit$varObs == "SCA") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$groupLayer], FUN = "[[", "Gratio"))
}
if (InputsCrit$varObs == "SWE") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$groupLayer], FUN = "[[", "SnowPack"))
}
VarSim[!InputsCrit$BoolCrit] <- NA
##Data_transformation
......
......@@ -41,7 +41,15 @@ ErrorCrit_NSE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = T
##Data_preparation_______________________________
VarObs <- InputsCrit$obs
VarObs[!InputsCrit$BoolCrit] <- NA
VarSim <- OutputsModel$Qsim
if (InputsCrit$varObs == "Q") {
VarSim <- OutputsModel$Qsim
}
if (InputsCrit$varObs == "SCA") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$groupLayer], FUN = "[[", "Gratio"))
}
if (InputsCrit$varObs == "SWE") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$groupLayer], FUN = "[[", "SnowPack"))
}
VarSim[!InputsCrit$BoolCrit] <- NA
##Data_transformation
......
......@@ -41,7 +41,15 @@ ErrorCrit_RMSE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose =
##Data_preparation_______________________________
VarObs <- InputsCrit$obs
VarObs[!InputsCrit$BoolCrit] <- NA
VarSim <- OutputsModel$Qsim
if (InputsCrit$varObs == "Q") {
VarSim <- OutputsModel$Qsim
}
if (InputsCrit$varObs == "SCA") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$groupLayer], FUN = "[[", "Gratio"))
}
if (InputsCrit$varObs == "SWE") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$groupLayer], FUN = "[[", "SnowPack"))
}
VarSim[!InputsCrit$BoolCrit] <- NA
##Data_transformation
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment