excise_regions

specutils.manipulation.excise_regions(spectrum, regions, exciser=<function true_exciser>)[source]

Method to remove or replace the flux in the defined regions of the spectrum depending on the function provided in the exciser argument.

Parameters:
spectrumSpectrum1D

The Spectrum1D object to which the excision will be applied.

regionslist of SpectralRegion

Each element of the list is a SpectralRegion. The flux between the lower and upper spectral axis value of each region will be “cut out” and optionally replaced with interpolated values using the exciser method. Note that non-overlapping regions should be provided as separate SpectralRegion objects in this list, not as sub-regions in a single object in the list.

exciserfunction

Method that takes the spectrum and region and does the excising. Other methods could be defined and used by this routine. default: true_exciser

Returns:
spectrumSpectrum1D

Output Spectrum1D which has the regions excised.

Raises:
ValueError

In the case that spectrum and regions are not the correct types.