webbpsf_ext.spectra.bin_spectrum
- webbpsf_ext.spectra.bin_spectrum(sp, wave, waveunits='um')[source]
Rebin spectrum
Rebin a synphot spectrum to a different wavelength grid. This function first converts the input spectrum to units of counts then combines the photon flux onto the specified wavelength grid.
Output spectrum units are the same as the input spectrum.
- Parameters:
sp (
s_ext.Spectrum) – Spectrum to rebin.wave (array_like) – Wavelength grid to rebin onto.
waveunits (str) – Units of wave input. Must be recognizeable by synphot.
- Returns:
s_ext.Spectrum– Rebinned spectrum in same units as input spectrum.