Hi R community

I need to interpolate precipitation data for a natural park. I have 
precipitation data from some climate stationts. (I know the table is not 
complete but I only need to show you X,Y, Altitude and PrepJul)


 
 
  X
  Y
  Altitude
  PrepJan
  PrepFeb
  PrepMar
  PrepAp

  PrepMay

  PrepJun

  PrepJul

 
 
  597706
  4093438
  41
  0
  9
  77,8
  63,1
  17,5
  0
  2,6
 
 
  597535
  4088967
  202
  0
  11,3
  67,9
  70,8
  12,1
  0
  0,6
 
 
  572307
  4064892
  41
  1
  9,5
  22
  40,5
  2,5
  0
  0
 
 
  571059
  4074743
  50
  2,4
  13,9
  31,3
  63,3
  8,1
  0
  1,4
 
 
  570795
  4091537
  356
  0
  15
  79
  86
  19,5
  1
  0
 
 
  554563
  4077703
  20
  5,2
  15,6
  43,4
  64,5
  15
  0,2
  0
 
 
  575091
  4089921
  183
  1,2
  13,2
  64,6
  70,6
  16,2
  0,2
  3,4
 


The area where this data must be interpolated in the natural park with an 
irregular shape inside of a grid of 2190 lines and 2282 columns with utm 
coordinates. I have tried "Krig" from "fields" package. A created a matrix with 
independant data (a) and a vector with dependant data (b).

a<-matrix(c(clima$X,clima$Y,clima$Altitud),,3)  
b<-clima$PrepJul
Interpolation<-Krig(a,b)
mapa<-predict.surface(interpolacion, nx=2190, ny=2282)

str(mapa)

 num [1:2190] 554563 554583 554602 554622 554642 ...
 $ y: num [1:2282] 4064892 4064905 4064917 4064930 4064942 ...
 $ z: num [1:2190, 1:2282] NA NA NA NA NA NA NA NA NA NA ...

NA values are due to the fact that outside of  the natural park there isn't 
precipitation registred. NA values are not a problem.


I write the result to ENVI with "write.ENVI" from "Catools" package. And the 
result is an image but data interpolated don't follow the natural park limits, 
the image of interpolated data don't macht the area of the natural park. And I 
don't know how to solve this. If anyone know any possible reason or any 
suggestion to do an interpolation, I would be really grateful.


Lucas

 

                                          
_________________________________________________________________


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to