astra.contrib.ferre.continuum

Module Contents

Functions

median_filtered_correction(wavelength, normalised_observed_flux, normalised_observed_flux_err, normalised_model_flux, segment_indices=None, width=151, bad_minimum_flux=0.01, non_finite_err_value=10000000000.0, mode=’nearest’, **kwargs) Perform a median filter correction to the normalised observed spectrum, given some best-fitting normalised model flux.
astra.contrib.ferre.continuum.median_filtered_correction(wavelength, normalised_observed_flux, normalised_observed_flux_err, normalised_model_flux, segment_indices=None, width=151, bad_minimum_flux=0.01, non_finite_err_value=10000000000.0, mode='nearest', **kwargs)

Perform a median filter correction to the normalised observed spectrum, given some best-fitting normalised model flux.

Parameters:
  • wavelength – A 1-D array of wavelength values.
  • normalised_observed_flux – The pseudo-continuum normalised observed flux array. This should be the same format as wavelength.
  • normalised_observed_flux_err – The 1-sigma uncertainty in the pseudo-continuum normalised observed flux array. This should have the same format as wavelength.
  • normalised_model_flux – The best-fitting pseudo-continuum normalised model flux. This should have the same format as wavelength.
  • width – [optional] The width (int) for the median filter (default: 151).
  • bad_minimum_flux – [optional] The value at which to set pixels as bad and median filter over them. This should be a float, or None to set no low-flux filtering (default: 0.01).
  • non_finite_err_value – [optional] The error value to set for pixels with non-finite fluxes (default: 1e10).
  • mode – [optional] The mode to supply to scipy.ndimage.filters.median_filter (default: nearest).
Returns:

A two-length tuple of the pseudo-continuum segments, and the corrected pseudo-continuum-normalised observed flux errors.