excise_regions¶
- specutils.manipulation.excise_regions(spectrum, regions, exciser=<function true_exciser>, inclusive_upper=False)[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:
- spectrum
Spectrum1D
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 theexciser
method. Note that non-overlapping regions should be provided as separateSpectralRegion
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
- inclusive_upperbool, optional
Set to True to override the default pythonic slicing on the regions (inclusive lower bound, exclusive upper bound) to include the specified upper bound instead.
- spectrum
- Returns:
- spectrum
Spectrum1D
Output
Spectrum1D
which has the regions excised.
- spectrum
- Raises:
- ValueError
In the case that
spectrum
andregions
are not the correct types.