LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Histogram.h
Go to the documentation of this file.
1 #ifndef MeasAlgoShapeletHistogram_H
2 #define MeasAlgoShapeletHistogram_H
3 
4 #include <vector>
5 #include <iostream>
6 
7 namespace lsst {
8 namespace meas {
9 namespace algorithms {
10 namespace shapelet {
11 
12  template <typename T>
13  class Histogram {
14 
15  public:
16 
17  Histogram(double binSize, double minValue, double maxValue);
19 
20  void add(double value,const T& ref);
21  double findPeak(double minVal, double maxVal) const;
22  bool hasSinglePeak(double minVal, double maxVal) const;
23  double findValley(double minVal, double maxVal) const;
24  double findFirstValueAfter(double start) const;
25  double findFirstValleyAfter(double val1,bool hasPoissonNoise=false) const;
26  double findFirstValleyBefore(double val1,bool hasPoissonNoise=false) const;
27  double findFirstPeakAfter(double val1,bool hasPoissonNoise=false) const;
28  double findFirstPeakBefore(double val1,bool hasPoissonNoise=false) const;
29  int getTotalCountBefore(double val1) const;
30  int getTotalCountAfter(double val1) const;
31  int operator[](double value) const;
32  double findThresh(double minVal, double maxVal) const;
33  std::vector<T> getRefsInRange(double min, double max) const;
34  std::vector<double> getValuesInRange(double min, double max) const;
35  int getRefinedPeakCount(double* peak) const;
36  int getRefinedValleyCount(double* valley) const;
37  void print(std::ostream& fout,double val1=-1.e10,double val2=1.e10) const;
38 
39  private:
40 
41  int getCount(int i) const;
42  int index(double value) const;
43  double value(int i) const;
44 
46  std::vector<std::vector<T> > _refs;
47  std::vector<std::vector<double> > _values;
48  };
49 
50 }}}}
51 
52 #endif
int getRefinedPeakCount(double *peak) const
Definition: Histogram.cc:271
bool hasSinglePeak(double minVal, double maxVal) const
Definition: Histogram.cc:96
double findFirstPeakBefore(double val1, bool hasPoissonNoise=false) const
Definition: Histogram.cc:226
int getTotalCountBefore(double val1) const
Definition: Histogram.cc:250
double findFirstValleyAfter(double val1, bool hasPoissonNoise=false) const
Definition: Histogram.cc:140
std::vector< std::vector< double > > _values
Definition: Histogram.h:47
double findFirstValleyBefore(double val1, bool hasPoissonNoise=false) const
Definition: Histogram.cc:167
Histogram(double binSize, double minValue, double maxValue)
Definition: Histogram.cc:38
double findPeak(double minVal, double maxVal) const
Definition: Histogram.cc:76
double findFirstPeakAfter(double val1, bool hasPoissonNoise=false) const
Definition: Histogram.cc:204
std::vector< T > getRefsInRange(double min, double max) const
Definition: Histogram.cc:448
double findValley(double minVal, double maxVal) const
Definition: Histogram.cc:113
void print(std::ostream &fout, double val1=-1.e10, double val2=1.e10) const
Definition: Histogram.cc:517
double findFirstValueAfter(double start) const
Definition: Histogram.cc:194
int getTotalCountAfter(double val1) const
Definition: Histogram.cc:260
int getRefinedValleyCount(double *valley) const
Definition: Histogram.cc:302
std::vector< double > getValuesInRange(double min, double max) const
Definition: Histogram.cc:482
void add(double value, const T &ref)
Definition: Histogram.cc:61
double findThresh(double minVal, double maxVal) const
Definition: Histogram.cc:347
std::vector< std::vector< T > > _refs
Definition: Histogram.h:46