interp_conserve¶
- eazy.utils.interp_conserve(x, xp, fp, left=0.0, right=0.0)[source]¶
Interpolation analogous to
numpy.interpbut conserving “flux”.- Parameters:
- x
numpy.ndarray Desired interpolation locations
- xp, fp
numpy.ndarray The
xandycoordinates of the function to be interpolated. Thexarray can be irregularly spaced but should be increase monotonically.- left, rightfloat
Values to use for extrapolation below the minimum and maximum limits of
x.
- x
- Returns:
- ylike
x Interpolated values.
- Interpolation performed by trapezoidal integration between the midpoints
- of the output
xarray withnumpy.trapz.
Note
For a faster
cythonimplementation of this function, seegrizli.utils_c.interp_conserve_c.- ylike