SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SourceXtractor::KappaSigmaBinning< VarType > Class Template Reference

#include <KappaSigmaBinning.h>

Inheritance diagram for SourceXtractor::KappaSigmaBinning< VarType >:
Collaboration diagram for SourceXtractor::KappaSigmaBinning< VarType >:

Classes

struct  Stats

Public Member Functions

 KappaSigmaBinning (float kappa1=2., float kappa2=5., size_t min_pixels=4, size_t max_size=4096)
template<typename Iterator>
void computeBins (Iterator begin, Iterator end)
ssize_t getBinIndex (VarType value) const final
VarType getEdge (size_t e) const final
VarType getBin (size_t i) const final
Public Member Functions inherited from Euclid::Histogram::BinStrategy< VarType >
 BinStrategy ()
virtual ~BinStrategy ()=default
size_t getBinCount () const
virtual std::vector< VarType > getEdges () const
virtual std::pair< VarType, VarType > getBinEdges (size_t i) const

Private Member Functions

size_t computeBinCount (size_t ndata) const

Private Attributes

VarType m_kappa
VarType m_kappa2
size_t m_min_pixels
size_t m_max_size
VarType m_scale
VarType m_zero
VarType m_const

Additional Inherited Members

Protected Attributes inherited from Euclid::Histogram::BinStrategy< VarType >
size_t m_nbins

Detailed Description

template<typename VarType>
class SourceXtractor::KappaSigmaBinning< VarType >

Functor that estimates the number of bins depending on the standard deviation of the data, applying two cuts to remain robuts to outliers.

On a first step, data that is outside \( \kappa_1 \sigma_{data} \pm \mu_{data} \) is filtered out, and the standard deviation and the mean of the remaining data points is re-computed.

The final histogram bins will cover the range \( \kappa_2 \sigma_{filtered} \pm \mu_{filtered} \). Anything outside will be dropped.

The number of bins is directly proportional to \( \kappa_2 \) and the number of data points, and limited to 4096 bins by default.

Definition at line 40 of file KappaSigmaBinning.h.

Constructor & Destructor Documentation

◆ KappaSigmaBinning()

template<typename VarType>
SourceXtractor::KappaSigmaBinning< VarType >::KappaSigmaBinning ( float kappa1 = 2.,
float kappa2 = 5.,
size_t min_pixels = 4,
size_t max_size = 4096 )
inline

Constructor

Parameters
kappa1Number of sigmas for the first data cut
kappa2Number of sigmas for the histogram limits
min_pixelsMinimum number of "mode pixels"
max_sizeMaximum number of bins

Definition at line 53 of file KappaSigmaBinning.h.

References m_const, m_kappa, m_kappa2, m_max_size, m_min_pixels, m_scale, and m_zero.

Member Function Documentation

◆ computeBinCount()

template<typename VarType>
size_t SourceXtractor::KappaSigmaBinning< VarType >::computeBinCount ( size_t ndata) const
inlineprivate

Definition at line 129 of file KappaSigmaBinning.h.

References m_kappa2, m_min_pixels, std::min(), and std::sqrt().

Referenced by computeBins().

Here is the call graph for this function:

◆ computeBins()

template<typename VarType>
template<typename Iterator>
void SourceXtractor::KappaSigmaBinning< VarType >::computeBins ( Iterator begin,
Iterator end )
inline

Get the list of bin edges for the given data points

Template Parameters
IteratorIterator type as passed to Histogram
Parameters
beginBeginning of the data
endEnd of the data
Returns
A vector with the bin edges

Definition at line 69 of file KappaSigmaBinning.h.

References std::begin(), computeBinCount(), std::end(), SourceXtractor::KappaSigmaBinning< VarType >::Stats::get(), m_const, m_kappa, m_kappa2, Euclid::Histogram::BinStrategy< VarType >::m_nbins, m_scale, m_zero, SourceXtractor::KappaSigmaBinning< VarType >::Stats::reset(), and std::tie().

Here is the call graph for this function:

◆ getBin()

template<typename VarType>
VarType SourceXtractor::KappaSigmaBinning< VarType >::getBin ( size_t i) const
inlinefinalvirtual

Reimplemented from Euclid::Histogram::BinStrategy< VarType >.

Definition at line 119 of file KappaSigmaBinning.h.

References m_scale, and m_zero.

◆ getBinIndex()

template<typename VarType>
ssize_t SourceXtractor::KappaSigmaBinning< VarType >::getBinIndex ( VarType value) const
inlinefinalvirtual

Implements Euclid::Histogram::BinStrategy< VarType >.

Definition at line 111 of file KappaSigmaBinning.h.

References m_const, and m_scale.

◆ getEdge()

template<typename VarType>
VarType SourceXtractor::KappaSigmaBinning< VarType >::getEdge ( size_t e) const
inlinefinalvirtual

Implements Euclid::Histogram::BinStrategy< VarType >.

Definition at line 115 of file KappaSigmaBinning.h.

References m_scale, and m_zero.

Member Data Documentation

◆ m_const

template<typename VarType>
VarType SourceXtractor::KappaSigmaBinning< VarType >::m_const
private

Definition at line 127 of file KappaSigmaBinning.h.

Referenced by computeBins(), getBinIndex(), and KappaSigmaBinning().

◆ m_kappa

template<typename VarType>
VarType SourceXtractor::KappaSigmaBinning< VarType >::m_kappa
private

Definition at line 124 of file KappaSigmaBinning.h.

Referenced by computeBins(), and KappaSigmaBinning().

◆ m_kappa2

template<typename VarType>
VarType SourceXtractor::KappaSigmaBinning< VarType >::m_kappa2
private

Definition at line 124 of file KappaSigmaBinning.h.

Referenced by computeBinCount(), computeBins(), and KappaSigmaBinning().

◆ m_max_size

template<typename VarType>
size_t SourceXtractor::KappaSigmaBinning< VarType >::m_max_size
private

Definition at line 125 of file KappaSigmaBinning.h.

Referenced by KappaSigmaBinning().

◆ m_min_pixels

template<typename VarType>
size_t SourceXtractor::KappaSigmaBinning< VarType >::m_min_pixels
private

Definition at line 125 of file KappaSigmaBinning.h.

Referenced by computeBinCount(), and KappaSigmaBinning().

◆ m_scale

template<typename VarType>
VarType SourceXtractor::KappaSigmaBinning< VarType >::m_scale
private

Definition at line 127 of file KappaSigmaBinning.h.

Referenced by computeBins(), getBin(), getBinIndex(), getEdge(), and KappaSigmaBinning().

◆ m_zero

template<typename VarType>
VarType SourceXtractor::KappaSigmaBinning< VarType >::m_zero
private

Definition at line 127 of file KappaSigmaBinning.h.

Referenced by computeBins(), getBin(), getEdge(), and KappaSigmaBinning().


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