SourceXtractorPlusPlus  0.16
Please provide a description of the project.
FlexibleModelFittingIterativeTask.h
Go to the documentation of this file.
1 
18 #ifndef _SEIMPLEMENTATION_PLUGIN_FLEXIBLEMODELFITTING_FLEXIBLEMODELFITTINGITERATIVETASK_H_
19 #define _SEIMPLEMENTATION_PLUGIN_FLEXIBLEMODELFITTING_FLEXIBLEMODELFITTINGITERATIVETASK_H_
20 
24 
25 #include "SEUtils/PixelRectangle.h"
26 
29 
30 //#include "SEImplementation/Configuration/SamplingConfig.h"
31 
35 
36 namespace SourceXtractor {
37 
39 
40 public:
41  FlexibleModelFittingIterativeTask(const std::string &least_squares_engine,
42  unsigned int max_iterations, double modified_chi_squared_scale,
46  double scale_factor=1.0,
47  int meta_iterations=3,
48  double deblend_factor=1.0,
49  double meta_iteration_stop=0.0001,
50  size_t max_fit_size=100
51  );
52 
54 
55  virtual void computeProperties(SourceGroupInterface& group) const override;
56 
57 private:
58  struct SourceState {
64  float duration;
65  unsigned int iterations;
66  unsigned int stop_reason;
69  };
70 
71  struct FittingState {
73  };
74 
76  SourceGroupInterface& group, SourceInterface& source, int source_index,
78 
79  void fitSource(SourceGroupInterface& group, SourceInterface& source, int index, FittingState& state) const;
80  void setDummyProperty(SourceInterface& source, Flags flags) const;
81  void updateCheckImages(SourceGroupInterface& group, double pixel_scale, FittingState& state) const;
83  double pixel_scale, FlexibleModelFittingParameterManager& manager, int& total_data_points, FittingState& state) const;
85  std::shared_ptr<const Image<SeFloat>> model, std::shared_ptr<const Image<SeFloat>> weights, int& data_points) const;
87  ModelFitting::EngineParameterManager& engine_parameter_manager,
88  SourceInterface& source, int index, FittingState& state) const;
90  ModelFitting::ResidualEstimator& res_estimator, int& good_pixels,
91  SourceGroupInterface& group, SourceInterface& source, int index, FittingState& state, double downscaling) const;
93  SourceGroupInterface& group, SourceInterface& source, int index, FittingState& state) const;
95  SeFloat avg_reduced_chi_squared, SeFloat duration, unsigned int iterations, unsigned int stop_reason, Flags flags,
97  int index, FittingState& state) const;
98 
99  // Task configuration
101  unsigned int m_max_iterations;
108 
112 };
113 
114 }
115 
116 #endif /* _SEIMPLEMENTATION_PLUGIN_FLEXIBLEMODELFITTING_FLEXIBLEMODELFITTINGITERATIVETASK_H_ */
const double pixel_scale
Definition: TestImage.cpp:74
Class responsible for managing the parameters the least square engine minimizes.
Provides to the LeastSquareEngine the residual values.
void fitSourceUpdateState(FlexibleModelFittingParameterManager &parameter_manager, SourceInterface &source, SeFloat avg_reduced_chi_squared, SeFloat duration, unsigned int iterations, unsigned int stop_reason, Flags flags, ModelFitting::LeastSquareSummary solution, int index, FittingState &state) const
void fitSource(SourceGroupInterface &group, SourceInterface &source, int index, FittingState &state) const
int fitSourcePrepareParameters(FlexibleModelFittingParameterManager &parameter_manager, ModelFitting::EngineParameterManager &engine_parameter_manager, SourceInterface &source, int index, FittingState &state) const
virtual void computeProperties(SourceGroupInterface &group) const override
Computes one or more properties for the SourceGroup and/or the Sources it contains.
SeFloat fitSourceComputeChiSquared(FlexibleModelFittingParameterManager &parameter_manager, SourceGroupInterface &group, SourceInterface &source, int index, FittingState &state) const
std::vector< std::shared_ptr< FlexibleModelFittingFrame > > m_frames
FlexibleModelFittingIterativeTask(const std::string &least_squares_engine, unsigned int max_iterations, double modified_chi_squared_scale, std::vector< std::shared_ptr< FlexibleModelFittingParameter >> parameters, std::vector< std::shared_ptr< FlexibleModelFittingFrame >> frames, std::vector< std::shared_ptr< FlexibleModelFittingPrior >> priors, double scale_factor=1.0, int meta_iterations=3, double deblend_factor=1.0, double meta_iteration_stop=0.0001, size_t max_fit_size=100)
SeFloat computeChiSquaredForFrame(std::shared_ptr< const Image< SeFloat >> image, std::shared_ptr< const Image< SeFloat >> model, std::shared_ptr< const Image< SeFloat >> weights, int &data_points) const
std::shared_ptr< VectorImage< SeFloat > > createDeblendImage(SourceGroupInterface &group, SourceInterface &source, int source_index, std::shared_ptr< FlexibleModelFittingFrame > frame, FittingState &state) const
int fitSourcePrepareModels(FlexibleModelFittingParameterManager &parameter_manager, ModelFitting::ResidualEstimator &res_estimator, int &good_pixels, SourceGroupInterface &group, SourceInterface &source, int index, FittingState &state, double downscaling) const
void setDummyProperty(SourceInterface &source, Flags flags) const
std::vector< std::shared_ptr< FlexibleModelFittingParameter > > m_parameters
SeFloat computeChiSquared(SourceGroupInterface &group, SourceInterface &source, int index, double pixel_scale, FlexibleModelFittingParameterManager &manager, int &total_data_points, FittingState &state) const
void updateCheckImages(SourceGroupInterface &group, double pixel_scale, FittingState &state) const
std::vector< std::shared_ptr< FlexibleModelFittingPrior > > m_priors
A Task that acts on a SourceGroup to compute one or more properties.
Definition: GroupTask.h:36
Interface representing an image.
Definition: Image.h:43
Defines the interface used to group sources.
The SourceInterface is an abstract "source" that has properties attached to it.
Flags
Flagging of bad sources.
Definition: SourceFlags.h:37
SeFloat32 SeFloat
Definition: Types.h:32
Class containing the summary information of solving a least square minimization problem.