PolyFit — Continuum subtraction using a polynomial fit.

Module for doing polynomial fitting to the continuum of a 1D spectrum.

class admit.util.continuumsubtraction.spectral.algorithms.PolyFit.PolyFit(x, y)[source]

Class which calculates the continuum of a 1D spectrum by fitting a polynomial to the continuum channels. The algorithm can be controlled by arguments to the run() method.

Parameters:

x : numpy array

An array containing the x coordinates.

y : masked array

A masked array containing the y coordinates with any strong emission masked.

Attributes

None  

Methods

run(\*\*keyval) Method to calculate the continuum from the given masked spectrum.
run(**keyval)[source]

Method to calculate the continuum from the given masked spectrum. If search=True is given as an argument then the algorithm will iterate through the different order splines to find the best fit, based on noise level.

Parameters:

keyval : dictionary

Dictionary containing the keyword value pair arguments

Returns:

numpy array containing the best fit continuum

Notes

Arguments for the run method:

  • search : bool, whether or not to search for the best fit. Default: False
  • deg : int, the degree of polynomial to use, Defualt: 1