resample_linear¶
Resample a spectrum onto a uniform wavelength grid by linear interpolation.
| Category | Resampling |
| Backend | numpy - implemented here on top of numpy primitives |
| Version | 1.0.1 |
| Reads | ctx.spectrum (a Spectrum1D) |
| Writes | spectrum |
Linear interpolation is fast and adequate when the target sampling is similar to the source. For large changes in resolution prefer a flux-conserving method.
Parameters¶
| Parameter | Default | Required | Description |
|---|---|---|---|
wavelength_min |
None |
- | Lower bound of the new grid (Å); null keeps the input minimum. |
wavelength_max |
None |
- | Upper bound of the new grid (Å); null keeps the input maximum. |
step |
None |
- | Constant sampling step (Å). Mutually exclusive with n_points. |
n_points |
None |
- | Number of samples in the new grid. Mutually exclusive with step. |
Use it¶
References¶
- numpy.interp — piecewise-linear interpolation
- For large resolution changes, prefer flux-conserving resampling (specutils.manipulation.FluxConservingResampler)
Related algorithms¶
resample_flux_conserving- Resample onto a new wavelength grid while preserving integrated flux.