bioniumx.preprocessing.mask_wavelength_regions

bioniumx.preprocessing.mask_wavelength_regions(spectrum: BioniumXObject, regions: list)[source]

Mask out specific wavelength regions from a spectrum.

Useful for removing known bad pixels, telluric bands, or instrument artifacts.

Parameters:
  • spectrum (BioniumXObject) – The input spectrum.

  • regions (list of tuples) – List of (min_wl, max_wl) tuples specifying regions to exclude.

Returns:

masked – A new spectrum object with the specified regions removed.

Return type:

BioniumXObject

Examples

>>> spec_clean = mask_wavelength_regions(spec, [(1.35, 1.45), (1.8, 1.95)])