XMM-Newton SAS Home Page
XMM-Newton Science Analysis System


ssclib (ssclib-4.28.1) [xmmsas_20141104_1833-14.0.0]

Array or vector scalar Array or vector scalar Trapezoid-rule, 1-D, numerical integral Home Index

Meta Index / Home Page / General-purpose array-processing utilities / Array or vector scalar

1-D interpolation

Given a set of piecewise-continuous line segments defined by set of $x$ values (these must be monotonically increasing) and a corresponding set of $y$ values, and given also a single $xSample$ value, this subroutine performs a linear interpolation to return the associated $ySample$ value. If $xSample$ is outside the range of $x$ values, or in other pathological cases, 0 is returned.

  function linearInterpolate(x, y, xSample) result(ySample)
    real(single), intent(in) :: x(:), y(size(x)), xSample
    real(single) :: ySample
  end function linearInterpolate



XMM-Newton SOC/SSC -- 2014-11-04