makeSubset: Reads an arbitrary data slice

View source: R/makeSubset.R

makeSubsetR Documentation

Reads an arbitrary data slice

Description

Reads an arbitrary data slice from a new GeoGrid that is a logical subset of the original GeoGrid.

Usage

makeSubset(grid, timePars, levelPars, latLon, memberPars)

Arguments

timePars

A list of time parameters as returnde by getTimeDomain.

levelPars

Vertical level parameters, as returned by getVerticalLevelPars. The element zRange is a ‘ucar.ma2.Range’ or a null reference.

latLon

A list of geospatial parameters, as returned by getLatLonDomain.

A

grid of the java class ‘ucar.nc2.dt.grid.GeoGrid’

Value

A n-dimensional array with the selected subset data.

Note

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”.

Author(s)

J. Bedia, with contributions of A. Cofiño and S. Herrera.

References

https://www.unidata.ucar.edu/software/thredds/v4.3/netcdf-java/v4.3/javadoc/ucar/nc2/dt/grid/GeoGrid.html


SantanderMetGroup/loadeR documentation built on July 4, 2023, 4:29 a.m.