SourceXtractorPlusPlus 0.22
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
FlexibleModelFittingIterativeTask.h
Go to the documentation of this file.
1
17
18#ifndef _SEIMPLEMENTATION_PLUGIN_FLEXIBLEMODELFITTING_FLEXIBLEMODELFITTINGITERATIVETASK_H_
19#define _SEIMPLEMENTATION_PLUGIN_FLEXIBLEMODELFITTING_FLEXIBLEMODELFITTINGITERATIVETASK_H_
20
24
26
29
30//#include "SEImplementation/Configuration/SamplingConfig.h"
31
35
36namespace SourceXtractor {
37
39
40public:
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 void computeProperties(SourceGroupInterface& group) const override;
56
57private:
73
77
79 SourceGroupInterface& group, SourceInterface& source, int source_index,
81
82 void fitSource(SourceGroupInterface& group, SourceInterface& source, int index, FittingState& state) const;
83 void updateCheckImages(SourceGroupInterface& group, double pixel_scale, FittingState& state) const;
85 double pixel_scale, FlexibleModelFittingParameterManager& manager, int& total_data_points, FittingState& state) const;
87 std::shared_ptr<const Image<SeFloat>> model, std::shared_ptr<const Image<SeFloat>> weights, int& data_points) const;
89 ModelFitting::EngineParameterManager& engine_parameter_manager,
90 SourceInterface& source, int index, FittingState& state) const;
92 ModelFitting::ResidualEstimator& res_estimator, int& good_pixels,
93 SourceGroupInterface& group, SourceInterface& source, int index, FittingState& state, double downscaling) const;
95 SourceGroupInterface& group, SourceInterface& source, int index, FittingState& state) const;
97 SeFloat avg_reduced_chi_squared, SeFloat duration, unsigned int iterations, unsigned int stop_reason, Flags flags,
99 int index, FittingState& state) const;
100
101 // Task configuration
103 unsigned int m_max_iterations;
110
114};
115
116}
117
118#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
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
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
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)
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
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
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:44
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.