interp_conserve¶
- eazy.utils.interp_conserve(x, xp, fp, left=0.0, right=0.0)[source]¶
Interpolation analogous to
numpy.interp
but conserving “flux”.- Parameters:
- x
numpy.ndarray
Desired interpolation locations
- xp, fp
numpy.ndarray
The
x
andy
coordinates of the function to be interpolated. Thex
array 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
x
array withnumpy.trapz
.
Note
For a faster
cython
implementation of this function, seegrizli.utils_c.interp_conserve_c
.- ylike