mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
mx::improc::sourceFinder< _realT > Class Template Reference

template<typename _realT>
class mx::improc::sourceFinder< _realT >

Find stars in an image by SNR thresholding.

Definition at line 45 of file sourceFinder.hpp.

#include <improc/sourceFinder.hpp>

Public Types

typedef _realT realT
 The real valued type in which to do calculations. More...
 
typedef std::pair< int, int > pixelT
 Pixel coordinates. More...
 

Public Member Functions

 sourceFinder ()
 Default c'tor. More...
 
 sourceFinder (realT thresh, realT minsep)
 Constructor to set up the algorithm. More...
 
void clear ()
 Clear the working memory. More...
 
void treshold (const realT &thresh)
 Set the SNR threshold. More...
 
realT threshold ()
 Get the SNR threshold. More...
 
void minsep (const realT &msep)
 Set the minimum separation. More...
 
realT minsep ()
 Get the minimum separation between stars. More...
 
void useMedian (const bool &useMed)
 Set the useMedian flag. More...
 
bool useMedian ()
 Get the useMedian flag. More...
 
std::vector< pixelToperator() (const eigenImage< realT > &im)
 Find stars in an image. More...
 

Protected Attributes

realT m_threshold {5}
 The SNR threshold to use. More...
 
realT m_minsep {2}
 The minimum separation between stars. Closer SNR detections are treated as the same star. More...
 
bool m_useMedian {true}
 If true, then the median is used for standard deviation calculation. The mean is used otherwise. More...
 

Member Typedef Documentation

◆ pixelT

template<typename _realT >
typedef std::pair<int,int> mx::improc::sourceFinder< _realT >::pixelT

Pixel coordinates.

Definition at line 51 of file sourceFinder.hpp.

◆ realT

template<typename _realT >
typedef _realT mx::improc::sourceFinder< _realT >::realT

The real valued type in which to do calculations.

Definition at line 49 of file sourceFinder.hpp.

Constructor & Destructor Documentation

◆ sourceFinder() [1/2]

template<typename realT >
mx::improc::sourceFinder< realT >::sourceFinder

Default c'tor.

Definition at line 113 of file sourceFinder.hpp.

◆ sourceFinder() [2/2]

template<typename realT >
mx::improc::sourceFinder< realT >::sourceFinder ( realT  thresh,
realT  minsep 
)

Constructor to set up the algorithm.

Parameters
[in]thresh
[in]minsep

Definition at line 118 of file sourceFinder.hpp.

Member Function Documentation

◆ clear()

template<typename realT >
void mx::improc::sourceFinder< realT >::clear

Clear the working memory.

Definition at line 131 of file sourceFinder.hpp.

◆ minsep() [1/2]

template<typename realT >
realT mx::improc::sourceFinder< realT >::minsep

Get the minimum separation between stars.

Returns
the current value of m_minsep;

Definition at line 151 of file sourceFinder.hpp.

◆ minsep() [2/2]

template<typename realT >
void mx::improc::sourceFinder< realT >::minsep ( const realT msep)

Set the minimum separation.

Parameters
[in]msepthe new minimum separation

Definition at line 145 of file sourceFinder.hpp.

◆ operator()()

template<typename realT >
std::vector< typename sourceFinder< realT >::pixelT > mx::improc::sourceFinder< realT >::operator() ( const eigenImage< realT > &  im)

Find stars in an image.

Returns the coordinates as (row, col) of the highest SNR pixel in each unique star.

Returns
a vector of pixel coordinates
Parameters
[in]imthe image to search for stars

Definition at line 169 of file sourceFinder.hpp.

References mx::math::vectorMean(), mx::math::vectorMedian(), and mx::math::vectorVariance().

◆ threshold()

template<typename realT >
realT mx::improc::sourceFinder< realT >::threshold

Get the SNR threshold.

Returns
the current value of m_threshold;

Definition at line 139 of file sourceFinder.hpp.

◆ treshold()

template<typename realT >
void mx::improc::sourceFinder< realT >::treshold ( const realT thresh)

Set the SNR threshold.

Parameters
[in]threshthe new threshold

Definition at line 125 of file sourceFinder.hpp.

◆ useMedian() [1/2]

template<typename realT >
bool mx::improc::sourceFinder< realT >::useMedian

Get the useMedian flag.

Returns
the current value of m_useMedian;

Definition at line 163 of file sourceFinder.hpp.

◆ useMedian() [2/2]

template<typename realT >
void mx::improc::sourceFinder< realT >::useMedian ( const bool &  useMed)

Set the useMedian flag.

Parameters
[in]useMedthe new useMedian flag value

Definition at line 157 of file sourceFinder.hpp.

Member Data Documentation

◆ m_minsep

template<typename _realT >
realT mx::improc::sourceFinder< _realT >::m_minsep {2}
protected

The minimum separation between stars. Closer SNR detections are treated as the same star.

Definition at line 57 of file sourceFinder.hpp.

◆ m_threshold

template<typename _realT >
realT mx::improc::sourceFinder< _realT >::m_threshold {5}
protected

The SNR threshold to use.

Definition at line 55 of file sourceFinder.hpp.

◆ m_useMedian

template<typename _realT >
bool mx::improc::sourceFinder< _realT >::m_useMedian {true}
protected

If true, then the median is used for standard deviation calculation. The mean is used otherwise.

Definition at line 59 of file sourceFinder.hpp.


The documentation for this class was generated from the following file: