Degrade Spectra

Methods for degrading high-resolution spectra to lower resolution.

coronagraph.degrade_spec.downbin_spec(specHR, lamHR, lamLR, dlam=None)

Re-bin spectum to lower resolution using scipy.binned_statistic with statistic = 'mean'. This is a “top-hat” convolution.

Parameters
  • specHR (array-like) – Spectrum to be degraded

  • lamHR (array-like) – High-res wavelength grid

  • lamLR (array-like) – Low-res wavelength grid

  • dlam (array-like, optional) – Low-res wavelength width grid

Returns

specLR – Low-res spectrum

Return type

numpy.ndarray

coronagraph.degrade_spec.downbin_spec_err(specHR, errHR, lamHR, lamLR, dlam=None)

Re-bin spectum and errors to lower resolution using scipy.binned_statistic. This function calculates the noise weighted mean of the points within a bin such that \(\sqrt{\sum_i \mathrm{SNR}_i}\) within each \(i\) bin is preserved.

Parameters
  • specHR (array-like) – Spectrum to be degraded

  • errHR (array-like) – One sigma errors of high-res spectrum

  • lamHR (array-like) – High-res wavelength grid

  • lamLR (array-like) – Low-res wavelength grid

  • dlam (array-like, optional) – Low-res wavelength width grid

Returns

  • specLR (numpy.ndarray) – Low-res spectrum

  • errLR (numpy.ndarray) – Low-res spectrum one sigma errors

coronagraph.degrade_spec.degrade_spec(specHR, lamHR, lamLR, dlam=None)

Degrade high-resolution spectrum to lower resolution (DEPRECIATED)

Warning

This method is known to return incorrect results at relatively high spectral resolution and has been depreciated within the coronagraph model. Please use downbin_spec() instead.

Parameters
  • specHR (array-like) – Spectrum to be degraded

  • lamHR (array-like) – High-res wavelength grid

  • lamLR (array-like) – Low-res wavelength grid

  • dlam (array-like, optional) – Low-res wavelength width grid

Returns

specLO – Low-res spectrum

Return type

numpy.ndarray