SourceXtractorPlusPlus  0.10
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CompactExponentialModel.h
Go to the documentation of this file.
1 /*
2  * CompactExponentialModel.h
3  *
4  * Created on: Aug 19, 2019
5  * Author: mschefer
6  */
7 
8 #ifndef _MODELFITTING_MODELS_COMPACTEXPONENTIALMODEL_H_
9 #define _MODELFITTING_MODELS_COMPACTEXPONENTIALMODEL_H_
10 
12 
13 namespace ModelFitting {
14 
15 template <typename ImageType>
16 class CompactExponentialModel : public CompactModelBase<ImageType> {
17 
18 public:
19  CompactExponentialModel(double sharp_radius,
25 
26  virtual ~CompactExponentialModel() = default;
27 
28  double getValue(double x, double y) const override;
29  ImageType getRasterizedImage(double pixel_scale, std::size_t size_x, std::size_t size_y) const override;
30 
31 private:
36 
39  double i0, k;
40 
41  inline float evaluateModel(float x, float y) const {
42  float x2 = x * transform[0] + y * transform[1];
43  float y2 = x * transform[2] + y * transform[3];
44  float r = std::sqrt(x2*x2 + y2*y2);
45 
46  return float(i0) * std::exp(float(-k * r));
47  }
48  };
49 
51 
52  // Exponential parameters
55 };
56 
57 }
58 
60 
61 #endif /* _MODELFITTING_MODELS_COMPACTEXPONENTIALMODEL_H_ */
ImageType getRasterizedImage(double pixel_scale, std::size_t size_x, std::size_t size_y) const override
T exp(T...args)
std::shared_ptr< BasicParameter > m_k
std::shared_ptr< BasicParameter > m_i0
virtual ~CompactExponentialModel()=default
T sqrt(T...args)
CompactExponentialModel(double sharp_radius, std::shared_ptr< BasicParameter > i0, std::shared_ptr< BasicParameter > k, std::shared_ptr< BasicParameter > x_scale, std::shared_ptr< BasicParameter > y_scale, std::shared_ptr< BasicParameter > rotation, double width, double height, std::shared_ptr< BasicParameter > x, std::shared_ptr< BasicParameter > y, std::tuple< double, double, double, double > transform)
const double pixel_scale
Definition: TestImage.cpp:75
std::pair< double, double > transform(int x, int y, const std::array< double, 4 > &t)
double getValue(double x, double y) const override