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


ssclib (ssclib-4.36.1) [xmmsas_20230412_1735-21.0.0]

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 -- 2023-04-16