sieving gridding
dhruv2207 opened this issue · 5 comments
I would like to know the possible way and command to sieve the grid, My data is 2.5 km 11 degree, and I would like to have finer grids.
I have the netCDF to read and sieve over the coordinate of lat 50.78222 and long 9.17. the Cordinate info is as follows, given below from the netcdf file, how to find the correct grids?
$ xyCoords:List of 4
..$ x : num [1:424] -28.4 -28.3 -28.2 -28 -27.9 ...
..$ y : num [1:412] -23.4 -23.3 -23.2 -23 -22.9 ...
..$ lon: num [1:412, 1:424] -10.1 -10.1 -10.2 -10.2 -10.3 ...
..$ lat: num [1:412, 1:424] 22 22.1 22.2 22.3 22.4 ...
..- attr(, "projection")= chr "RotatedPole"
..- attr(, "resX")= num 0.11
..- attr(, "resY")= num 0.11
..- attr(, "resLON")= logi NA
..- attr(*, "resLAT")= logi NA
interpGrid recognizes this type of grids (with rotated coordinates in $x and $y). Therefore you can use the function as always:
interpGrid(yourgrid, new.coordinates = list(x = 9.17, y = 50.78)
Thanks for the help. While i was using this command, i am getting this error. I tried to incorporate some measures given to clear memory but it's not working.
t2 <- interpGrid(tasmax, new.coordinates = list(x = 9.177, y = 48.782), method=c("nearest"))
NOTE: argument 'bilin.method' ignored for nearest neighbour interpolation
Error: cannot allocate vector of size 2.4 Gb
Here, tasmax has grid data from netcdf file
tasmax <- loadGridData(dataset = "C:/Users/Administrator/Desktop/Reading_NetCDF/tas..........p.nc", var = "tasmax")
gc() shows there is enough memory available but error is still there.
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 2445874 130.7 3886542 207.6 3427423 183.1
Vcells 322961407 2464.0 885780355 6758.0 1042526251 7953.9
Basically, I am select the grid to reduce size of my data, I need 4 grids ( approximately 11km) over my above mentioned coordinates (x=9.17 and y=50.78) by nearest neighbor and then save it to a csv file with 6 hours temporal resolution for further processing. Do you have a way out for this problem?
Hi. That's a huge task in terms of memory. You will probably need to split the work in smaller geographical subdomains (see subsetGrid
). These can be later joined if needed with bindGrid
. I hope this helps.