WSL/SLF GitLab Repository

Commit 2e55df38 authored by Adrien Michel's avatar Adrien Michel
Browse files

Fixed error in snow season length map plots

parent c2b75073
......@@ -612,13 +612,6 @@ plt.snow.season.length.calib <- function(data.target.calib, data.training.calib,
valid.years <- colnames(snow.season.target.valid)
data.length <- length(valid.years)
snow.season.target.valid=matrix(unlist(snow.season.target.valid), ncol = data.length,
byrow = TRUE)
snow.season.training.valid=matrix(unlist(snow.season.training.valid), ncol = data.length,
byrow = TRUE)
snow.season.corrected.valid=matrix(unlist(snow.season.corrected.valid), ncol = data.length,
byrow = TRUE)
vioplot::vioplot(snow.season.target.valid, at=seq(from=1,length.out=data.length, by=4),
col=2, colMed =1, ylab="Snow season length (day)", main = "Validation",
names = valid.years)
......@@ -673,6 +666,7 @@ plt.snow.season.length.calib <- function(data.target.calib, data.training.calib,
data.corrected.calib$snow.season <- matrix(rowMeans(snow.season.corrected.calib))
data.corrected.calib$data <- NULL
out$data.corrected.calib <- data.corrected.calib
data.target.valid$snow.season <- matrix(rowMeans(snow.season.target.valid))
data.target.valid$data <- NULL
out$data.target.valid <- data.target.valid
......@@ -682,6 +676,7 @@ plt.snow.season.length.calib <- function(data.target.calib, data.training.calib,
data.corrected.valid$snow.season <- matrix(rowMeans(snow.season.corrected.valid))
data.corrected.valid$data <- NULL
out$data.corrected.valid <- data.corrected.valid
return(out)
}
......@@ -712,20 +707,20 @@ plt.snow.season.maps <- function(snow.season.target.calib, snow.season.training.
par(mar=c(2,3,2,7), mgp=c(1.7,0.5,0),mfrow=c(2,2))
snow.season.training.calib$snow.season.rel <- (snow.season.training.calib$snow.season -
snow.season.target.calib$snow.season) /
snow.season.target.calib$snow.season) /
snow.season.target.calib$snow.season
snow.season.corrected.calib$snow.season.rel <- (snow.season.corrected.calib$snow.season -
snow.season.target.calib$snow.season) /
snow.season.target.calib$snow.season) /
snow.season.target.calib$snow.season
snow.season.training.calib$snow.season.rel[snow.season.training.calib$snow.season.rel>1]<-1
snow.season.corrected.calib$snow.season.rel[snow.season.corrected.calib$snow.season.rel>1]<-1
snow.season.training.valid$snow.season.rel <- (snow.season.training.valid$snow.season -
snow.season.target.valid$snow.season) /
snow.season.target.valid$snow.season
snow.season.target.valid$snow.season) /
snow.season.target.valid$snow.season
snow.season.corrected.valid$snow.season.rel <- (snow.season.corrected.valid$snow.season -
snow.season.target.valid$snow.season) /
snow.season.target.valid$snow.season
snow.season.target.valid$snow.season) /
snow.season.target.valid$snow.season
snow.season.training.valid$snow.season.rel[snow.season.training.valid$snow.season.rel>1]<-1
snow.season.corrected.valid$snow.season.rel[snow.season.corrected.valid$snow.season.rel>1]<-1
......
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