NCDF_VARGET1 procedure retrieves one element 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 value of the variable is returned. NCDF_VARGET1 sets
's size and data type as appropriate.
A vector containing the starting position of the read. The default starting position is [0, 0, ...].
Suppose that the file
contains an image saved with the netCDF variable name "dave". The following commands extract the value of a single pixel from the image:
offset = [180,190]
id = NCDF_OPEN('dave.nc')
varid = NCDF_VARID(id, 'dave')
NCDF_VARGET1, id, varid, single_pixel, OFFSET=offset