Interpolation/
extrapolate.pro
extrapolate data (zinput) where maskinput equal 0 by filling step by
step the coastline points with the mean value of the 8 neighbors
(weighted by their mask values).
extrapolate
Interpolation
result = extrapolate(zinput, maskinput[, nb_iteration], X_PERIODIC=scalar, 0 or 1, MINVAL=scalar, MAXVAL=scalar, GE0=scalar 0 or 1, _EXTRA=_EXTRA)
Return value
the extrapolated 2d array
Parameters
zinput
in
required
type: 2d array
data to be extrapolate
maskinput
in
required
type: 2d array or -1
a 2D array, the land-sea mask of the output data (1 on ocean, 0 on land)
put -1 if input data are not masked
nb_iteration
in
optional
type: integer
default: large enough to fill everything
Maximum number of iterations done in the extrapolation process. If there
is no more masked values we exit extrapolate before reaching nb_iteration
Keywords
X_PERIODIC
type: scalar, 0 or 1
default: 0
put 1 to specify that the data are periodic along x axis
MINVAL
type: scalar
default: not used
to specify a minimum value to the extrapolated values
MAXVAL
type: scalar
default: not used
to specify a maximum value to the extrapolated values
GE0
type: scalar 0 or 1
default: 0
put 1 to force the extrapolated values to be larger than 0, same as using minval=0.
_EXTRA
to be able to call extrapolate with _extra keyword
Examples
IDL> a=extrapolate(dist(jpi,jpj),tmask[*,*,0],/x_periodic)
IDL> tvplus, a
IDL> tvplus, a*(1-tmask[*,*,0])
get the coastline:
IDL> a=extrapolate(tmask[*,*,0],tmask[*,*,0],1,/x_periodic)
IDL> tvplus, a-tmask[*,*,0]
Version history
Version
$Id: extrapolate.pro 327 2007-12-13 16:22:35Z pinsard $
History
Originaly written by G. Roullet
Sebastien Masson (smasson@lodyc.jussieu.fr)
Produced by IDLdoc 2.0.