MASK_LONLATTIME Name
MASK_LONLATTIME Purpose
This procedure returns a version of the input lon-lat-time data set Data
which has been interpolated to the grid of Mask and/or masked according to
Mask. Category
Geographical Calling Sequence
mask_lonlattime, Data, Mask
Inputs
Data: A array of data to be interpolated and/or masked. Of dimensions
N_LON*N_LAT*N_TIME. Missing data should be denoted by NaN. Returns
the interpolated and/or masked data array.
Mask: A masking array of dimensions N_LON_MASK*N_LAT_MASK or
N_LON_MASK*N_LAT_MASK*N_TIME. Values are 1 (keep) or NaN (discard).
LAT, LON, MASK_LAT, MASK_LON, FRAC_INTERPOLATE_THRESH
Keyword Parameters
FRAC_INTERPOLATE_THRESH: The threshold fraction of the area in a new
spatial cell with non-missing data in the old spatial cells being
interpolated required for the interpolation to be carried out (as
against being counted as missing data). The default is 0.
LAT: A vector of latitude values for Data. Of length N_LAT. Returns the
vector of latitude values for the returned interpolated Data, of
length N_LAT_OUT.
LON: A vector of longitude values for Data. Of length N_LON. Returns
the vector of longitude values for the returned interpolated Data, of
length N_LON_OUT.
MASK_LAT: A vector of the latitude coordinates for the mask. Of length
N_LAT_MASK. If not given then MASK_LAT is assumed to equal LAT.
MASK_LON: A vector of the longitude coordinates for the mask. Of length
N_LON_MASK. If not given then MASK_LON is assumed to equal LON.
TOTAL: If set then when interpolating to the MASK_LAT and/or MASK_LON
coordinates the area-weighted total of all values in the new grid
cells that are overlapping the area in the new grid cell is taken.
The default is to return the area-weighted average.
Outputs
Data: Returns the desired interpolated and/or masked data set. Of size
N_LON_OUT*N_LAT_OUT*N_TIME. If MEAN_LON is set then N_LON_OUT=1,
otherwise if MASK_LON is set then N_LON_OUT=N_LON_MASK, otherwise
N_LON_OUT=N_LON. If MEANLAT is set then N_LAT_OUT=1, otherwise if
MASK_LAT is set then N_LAT_OUT=N_LAT_MASK, otherwise N_LAT_OUT=N_LAT.
LAT, LON Uses
add_dim.pro Procedure
Example
Modification History
Written by: Daithi A. Stone (stoned@atm.ox.ac.uk), 2008-03-19, adapted
from mask_lonlatmonth.pro
Modified: DAS, 2009-10-21 (fixed bug with calculation of interpolated
weighting when original weightings are zero)
Modified: DAS, 2011-03-30 (allowed operation with slightly nonlinear
latitude vectors; modified formating)