SourceXtractorPlusPlus  0.13
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
SourceXtractor::KappaSigmaBinning< VarType > Class Template Reference

#include <KappaSigmaBinning.h>

Inheritance diagram for SourceXtractor::KappaSigmaBinning< VarType >:
[legend]
Collaboration diagram for SourceXtractor::KappaSigmaBinning< VarType >:
[legend]

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
 
virtual VarType getEdge (size_t e) const =0
 
virtual VarType getBin (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

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.

Member Function Documentation

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

Definition at line 129 of file KappaSigmaBinning.h.

References SourceXtractor::KappaSigmaBinning< VarType >::m_kappa2, SourceXtractor::KappaSigmaBinning< VarType >::m_min_pixels, std::min(), and std::sqrt().

Referenced by SourceXtractor::KappaSigmaBinning< VarType >::computeBins().

Here is the call graph for this function:

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 SourceXtractor::KappaSigmaBinning< VarType >::computeBinCount(), SourceXtractor::KappaSigmaBinning< VarType >::Stats::get(), SourceXtractor::KappaSigmaBinning< VarType >::m_const, SourceXtractor::KappaSigmaBinning< VarType >::m_kappa, SourceXtractor::KappaSigmaBinning< VarType >::m_kappa2, Euclid::Histogram::BinStrategy< VarType >::m_nbins, SourceXtractor::KappaSigmaBinning< VarType >::m_scale, SourceXtractor::KappaSigmaBinning< VarType >::m_zero, SourceXtractor::KappaSigmaBinning< VarType >::Stats::reset(), and std::tie().

Here is the call graph for this function:

template<typename VarType>
VarType SourceXtractor::KappaSigmaBinning< VarType >::getBin ( size_t  i) const
inlinefinal
template<typename VarType>
ssize_t SourceXtractor::KappaSigmaBinning< VarType >::getBinIndex ( VarType  value) const
inlinefinalvirtual
template<typename VarType>
VarType SourceXtractor::KappaSigmaBinning< VarType >::getEdge ( size_t  e) const
inlinefinal

Member Data Documentation

template<typename VarType>
VarType SourceXtractor::KappaSigmaBinning< VarType >::m_const
private
template<typename VarType>
VarType SourceXtractor::KappaSigmaBinning< VarType >::m_kappa
private
template<typename VarType>
VarType SourceXtractor::KappaSigmaBinning< VarType >::m_kappa2
private
template<typename VarType>
size_t SourceXtractor::KappaSigmaBinning< VarType >::m_max_size
private

Definition at line 125 of file KappaSigmaBinning.h.

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

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