Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(ncdf4)
- OSND_gpmr.df<-NULL
- GPM_R.files= list.files(path,pattern='*.nc4',full.names=TRUE)
- for(i in seq_along(GPM_R.files)) {
- nc_data = nc_open(GPM_R.files[i])
- GPM_Prec<-ncvar_get(nc_data, 'IRprecipitation')
- x=dim(GPM_Prec)
- ### note start=c(42,28) are the index in image regards to real coordinates of interset
- ## R reads images from lat,long.
- OSND_gpmr.spec =ncvar_get(nc_data, 'IRprecipitation', start = c(42,28), count = c(1,1))
- rbind(OSND_gpmr.df,data.frame(OSND_gpmr.spec))->OSND_gpmr.df
- nc_close(nc_data)
- }
Add Comment
Please, Sign In to add comment