Guest User

Untitled

a guest
Jan 19th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. library(ncdf4)
  2. OSND_gpmr.df<-NULL
  3.  
  4. GPM_R.files= list.files(path,pattern='*.nc4',full.names=TRUE)
  5.  
  6. for(i in seq_along(GPM_R.files)) {
  7. nc_data = nc_open(GPM_R.files[i])
  8.  
  9. GPM_Prec<-ncvar_get(nc_data, 'IRprecipitation')
  10.  
  11. x=dim(GPM_Prec)
  12.  
  13. ### note start=c(42,28) are the index in image regards to real coordinates of interset
  14. ## R reads images from lat,long.
  15. OSND_gpmr.spec =ncvar_get(nc_data, 'IRprecipitation', start = c(42,28), count = c(1,1))
  16. rbind(OSND_gpmr.df,data.frame(OSND_gpmr.spec))->OSND_gpmr.df
  17.  
  18. nc_close(nc_data)
  19. }
Add Comment
Please, Sign In to add comment