HECATE.spectral_normalization

Classes

norm_spec

Class to locally normalize spectra.

class norm_spec[source]

Bases: object

Class to locally normalize spectra.

Parameters:
  • phases (numpy array) – orbital phases of the spectra.

  • spectra (numpy array) – matrix with the systemic velocity corrected spectra (wavelenth, flux, flux error).

  • plot (bool) – whether to plot the spectra.

  • plot_masks (dict) – dictionary with the wavelength ranges to plot and their titles. If None, a default set of wavelength ranges is used.

cut_spectrum(spectra_global_norm, wave_min=6450, wave_max=6650)[source]

Cut the globally normalized spectra to a specific wavelength region to spare memory.

local_norm(spectra_region, mask_line=[(6530, 6590)], mask_poly=[(6538.8, 6545.8), (6546.9, 6551.4), (6575.6, 6579.8), (6581.4, 6586.05)], plot=True, line_name='Halpha')[source]

Normalize locally the spectra around the spectral line of interest by fitting a linear polynomial to the continuum.

__init__(phases: numpy.array, spectra: numpy.array, plot: bool = True, plot_masks: dict = None)[source]
cut_spectrum(spectra_global_norm: numpy.ndarray, wave_min: float = 6450, wave_max: float = 6650)[source]

Cut the globally normalized spectra to a specific wavelength region to spare memory.

Parameters:
  • spectra_global_norm (numpy array) – matrix with the globally normalized spectra (wavelength, flux, flux error).

  • wave_min (float) – minimum wavelength of the region.

  • wave_max (float) – maximum wavelength of the region.

Returns:

spectra_region – cut spectra (wavelength, flux, flux error).

Return type:

numpy array

local_norm(spectra_region: numpy.ndarray, mask_line: numpy.ndarray = [(6535, 6590)], mask_continuum: numpy.ndarray = [(6538.8, 6545.8), (6546.9, 6551.4), (6575.6, 6579.8), (6581.4, 6586.05)], plot: bool = True, line_name: str = 'H$\\alpha$')[source]

Normalize locally the spectra around the spectral line of interest by fitting a linear polynomial to the continuum.

Parameters:
  • spectra_region (numpy array) – matrix with the globally normalized and sliced spectra (wavelength, flux, flux error).

  • mask_line (list of tuples) – list of tuples with the wavelength ranges around the line for plot and memory saving purposes.

  • mask_poly (list of tuples) – list of tuples with the wavelength ranges of the continuum.

  • plot (bool) – whether to plot the normalization.

  • line_name (str) – spectral line(s) name for plot titles.

Returns:

  • spectra_local_norm (numpy array) – locally normalized spectra (wavelength, flux, flux error).

  • poly_coefs_array (numpy array) – polynomial coefficients used for the normalization of each spectrum.