Commit 50b3d10f authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v1.2.15.5 CLEAN: minor syntax revisions in plot.OutputsModel

Showing with 18 additions and 18 deletions
+18 -18
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.2.15.4
Date: 2019-05-02
Version: 1.2.15.5
Date: 2019-05-03
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
person("Olivier", "Delaigue", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7668-8468"), email = "airGR@irstea.fr"),
......
......@@ -14,7 +14,7 @@ output:
### 1.2.15.34 Release Notes (2019-05-02)
### 1.2.15.5 Release Notes (2019-05-03)
#### New features
......
......@@ -174,12 +174,12 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea =
}
BOOL_QobsZero <- FALSE
if (BOOL_Qobs) {
SelectQobsNotZero <- (round(Qobs[IndPeriod_Plot] , 4) != 0)
SelectQobsNotZero <- round(Qobs[IndPeriod_Plot], 4) != 0
BOOL_QobsZero <- sum(!SelectQobsNotZero, na.rm = TRUE) > 0
}
BOOL_QsimZero <- FALSE
if (BOOL_Qsim) {
SelectQsimNotZero <- (round(OutputsModel$Qsim[IndPeriod_Plot], 4) != 0)
SelectQsimNotZero <- round(OutputsModel$Qsim[IndPeriod_Plot], 4) != 0
BOOL_QsimZero <- sum(!SelectQsimNotZero, na.rm = TRUE) > 0
}
if (BOOL_QobsZero & verbose) {
......@@ -191,15 +191,15 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea =
BOOL_FilterZero <- TRUE
## Plots_choices
BOOLPLOT_Precip <- ( "Precip" %in% which & BOOL_Pobs )
BOOLPLOT_PotEvap <- ( "PotEvap" %in% which & BOOL_Eobs )
BOOLPLOT_Temp <- ( "Temp" %in% which & BOOL_Snow )
BOOLPLOT_SnowPack <- ( "SnowPack" %in% which & BOOL_Snow )
BOOLPLOT_Flows <- ( "Flows" %in% which & (BOOL_Qsim | BOOL_Qobs) )
BOOLPLOT_Error <- ( "Error" %in% which & BOOL_Error )
BOOLPLOT_Regime <- ( "Regime" %in% which & BOOL_TS & BOOL_Qsim & (NameTS %in% c("hour", "day", "month")) )
BOOLPLOT_CumFreq <- ( "CumFreq" %in% which & (BOOL_Qsim | BOOL_Qobs) & BOOL_FilterZero )
BOOLPLOT_CorQQ <- ( "CorQQ" %in% which & (BOOL_Qsim & BOOL_Qobs) & BOOL_FilterZero )
BOOLPLOT_Precip <- "Precip" %in% which & BOOL_Pobs
BOOLPLOT_PotEvap <- "PotEvap" %in% which & BOOL_Eobs
BOOLPLOT_Temp <- "Temp" %in% which & BOOL_Snow
BOOLPLOT_SnowPack <- "SnowPack" %in% which & BOOL_Snow
BOOLPLOT_Flows <- "Flows" %in% which & (BOOL_Qsim | BOOL_Qobs)
BOOLPLOT_Error <- "Error" %in% which & BOOL_Error
BOOLPLOT_Regime <- "Regime" %in% which & BOOL_TS & BOOL_Qsim & (NameTS %in% c("hour", "day", "month"))
BOOLPLOT_CumFreq <- "CumFreq" %in% which & (BOOL_Qsim | BOOL_Qobs) & BOOL_FilterZero
BOOLPLOT_CorQQ <- "CorQQ" %in% which & (BOOL_Qsim & BOOL_Qobs) & BOOL_FilterZero
## Options
......@@ -773,9 +773,9 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea =
Quant <- as.numeric(quantile(DATA2, SeqQuant, na.rm = TRUE))
Fn <- ecdf(DATA2)
YY <- DATA2
YY <- YY[order( Fn(DATA2) )]
YY <- YY[order(Fn(DATA2))]
XX <- Fn(DATA2)
XX <- XX[order( Fn(DATA2) )]
XX <- XX[order(Fn(DATA2))]
lines(XX, YY, lwd = lwd, col = par("fg"))
txtleg <- c(txtleg, "observed")
colleg <- c(colleg, par("fg"))
......@@ -786,9 +786,9 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea =
Quant <- as.numeric(quantile(DATA2, SeqQuant, na.rm = TRUE))
Fn <- ecdf(DATA2)
YY <- DATA2
YY <- YY[order( Fn(DATA2) )]
YY <- YY[order(Fn(DATA2))]
XX <- Fn(DATA2)
XX <- XX[order( Fn(DATA2) )]
XX <- XX[order(Fn(DATA2))]
lines(XX, YY, lwd = lwd, col = "orangered")
txtleg <- c(txtleg, "simulated")
colleg <- c(colleg, "orangered")
......
Supports Markdown
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