SourceXtractorPlusPlus  0.15
Please provide a description of the project.
CompactModelBase.h
Go to the documentation of this file.
1 /*
2  * CompactModelBase.h
3  *
4  * Created on: Aug 19, 2019
5  * Author: mschefer
6  */
7 
8 #ifndef _MODELFITTING_MODELS_COMPACTMODELBASE_H_
9 #define _MODELFITTING_MODELS_COMPACTMODELBASE_H_
10 
13 
14 #include "SEUtils/Mat22.h"
15 
16 namespace ModelFitting {
17 
18 using SExtractor::Mat22;
19 
20 template <typename ImageType>
21 class CompactModelBase : public ExtendedModel<ImageType> {
22 
23 public:
25  std::shared_ptr<BasicParameter> rotation, double width, double height,
28 
29  virtual ~CompactModelBase() = default;
30 
31 protected:
33 
34  template<typename ModelEvaluator>
35  float samplePixel(const ModelEvaluator& model_eval, int x, int y, unsigned int subsampling) const;
36 
37  template<typename ModelEvaluator>
38  float sampleStochastic(const ModelEvaluator& model_eval, int x, int y, unsigned int samples=100) const;
39 
40  template<typename ModelEvaluator>
41  float adaptiveSamplePixel(const ModelEvaluator& model_eval, int x, int y, unsigned int max_subsampling, float threshold=1.1) const;
42 
43  double getMaxRadiusSqr(std::size_t size_x, std::size_t size_y, const Mat22& transform) const;
44 
45  void renormalize(ImageType& image, double flux) const;
46 
47  // Jacobian transform
50 
51 private:
55 };
56 
57 }
58 
60 
61 
62 #endif /* _MODELFITTING_MODELS_COMPACTMODELBASE_H_ */
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
const double pixel_scale
Definition: TestImage.cpp:74
std::shared_ptr< BasicParameter > m_rotation
float samplePixel(const ModelEvaluator &model_eval, int x, int y, unsigned int subsampling) const
CompactModelBase(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)
void renormalize(ImageType &image, double flux) const
std::shared_ptr< BasicParameter > m_y_scale
double getMaxRadiusSqr(std::size_t size_x, std::size_t size_y, const Mat22 &transform) const
std::shared_ptr< BasicParameter > m_x_scale
Mat22 getCombinedTransform(double pixel_scale) const
virtual ~CompactModelBase()=default
float adaptiveSamplePixel(const ModelEvaluator &model_eval, int x, int y, unsigned int max_subsampling, float threshold=1.1) const
float sampleStochastic(const ModelEvaluator &model_eval, int x, int y, unsigned int samples=100) const
std::pair< double, double > transform(int x, int y, const std::array< double, 4 > &t)