Interpolation/
fromreg.pro
interpolate data from a "regular/rectangular grid" to any grid.
2 methods available: bilinear and imoms3
A "regular/rectangular grid" is defined as a grid for which each longitudes lines have
the same latitude and each latitudes columns have the same longitude.
fromreg
Interpolation
result = fromreg(method, datain[, lonin][, latin][, lonout], latout, WEIG=2d array, ADDR=2d array, NONORTHERNLINE=NONORTHERNLINE, NOSOUTHERNLINE=NOSOUTHERNLINE)
Return value
2D array the interpolated data
Parameters
method
in
required
type: string
a string defining the interpolation method.
must be 'bilinear' or 'imoms3'
datain
in
required
type: 2d array
a 2D array the input data to interpolate
lonin
in
optional
type: 1d or 2d array
1D or 2D array defining the longitude of the input data
latin
in
optional
type: 1d or 2d array
1D or 2D array defining the latitude of the input data
lonout
in
optional
type: 1d or 2d array
1D or 2D array defining the longitude of the output data
latout
in
required
type: 1d or 2d array
1D or 2D array defining the latitude of the output data
Keywords
WEIG
type: 2d array
(see ADDR)
ADDR
type: 2d array
2D arrays, weig and addr are the weight and addresses used to
perform the interpolation:
dataout = total(weig*datain[addr], 1)
dataout = reform(dataout, jpio, jpjo, /over)
Those keywords can be set to named variables (that are undefined or equal to 0) into which the
values will be copied when the current routine exits. Next, they can be used to perform
the interpolation without computing again those 2 parameters. In that
case, lonin, latin, lonout and latout are not necessary.
NONORTHERNLINE
activate if you don't want to take into account the northern line
of the input data when performing the interpolation.
NOSOUTHERNLINE
activate if you don't want to take into account the southern line
of the input data when performing the interpolation.
Examples
IDL> topa = fromreg('bilinear', tncep, xncep, yncep, glamt, gphit)
or
IDL> t1opa = fromreg('bilinear', t1ncep, xncep, yncep, glamt, gphit, WEIG = a, ADDR = b)
IDL> help, a, b
IDL> t2opa = fromreg('bilinear', t2ncep, xncep, WEIG = a, ADDR = b)
Version history
Version
$Id: fromreg.pro 163 2006-08-29 12:59:46Z navarro $
History
November 2005: Sebastien Masson (smasson@lodyc.jussieu.fr)
Known issues
Restrictions
We supposed the data are located on a sphere, with a periodicity along the
longitude.
Produced by IDLdoc 2.0 on Wed Sep 13 16:32:14 2006.