Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
jbedia committed Jun 29, 2015
2 parents 0da25a5 + 01740d5 commit 1e2bbf4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]> [ctb, cre]",
"Antonio Cofino <[email protected]> [ctb]",
Expand Down
7 changes: 3 additions & 4 deletions NEWS
Original file line number Diff line number Diff line change
@@ -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

8 changes: 5 additions & 3 deletions R/biasCorrection.R
Original file line number Diff line number Diff line change
Expand Up @@ -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}
#'
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion R/getTimeDomain.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion R/loadGridData.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 5 additions & 3 deletions man/biasCorrection.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand All @@ -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{
Expand Down

0 comments on commit 1e2bbf4

Please sign in to comment.