>  Docs Center  >  Libraries  >  ASTROLIB  >  QUADTERP






      Quadratic interpolation of X,Y vectors onto a new X grid


      Interpolate a function Y = f(X) at specified grid points using an
      average of two neighboring 3 point quadratic (Lagrangian) interpolants.
      Use LINTERP for linear interpolation

Calling Sequence

      QUADTERP, Xtab, Ytab, Xint, Yint, [ MISSING = ]


      Xtab - Vector (X TABle) containing the current independent variable
              Must be either monotonic increasing or decreasing
      Ytab - Vector (Y TABle) containing the dependent variable defined
              at each of the points of XTAB.
      Xint - Scalar or vector giving the values of X for which interpolated
              Y values are sought


      Yint - Interpolated value(s) of Y, same number of points as Xint

Optional Input Keyword

      MISSING - Scalar specifying Yint value(s) to be assigned, when Xint
              value(s) are outside of the range of Xtab. Default is to
              truncate the out of range Yint value(s) to the nearest value
              of Ytab. See the help for the INTERPOLATE function.


      3-point Lagrangian interpolation. The average of the two quadratics
      derived from the four nearest points is returned in YTAB. A single
      quadratic is used near the end points. VALUE_LOCATE is used
      to locate center point of the interpolation.


      QUADTERP provides one method of high-order interpolation. The
          RSI interpol.pro function includes the following alternatives:
      interpol(/LSQUADRATIC) - least squares quadratic fit to a 4 pt
      interpol(/QUADRATIC) - quadratic fit to a 3 pt neighborhood
      interpol(/SPLINE) - cubic spline fit to a 4 pt neighborhood
      Also, the IDL Astro function HERMITE fits a cubic polynomial and its
            derivative to the two nearest points.


      Unless MISSING keyword is set, points outside the range of Xtab in
      which valid quadratics can be computed are returned at the value
      of the nearest end point of Ytab (i.e. Ytab[0] and Ytab[NPTS-1] ).


      A spectrum has been defined using a wavelength vector WAVE and a
      flux vector FLUX. Interpolate onto a new wavelength grid, e.g.
      IDL> wgrid = [1540.,1541.,1542.,1543.,1544.,1545.]
      IDL> quadterp, wave, flux, wgrid, fgrid
      FGRID will be a 5 element vector containing the quadratically
      interpolated values of FLUX at the wavelengths given in WGRID.

Revision History

      31 October 1986 by B. Boothman, adapted from the IUE RDAF
      12 December 1988 J. Murthy, corrected error in Xint
      September 1992, W. Landsman, fixed problem with double precision
      August 1993, W. Landsman, added MISSING keyword
      June, 1995, W. Landsman, use single quadratic near end points
      Converted to IDL V5.0 W. Landsman September 1997
      Fix occasional problem with integer X table,
      YINT is a scalar if XINT is a scalar W. Landsman Dec 1999
      Use VALUE_LOCATE instead of TABINV W. Landsman Feb. 2000

© 2019 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us