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 neighbourgs
(weighted by their mask value).
extrapolate
Interpolation
result = extrapolate(zinput, maskinput[, nb_iteration], x_periodic=scalar, 0 or 1, MINVAL=scalar, MAXVAL=scalar, GE0=scalar 0 or 1)
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 scalar
default: 10.E20
Maximum number of iterations done in the extrapolation process. If there
is no more masked values we exit extrapolate before reaching nb_iteration
(to be sure to fill everything, you can use a very large value)
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.
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 242 2007-04-06 08:35:17Z pinsard $
History
Originaly written by G. Roulet
Sebastien Masson (smasson@lodyc.jussieu.fr)
Produced by IDLdoc 2.0.