Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using packet 1 subscript out of bounds. I tried bias correction as your example, but it's result is different as your result. #89

Open
cherryniu opened this issue Jul 1, 2022 · 1 comment

Comments

@cherryniu
Copy link

Hi, everyone, these are the codes. The console didn't report any error, but, the plot showed : Error using packet 1 subscript out of bounds. At the same time, only VALUE.obs and CDX.hist were displayed, and CDX.raw and CDX.cal were not dispalyed. Who wold like to help me with this problem?
library(transformeR)
library(downscaleR)
library(visualizeR)
library(climate4R.datasets)
data(VALUE_Iberia_pr)
y <- VALUE_Iberia_pr
data("CORDEX_Iberia_pr")
x <- CORDEX_Iberia_pr
data("CORDEX_Iberia_pr.rcp85")
newdata <- CORDEX_Iberia_pr.rcp85
cal <- biasCorrection(y = y, x = x,
newdata = newdata,
precipitation = TRUE,
method = "eqm",
extrapolation = "constant",
window = c(30, 15),
wet.threshold = 0.1)

time series plotting for Igueldo station

VALUE.obs <- subsetGrid(y, station.id = "000234") # observation.
CDX.cal <- subsetGrid(cal, station.id = "000234") # CORDEX RCP8.5 corrected
CDX.hist <- interpGrid(x, getGrid(VALUE.obs)) # CORDEX historical
CDX.raw <- interpGrid(newdata, getGrid(VALUE.obs)) # CORDEX RCP8.5
temporalPlot(VALUE.obs, CDX.hist, CDX.cal, CDX.raw,
cols = c("black", "red", "green", "red"))

@durutti
Copy link

durutti commented Jul 30, 2022

In the bias correction step the Cordex (rotated grid) data are interpolated (nearest neighbor) on the Value_Iberia_pr grid in order bias correction to be performed.Try before extracting CDX.hist and CDX.rae to interpolate on the same grid (Value iberia) and then use substGrid with lonlim kai latlim to extract the station data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants