SourceXtractorPlusPlus 1.0.3
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
30
34
36
37namespace SourceXtractor {
38
40
41public:
53
54 FlexibleModelFittingIterativeTask(const std::string &least_squares_engine,
55 unsigned int max_iterations, double modified_chi_squared_scale,
59 std::vector<bool> should_renormalize,
60 double scale_factor=1.0,
61 int meta_iterations=3,
62 double deblend_factor=1.0,
63 double meta_iteration_stop=0.0001,
64 size_t max_fit_size=100,
66 double ellipse_scale=3.0
67 );
68
70
71 void computeProperties(SourceGroupInterface& group) const override;
72
73private:
89
93
95 double m_x;
96 double m_y;
97 double m_a;
98 double m_b;
99 double m_theta;
100 };
101
102 PixelRectangle getFittingRect(SourceInterface& source, int frame_index) const;
104 SourceGroupInterface& group, SourceInterface& source, int source_index,
107 bool isFrameValid(SourceInterface& source, int frame_index) const;
109
110 void fitSource(SourceGroupInterface& group, SourceInterface& source, int index, FittingState& state) const;
111 void updateCheckImages(SourceGroupInterface& group, double pixel_scale, FittingState& state) const;
113 double pixel_scale, FlexibleModelFittingParameterManager& manager, int& total_data_points, FittingState& state) const;
115 std::shared_ptr<const Image<SeFloat>> model, std::shared_ptr<const Image<SeFloat>> weights, int& data_points) const;
117 ModelFitting::EngineParameterManager& engine_parameter_manager,
118 SourceInterface& source, int index, FittingState& state) const;
120 ModelFitting::ResidualEstimator& res_estimator, int& good_pixels,
121 SourceGroupInterface& group, SourceInterface& source, int index, FittingState& state, double downscaling) const;
123 SourceGroupInterface& group, SourceInterface& source, int index, FittingState& state) const;
125 SeFloat avg_reduced_chi_squared, SeFloat duration, unsigned int iterations, unsigned int stop_reason, Flags flags,
127 int index, FittingState& state) const;
131 FittingEllipse ellipse, SourceInterface& source, int frame_index) const;
132 PixelRectangle clipFittingRect(PixelRectangle fitting_rect, SourceInterface& source, int frame_index) const;
133 PixelRectangle getUnclippedFittingRect(SourceInterface& source, int frame_index) const;
134
137 std::shared_ptr<FlexibleModelFittingFrame> frame, PixelRectangle stamp_rect, double down_scaling=1.0) const;
138
139
140 // Task configuration
142 unsigned int m_max_iterations;
149
153
156 double m_ellipse_scale = 3.0;
157};
158
159}
160
161#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
PixelRectangle getUnclippedFittingRect(SourceInterface &source, int frame_index) const
std::shared_ptr< VectorImage< SeFloat > > createImageCopy(SourceInterface &source, int frame_index) const
std::vector< std::shared_ptr< FlexibleModelFittingFrame > > m_frames
PixelRectangle getFittingRect(SourceInterface &source, int frame_index) 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, std::vector< bool > should_renormalize, 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, WindowType window_type=WindowType::RECTANGLE, double ellipse_scale=3.0)
std::shared_ptr< VectorImage< SeFloat > > createDeblendImage(SourceGroupInterface &group, SourceInterface &source, int source_index, std::shared_ptr< FlexibleModelFittingFrame > frame, FittingState &state) const
FlexibleModelFittingIterativeTask::FittingEllipse transformEllipse(FittingEllipse ellipse, SourceInterface &source, int frame_index) const
int fitSourcePrepareModels(FlexibleModelFittingParameterManager &parameter_manager, ModelFitting::ResidualEstimator &res_estimator, int &good_pixels, SourceGroupInterface &group, SourceInterface &source, int index, FittingState &state, double downscaling) const
bool isFrameValid(SourceInterface &source, int frame_index) const
std::shared_ptr< VectorImage< SeFloat > > createWeightImage(SourceInterface &source, int frame_index) const
ModelFitting::FrameModel< DownSampledImagePsf, std::shared_ptr< VectorImage< SourceXtractor::SeFloat > > > createFrameModel(SourceInterface &source, double pixel_scale, FlexibleModelFittingParameterManager &manager, std::shared_ptr< FlexibleModelFittingFrame > frame, PixelRectangle stamp_rect, double down_scaling=1.0) 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
PixelRectangle clipFittingRect(PixelRectangle fitting_rect, SourceInterface &source, int frame_index) 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
FlexibleModelFittingIterativeTask::FittingEllipse getFittingEllipse(SourceInterface &source, int frame_index) 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.