makeSubset | R Documentation |
Reads an arbitrary data slice from a new GeoGrid that is a logical subset of the original GeoGrid.
makeSubset(grid, timePars, levelPars, latLon, memberPars)
grid |
A grid of the java class ‘ucar.nc2.dt.grid.GeoGrid’ |
timePars |
A list of time parameters as returnde by |
levelPars |
Vertical level parameters, as returned by |
latLon |
A list of geospatial parameters, as returned by
|
A n-dimensional array with the selected subset data.
The process is somewhat tricky because R cannot adequately represent NDjavaArrays. Several tests have shown that R (unlike MatLab) puts zeroes where they shouldn't be when using the ‘copyToNDjavaArray’ method. Hence, the data returned from ‘readDataSlice’ are converted to a 1D array (‘copyTo1DjavaArray’ method), and then put back in a n-dimensional R array. This is achieved by reversing the GeoGrid dimension ordering. In addition, the particular case of single-coordinate selections (either in X and/or in Y dimensions) must be adequately handled given that the ‘makeSubset’ output has in this case a different shape than the final output after “slicing”.
J. Bedia, with contributions of A. Cofiño and S. Herrera.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.