From 8e8f7e3cbb4a02dec1778f9ffe2c360fff52360b Mon Sep 17 00:00:00 2001 From: jbedia Date: Mon, 29 Jun 2015 13:44:08 +0200 Subject: [PATCH 1/4] Minor bug fix --- R/loadGridData.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/loadGridData.R b/R/loadGridData.R index b6bcf752..0890ea61 100644 --- a/R/loadGridData.R +++ b/R/loadGridData.R @@ -95,7 +95,7 @@ loadGridData <- function(dataset, var, dictionary = TRUE, lonLim = NULL, dic <- dictionaryLookup(dicPath, var, time) shortName <- dic$short_name } - if (min(season) < 1 | max(season) > 12) { + if (!is.null(season) & (min(season) < 1 | max(season) > 12)) { stop("Invalid season definition") } gds <- J("ucar.nc2.dt.grid.GridDataset")$open(dataset) From fb5eaf0b978c3f0b5a0c42f46614548418ee7791 Mon Sep 17 00:00:00 2001 From: jbedia Date: Mon, 29 Jun 2015 13:45:19 +0200 Subject: [PATCH 2/4] Bug fix Time index definition for annual seasons (1:12) was shifted one position ahead (R index instead of java index definition) --- R/getTimeDomain.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/getTimeDomain.R b/R/getTimeDomain.R index 7d04ffcf..1b134c45 100644 --- a/R/getTimeDomain.R +++ b/R/getTimeDomain.R @@ -107,7 +107,7 @@ getTimeDomain <- function(grid, dic, season, years, time, aggr.d, aggr.m) { } } else { dateSliceList <- lapply(unique(timeDates$year), function(x) timeDates[which(timeDates$year == x)]) - timeIndList <- lapply(unique(timeDates$year), function(x) timeInd[which(timeDates$year == x)]) + timeIndList <- lapply(unique(timeDates$year), function(x) timeInd[which(timeDates$year == x)] - 1) } } else { timeIndList[[1]] <- timeInd - 1 From f9d86489a0f069bdd38f55482e98a74b6f50daf6 Mon Sep 17 00:00:00 2001 From: jbedia Date: Mon, 29 Jun 2015 13:47:42 +0200 Subject: [PATCH 3/4] Minor doc update --- R/biasCorrection.R | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/R/biasCorrection.R b/R/biasCorrection.R index 7a2c3cfd..18e1cb14 100644 --- a/R/biasCorrection.R +++ b/R/biasCorrection.R @@ -26,12 +26,14 @@ #' #' This method consists on adding to the observations the mean change signal (delta method). #' This method is applicable to any kind of variable but it is preferable to avoid it for bounded variables -#' (e.g. precipitation, wind speed, etc.) because values out of the variable range could be obtained (e.g. negative wind speeds...). +#' (e.g. precipitation, wind speed, etc.) because values out of the variable range could be obtained +#' (e.g. negative wind speeds...). #' #' \strong{Unbiasing} #' #' This correction consists on adding to the simulation the mean diference between the observations -#' and the simulation in the train period. This method is preferably applicable to unbounded variables (e.g. temperature). +#' and the simulation in the train period. This method is preferably applicable to unbounded +#' variables (e.g. temperature). #' #' \strong{Scaling} #' @@ -54,7 +56,7 @@ #'\strong{Generalized Quantile Mapping (gqm)} #' #' This method is described in Gutjahr and Heinemann 2013. It is applicable only to precipitation and is similar to the Piani method. It applies a -#' gamma distribution to values under the threshold given by the 95th percentile (proosed by Yang et al. 2010) and a general Pareto +#' gamma distribution to values under the threshold given by the 95th percentile (following Yang et al. 2010) and a general Pareto #' distribution (GPD) to values above the threshold. #' #' @seealso \code{\link{isimip}} for a trend-preserving method of model calibration From 01740d5ebe30ed4e3b4939fecdf34107e12b7ab1 Mon Sep 17 00:00:00 2001 From: jbedia Date: Mon, 29 Jun 2015 13:58:30 +0200 Subject: [PATCH 4/4] Update DESCRIPTION,NEWS for patch release --- DESCRIPTION | 4 ++-- NEWS | 7 +++---- man/biasCorrection.Rd | 8 +++++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2e691ab1..a8a581ba 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -17,8 +17,8 @@ Suggests: ecomsUDG.Raccess, Type: Package Title: Climate data manipulation and statistical downscaling -Version: 0.8-0 -Date: 26-Jun-2015 +Version: 0.8-1 +Date: 29-Jun-2015 Authors@R: as.person(c( "Joaquin Bedia [ctb, cre]", "Antonio Cofino [ctb]", diff --git a/NEWS b/NEWS index 8dfadcb5..42d2b281 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,6 @@ -downscaleR 0.8-0 +downscaleR 0.8-1 ================ -* New Generalized Quantile Mapping method (Gutjahr and Heinemann 2013) -* New extrapolation feature of Quantile-quantile mapping method for unprecedent values in the simulation period -* Minor bug fixes and documentation improvements +* Bug fix in retrieval of annual seasons (Jan-Dec) +* Other minor bug fixes and documentation improvements diff --git a/man/biasCorrection.Rd b/man/biasCorrection.Rd index 9a91c5e1..16bbc8b3 100644 --- a/man/biasCorrection.Rd +++ b/man/biasCorrection.Rd @@ -49,12 +49,14 @@ Next we make a brief description of each method: This method consists on adding to the observations the mean change signal (delta method). This method is applicable to any kind of variable but it is preferable to avoid it for bounded variables - (e.g. precipitation, wind speed, etc.) because values out of the variable range could be obtained (e.g. negative wind speeds...). + (e.g. precipitation, wind speed, etc.) because values out of the variable range could be obtained + (e.g. negative wind speeds...). \strong{Unbiasing} This correction consists on adding to the simulation the mean diference between the observations -and the simulation in the train period. This method is preferably applicable to unbounded variables (e.g. temperature). +and the simulation in the train period. This method is preferably applicable to unbounded + variables (e.g. temperature). \strong{Scaling} @@ -77,7 +79,7 @@ This method is described in Piani et al. 2010 and is applicable only to precipit \strong{Generalized Quantile Mapping (gqm)} This method is described in Gutjahr and Heinemann 2013. It is applicable only to precipitation and is similar to the Piani method. It applies a -gamma distribution to values under the threshold given by the 95th percentile (proosed by Yang et al. 2010) and a general Pareto +gamma distribution to values under the threshold given by the 95th percentile (following Yang et al. 2010) and a general Pareto distribution (GPD) to values above the threshold. } \examples{