24 #ifndef LSST_MEAS_MODELFIT_DoubleShapeletPsfApprox_h_INCLUDED
25 #define LSST_MEAS_MODELFIT_DoubleShapeletPsfApprox_h_INCLUDED
27 #include "lsst/shapelet/FunctorKeys.h"
28 #include "lsst/meas/base/Algorithm.h"
29 #include "lsst/meas/base/InputUtilities.h"
32 namespace lsst {
namespace meas {
namespace modelfit {
46 LSST_CONTROL_FIELD(
innerOrder,
int,
"Shapelet order of inner expansion (0 == Gaussian)");
48 LSST_CONTROL_FIELD(
outerOrder,
int,
"Shapelet order of outer expansion (0 == Gaussian)");
50 LSST_CONTROL_FIELD(
radiusRatio,
double,
"Initial outer radius divided by inner radius");
54 "Initial outer Gaussian peak height divided by inner Gaussian peak height"
59 "Don't allow the semi-minor radius of any component to drop below this value (pixels)"
64 "Don't allow the determinant radii of the two components to differ by less than this (pixels)"
69 "Don't allow the semi-major radius of any component to go above this fraction of the PSF image width"
72 LSST_NESTED_CONTROL_FIELD(
74 "Configuration of the optimizer used by DoubleShapeletPsfsApproxAlgorithm::fitProfile()."
125 std::string
const &
name,
126 afw::table::Schema & schema
162 shapelet::MultiShapeletFunction & result,
164 afw::image::Image<Scalar>
const & psfImage
195 afw::geom::ellipses::Ellipse const & moments,
197 afw::image::Image<
Scalar> const & psfImage
218 shapelet::MultiShapeletFunction & result,
220 afw::image::Image<
Scalar> const & psfImage
238 shapelet::MultiShapeletFunction & result,
240 afw::image::Image<
Scalar> const & psfImage
249 afw::table::SourceRecord & measRecord,
250 afw::image::Exposure<
float> const & exposure
257 afw::table::SourceRecord & measRecord,
258 lsst::meas::base::MeasurementError * error=
nullptr
263 meas::base::SafeCentroidExtractor _centroidExtractor;
264 shapelet::MultiShapeletFunctionKey _key;
265 lsst::meas::base::FlagHandler _flagHandler;
270 #endif // !LSST_MEAS_MODELFIT_DoubleShapeletPsfApprox_h_INCLUDED
DoubleShapeletPsfApproxAlgorithm(Control const &ctrl, std::string const &name, afw::table::Schema &schema)
Failure modes passed by MeasurementErrors thrown by this class.
void measure(afw::table::SourceRecord &measRecord, afw::image::Exposure< float > const &exposure) const
Run all fitting stages on the Psf attached to the given Exposure, saving the results in measRecord...
OptimizerControl optimizer
"Configuration of the optimizer used by DoubleShapeletPsfsApproxAlgorithm::fitProfile()." ;
static base::FlagDefinition const INVALID_MOMENTS
Control object used to configure a 2-shapelet fit to a PSF model; see DoubleShapeletPsfApproxAlgorith...
static boost::shared_ptr< OptimizerObjective > makeObjective(afw::geom::ellipses::Ellipse const &moments, Control const &ctrl, afw::image::Image< Scalar > const &psfImage)
Return an Objective object that can be used to fit the profile of the model.
An algorithm that fits a 2-component shapelet approximation to the PSF model.
double Scalar
Typedefs to be used for probability and parameter values.
static base::FlagDefinition const FAILURE
static void fitMoments(shapelet::MultiShapeletFunction &result, Control const &ctrl, afw::image::Image< Scalar > const &psfImage)
Update a MultiShapeletFunction's ellipses to match the first and second moments of a PSF image...
double radiusRatio
"Initial outer radius divided by inner radius" ;
static void fitShapelets(shapelet::MultiShapeletFunction &result, Control const &ctrl, afw::image::Image< Scalar > const &psfImage)
Update a MultiShapeletFunction's higher-order shapelet terms, holding everything else fixed...
double minRadius
"Don't allow the semi-minor radius of any component to drop below this value (pixels)" ; ...
static shapelet::MultiShapeletFunction initializeResult(Control const &ctrl)
Create a MultiShapeletFunction with orders and radii and amplitude ratios from the control object...
DoubleShapeletPsfApproxControl Control
int innerOrder
"Shapelet order of inner expansion (0 == Gaussian)" ;
static base::FlagDefinitionList const & getFlagDefinitions()
Configuration object for Optimizer.
int outerOrder
"Shapelet order of outer expansion (0 == Gaussian)" ;
DoubleShapeletPsfApproxControl()
double minRadiusDiff
"Don't allow the determinant radii of the two components to differ by less than this (pixels)" ; ...
void fail(afw::table::SourceRecord &measRecord, lsst::meas::base::MeasurementError *error=nullptr) const
Handle failures caught by the measurement plugin system, setting failure flags as appropriate...
Base class for objective functions for Optimizer.
static void fitProfile(shapelet::MultiShapeletFunction &result, Control const &ctrl, afw::image::Image< Scalar > const &psfImage)
Update a MultiShapeletFunction's zeroth-order profile by fitting radii and amplitudes.
static base::FlagDefinition const INVALID_POINT_FOR_PSF
double maxRadiusBoxFraction
"Don't allow the semi-major radius of any component to go above this fraction of the PSF image width...
static base::FlagDefinition const MAX_ITERATIONS
double peakRatio
"Initial outer Gaussian peak height divided by inner Gaussian peak height" ;