ReadWrite/
ncdf_getmask.pro
get the land/sea mask array from a NetCDF file
ncdf_getmask
Read NetCDF file
result = ncdf_getmask(fileid, ADDSCL_BEFORE=scalar: 0 or 1, MASKNAME=string, USEASMASK=scalar string, MISSING_VALUE=scalar, _EXTRA=_EXTRA)
Return value
the land/sea mask 2D or 3D array or -1 in case of error or mask absence
Parameters
fileid
in
required
type: salar string or long
if fileid is a scalar string then it is the name of the file (with
the full path) to be opened (in that case, the file will be opened
and closed within ncdf_getmask).
if fileid is a scalar then it is the id of the file return by a call
to ncdf_open outside of ncdf_getmask (in that case, the file will
NOT be opened and closed within ncdf_getmask)
Keywords
ADDSCL_BEFORE
type: scalar: 0 or 1
default: 0
put 1 to apply add_offset ad scale factor on data before looking for
missing values when using USEASMASK keyword
MASKNAME
type: string
A string giving the name of the variable in the file
that contains the land/sea mask
USEASMASK
type: scalar string
A string giving the name of the variable in the file
that will be used to build the land/sea mask. In this case the
mask is based on the first record (if record dimension
exists). The mask is build according to :
1 the keyword missing_value if existing
2 the attribute 'missing_value' if existing
3 NaN values if existing
MISSING_VALUE
type: scalar
To define (or redefine if the attribute is
already existing) the missing values used with USEASMASK
keyword
_EXTRA
to be able to call ncdf_getmask with _extra keyword
Examples
IDL> mask = ncdf_getmask('HadISST1_1m_187001_200702_sst_reg1m.nc',useasmask = 'sst', missing_value = -1.00000e+30)
IDL> mask = ncdf_getmask('meshmaskORCA2.nc', maskname = 'tmask')
Version history
Version
$Id: ncdf_getmask.pro 272 2007-08-30 12:51:26Z smasson $
History
August 2007: Sebastien Masson (smasson@lodyc.jussieu.fr)
Produced by IDLdoc 2.0.