NCDF_VARGET procedure retrieves a
hyperslab of values from a netCDF
variable. The netCDF file must be in
mode to use this procedure.
Cdfid, Varid, Value
The netCDF ID, returned from a previous call to NCDF_OPEN or NCDF_CREATE.
The netCDF variable ID, returned from a previous call to NCDF_VARDEF or NCDF_VARID, or the name of the variable.
A named variable in which the values are returned. NCDF_VARGET sets
's size and data type as appropriate.
An optional vector containing the counts to be used in reading
. The default count vector is that for a single read, [1, 1, ...], as in NCDF_VARGET1.
An optional vector containing the starting position for the read. The default start position is [0, 0, ...].
An optional vector containing the strides, or sampling intervals, between accessed values of the netCDF variable. The default stride vector is that for a contiguous read, [1, 1, ...].
Suppose that a 230 by 230 image is saved in the netCDF file
. The following commands extract both the full image and a 70x70 sub-image starting at [80,20] sampling every other X pixel and every third Y pixel:
offset = [80, 20]
count = [70, 70]
stride = [2, 3]
id = NCDF_OPEN('dave.nc')
image = NCDF_VARID(id, 'image')
NCDF_VARGET, id, image, fullimage G
NCDF_VARGET, id, image, subimage, $
COUNT=count, STRIDE=stride, OFFSET=offset