SpectralEstimate.h
Classes
- SpectralEstimate -- Get an initial estimate for spectral lines (full description)
Interface
- Public Members
- explicit SpectralEstimate(const uInt maxpar=MAXPAR)
- explicit SpectralEstimate(const Double rms, const Double cutoff=0.0, const Double minsigma=0.0, const uInt maxpar=MAXPAR)
- SpectralEstimate(const SpectralEstimate &other)
- ~SpectralEstimate()
- SpectralEstimate &operator=(const SpectralEstimate &other)
- template <class MT> const MT& estimate(const SpectralList<MT>& ordinate, SpectralList<MT> *der = 0)
- template <class MT> const MT& estimate(const SpectralList<MT>& abcissa, const SpectralList<MT>& ordinate)
- const SpectralList &list() const
- void setRMS(const Double rms=0.0)
- void setCutoff(const Double cutoff=0.0)
- void setMinSigma(const Double minsigma=0.0)
- void setQ(const uInt q=2)
- void setWindowing(const Bool win=False)
- void setMaxN(const uInt maxpar=MAXPAR)
- Private Members
- template <class MT> uInt window(const MT<MT> &prof)
- template <class MT> void findc2(const MT<MT> &prof)
- template <class MT> void findga(const MT<MT> &prof)
- template <class MT> MT convertElement (const SpectralElement<MT>& abcissa, const MT& el) const
Review Status
- Date Reviewed:
- yyyy/mm/dd
- Programs:
- Tests:
Prerequisite
Etymology
From spectral line and estimate
Synopsis
The SpectralEstimate class obtains an initial guess for spectral
components. The current implementation uses the entire
profile as signal region, or can set a window to be searched around
the highest peak automatically. A window can also be set manually.
The second derivative of
the profile in the signal region is calculated by fitting
a second degree polynomal. The smoothing parameter Q
determines the number of points used for this (=2*Q+1).
The gaussians can then be estimated as described by
Schwarz, 1968, Bull.Astr.Inst.Netherlands, Volume 19, 405.
The elements guessed can be used in the
SpectralFit class.
The default type found is a Gaussian, defined as:
AMPL.exp[ -(x-CENTER)<sup>2</sup>/2 SIGMA<sup>2</sup>]
The parameter estimates are returned in units of zero-based
pixel indices.
Example
Motivation
To have an automatic method to find spectral lines
To Do
- find a way to get to absorption lines as well
- add more estimation options
Member Description
explicit SpectralEstimate(const uInt maxpar=MAXPAR)
Default constructor creates a default estimator (default max number
of components to be found is 200) with the given maximum number
of components that will be found. A value of zero will indicate
an unlimited number.
explicit SpectralEstimate(const Double rms, const Double cutoff=0.0, const Double minsigma=0.0, const uInt maxpar=MAXPAR)
Create an estimator with the given maximum number of possible
elements. A value
Construct with a given rms in profiles, a cutoff for amplitudes
found, and a minimum width. Cutoff and minsigma default to 0.0, maximum
size of list produced to 200.
Copy constructor (deep copy)
Destructor
SpectralEstimate &operator=(const SpectralEstimate &other)
Assignment (copy semantics)
Generate the estimates for a profile and return the
list found. The first function returns component parameters
in units of pixel indices. The second function calls the first
and then converts to the specified abcissa space (the supplied
vector must be monotonic); if the pixel-based center is out of range
of the supplied abcissa vector the conversion is done via extrapolation.
The der pointer is meant for debugging, and can return
the derivative profile. The second function throw an AipsError
if the vectors are not the same length.
Return the list found.
void setRMS(const Double rms=0.0)
Set estimation parameters
Set the profile's estimated rms (forced to abs(rms))
void setCutoff(const Double cutoff=0.0)
Set estimation parameters
Set the amplitude cutoff for valid estimate (forced to max(0,cutoff))
void setMinSigma(const Double minsigma=0.0)
Set estimation parameters
Set the minimum width allowed (forced to max(0,minsigma))
void setQ(const uInt q=2)
Set estimation parameters
Set the number of points consider at each side of test point (i.e. a
width of 2q+1 is taken). Default internally is 2; max(1,q) taken.
void setWindowing(const Bool win=False)
Set estimation parameters
Do you want to look in an automatically determined window with signal?
Default is False, meaning the full profile.
void setMaxN(const uInt maxpar=MAXPAR)
Set estimation parameters
Set the maximum number of estimates to find (forced to >=1; 200 default)
template <class MT> uInt window(const MT<MT> &prof)
Get the window or the total spectrum
template <class MT> void findc2(const MT<MT> &prof)
Get the second derivatives
template <class MT> void findga(const MT<MT> &prof)
Find the Gaussians
Convert the parameters of the components in the list from
pixel-based indices to the given abcissa-vector space.