Parichat Wetchayont
2011-Oct-22 15:42 UTC
[R] error on Fast bilinear interpolator from a grid
Dear all,
I'm new user of R package.
I'm trying to interpolate climate variables from ERA data.
Original data contains 6 column with 29,040 lines, and x, y dimension are
240x121.
I would like to get new data from column name: "lon", "lat"
and "temp" by x, y dimension are 3,586x1,800
So I used the code as below, but I got error message as "z[cbind(lx1 + 1,
ly1)] : out of range"
Help me please.
Thank you in advance.
=============================================================
library(fields)
d <- read.table("test.txt", dec=".", sep = "",
nrows = 29040, colClasses="numeric", col.names=c("lon",
"lat", "geo_h", "temp", "rh",
"hPa"))
vz=d$temp
z.temp <- matrix(vz, nrow=121, ncol=240, byrow=T)
obj <- list( x=seq( 0,358.5,,240), y=seq( -90,90,,121), z= z.temp[ 0:121,
0:240] )
grid.list<- list( x= seq( 0,358.5,,3586), y= seq( -90,90,,1800))
interp.surface.grid( obj, grid.list) -> look
=============================================================
Best Regards,
Parichat Wetchayont
----------------------------------------------------------------------------------
Radiation&Climate Physics Lab, Department of Geophysics,
Graduate School of Science, Tohoku University.
parichat@caos-a.geophys.tohoku.ac.jp
----------------------------------------------------------------------------------
[[alternative HTML version deleted]]
