ContinuumSubtraction — Subtracts the continuum from a spectrum.

This module defines the class for continuum subtraction from spectra.

class admit.util.continuumsubtraction.spectral.ContinuumSubtraction.ContinuumSubtraction[source]

Perform continuum subtraction on a spectrum. There are several algorithms to choose from, using the algorithm keyword. This class defines a consistent API for spectral continuum subtraction in ADMIT. Any continuum subtraction method can be added provided it is a class with the following:

  • init signature of (self, x, y), where x is the x axis as a numpy and y is the spectrum as a masked array
  • run method with the signature (self, **keyval), where keyval is a dictionary which contains all the arguments for the method as key value pairs, the run method should have the ability to ignore keywords that it does not know about.
  • the run method should return the continuum as a numpy array
Parameters:None (all parameters are passed to the run method)

Attributes

None  

Methods

run(id, spec, freq, segmentfinder, segargs, ...) Calculate the continuum using the given parameters.
run(id, spec, freq, segmentfinder, segargs, algorithm, **keyval)[source]

Calculate the continuum using the given parameters. The method is as follows:

locate regions of spectral emission mask out these regions pass the masked spectra to the given algorithm

Parameters:

id : int

Task id of the AT calling this method

spec : numpy array

The spectrum from which the continuum is determined

freq : numpy array

The frequency axis of the spectrum

segmentfinder : str

The segment finder to use (i.e. ADMIT, ASAP, etc.)

segargs : dict

Dictionary containing the arguments for the segmentfinder

algorithm : str

The continuum finding algorithm to use (i.e. SplineFit, SVD_Vander, etc.)

keyval : dict

Dictionary containing the arguments for the continuum finding algorithm