24#ifndef LSST_MEAS_MODELFIT_GeneralPsfFitter_h_INCLUDED
25#define LSST_MEAS_MODELFIT_GeneralPsfFitter_h_INCLUDED
41namespace lsst {
namespace meas {
namespace modelfit {
56 "shapelet order for this component; negative to disable this component completely"
60 "sigma (in pixels) in an isotropic 2-d Gaussian prior on the center of this shapelet component, "
61 "relative to the center of the PSF image"
65 "sigma in an isotropic 2-d Gaussian prior on the conformal-shear ellipticity eta"
69 "Sets the fiducial radius of this component relative to the 'primary radius' of the PSF: either "
70 "the second-moments radius of the PSF image (in an initial fit), or the radius of the primary "
71 "component in a previous fit. Ignored if the previous fit included this component (as then we "
72 "can just use that radius)."
76 "sigma in a Gaussian prior on ln(radius/fiducialRadius)"
98 "Innermost shapelet expansion, used to fit PSFs with very sharp cores"
103 "Primary shapelet expansion, typically used to fit the bulk of the PSF "
108 "Wing shapelet expansion (between primary and outer), typically used to fit the wings of the PSF"
113 "Outermost shapelet expansion, used to fit PSFs with very broad wings"
118 "Configuration of the optimizer used to do the fitting"
122 defaultNoiseSigma,
double,
"Default value for the noiseSigma parameter in GeneralPsfFitter.apply()"
219 int * pState =
nullptr
225 int * pState =
nullptr
249 int * pState =
nullptr
255 int * pState =
nullptr
319 ndarray::Array<Pixel const,2,1>
const &
image,
323 ndarray::Array<Scalar const,1,1>
const & fixed
327 ndarray::Array<Pixel,2,-1>
const & modelMatrix,
328 ndarray::Array<Scalar const,1,1>
const & nonlinear,
329 bool doApplyWeights=
true
afw::table::Key< double > sigma
An ellipse core with quadrupole moments as parameters.
A class to represent a 2-dimensional array of pixels.
Defines the fields and offsets for a table.
Record class that contains measurements made on a single exposure.
vector-type utility class to build a collection of FlagDefinitions
Utility class for handling flag fields that indicate the failure modes of an algorithm.
Exception to be thrown when a measurement algorithm experiences a known failure mode.
static base::FlagDefinition const EXCEPTION
GeneralPsfFitterControl Control
void fail(afw::table::SourceRecord &measRecord, lsst::meas::base::MeasurementError *error=nullptr) const
shapelet::MultiShapeletFunctionKey getKey()
void measure(afw::table::SourceRecord &measRecord, afw::image::Image< double > const &image, afw::geom::ellipses::Quadrupole const &moments) const
static base::FlagDefinition const MAX_INNER_ITERATIONS
void measure(afw::table::SourceRecord &measRecord, afw::image::Image< double > const &image, shapelet::MultiShapeletFunction const &initial) const
static base::FlagDefinitionList const & getFlagDefinitions()
GeneralPsfFitterAlgorithm(GeneralPsfFitterControl const &ctrl, afw::table::Schema &schema, std::string const &prefix)
static base::FlagDefinition const FAILURE
static base::FlagDefinition const MAX_OUTER_ITERATIONS
static base::FlagDefinition const CONTAINS_NAN
Control object used to define one piece of multishapelet fit to a PSF model; see GeneralPsfFitterCont...
double positionPriorSigma
"sigma (in pixels) in an isotropic 2-d Gaussian prior on the center of this shapelet component,...
GeneralPsfFitterComponentControl(int order_=0, double radiusFactor_=1.0)
double ellipticityPriorSigma
"sigma in an isotropic 2-d Gaussian prior on the conformal-shear ellipticity eta" ;
int order
"shapelet order for this component; negative to disable this component completely" ;
double radiusFactor
"Sets the fiducial radius of this component relative to the 'primary radius' of the PSF: either " "th...
double radiusPriorSigma
"sigma in a Gaussian prior on ln(radius/fiducialRadius)" ;
Control object used to configure a multishapelet fit to a PSF model; see GeneralPsfFitter.
GeneralPsfFitterComponentControl primary
"Primary shapelet expansion, typically used to fit the bulk of the PSF " ;
double defaultNoiseSigma
"Default value for the noiseSigma parameter in GeneralPsfFitter.apply()" ;
GeneralPsfFitterComponentControl inner
"Innermost shapelet expansion, used to fit PSFs with very sharp cores" ;
GeneralPsfFitterComponentControl wings
"Wing shapelet expansion (between primary and outer), typically used to fit the wings of the PSF" ;
OptimizerControl optimizer
"Configuration of the optimizer used to do the fitting" ;
GeneralPsfFitterComponentControl outer
"Outermost shapelet expansion, used to fit PSFs with very broad wings" ;
GeneralPsfFitterControl()
Class for fitting multishapelet models to PSF images.
shapelet::MultiShapeletFunctionKey addFields(afw::table::Schema &schema, std::string const &prefix) const
Add fields to a Schema that can be used to store the MultiShapeletFunction returned by apply().
shapelet::MultiShapeletFunction apply(afw::image::Image< double > const &image, shapelet::MultiShapeletFunction const &initial, Scalar noiseSigma=-1, int *pState=nullptr) const
GeneralPsfFitter(GeneralPsfFitterControl const &ctrl)
Initialize the fitter class with the given control object.
shapelet::MultiShapeletFunction apply(afw::image::Image< Pixel > const &image, shapelet::MultiShapeletFunction const &initial, Scalar noiseSigma=-1, int *pState=nullptr) const
Perform a fit to a PSF image, using a previous fit as a starting point.
std::shared_ptr< Prior > getPrior() const
Return the Prior object that corresponds to the configuration.
shapelet::MultiShapeletFunction apply(afw::image::Image< Pixel > const &image, afw::geom::ellipses::Quadrupole const &moments, Scalar noiseSigma=-1, int *pState=nullptr) const
Perform an initial fit to a PSF image.
shapelet::MultiShapeletFunction adapt(shapelet::MultiShapeletFunction const &previousFit, std::shared_ptr< Model > previousModel) const
Adapt a differently-configured previous fit to be used as an starting point for this GeneralPsfFitter...
shapelet::MultiShapeletFunction apply(afw::image::Image< double > const &image, afw::geom::ellipses::Quadrupole const &moments, Scalar noiseSigma=-1, int *pState=nullptr) const
std::shared_ptr< Model > getModel() const
Return the Model object that corresponds to the configuration.
Base class for optimizer/sampler likelihood functions that compute likelihood at a point.
Likelihood object used to fit multishapelet models to PSF model images; mostly for internal use by Ge...
void computeModelMatrix(ndarray::Array< Pixel, 2,-1 > const &modelMatrix, ndarray::Array< Scalar const, 1, 1 > const &nonlinear, bool doApplyWeights=true) const override
Evaluate the model for the given vector of nonlinear parameters.
MultiShapeletPsfLikelihood(ndarray::Array< Pixel const, 2, 1 > const &image, geom::Point2I const &xy0, std::shared_ptr< Model > model, Scalar sigma, ndarray::Array< Scalar const, 1, 1 > const &fixed)
virtual ~MultiShapeletPsfLikelihood()
Configuration object for Optimizer.
A multi-scale shapelet function.
Class that maps MultiShapeletFunction objects to fields in afw::table objects.
#define LSST_NESTED_CONTROL_FIELD(NAME, MODULE, TYPE, DOC)
A preprocessor macro used to define fields in C++ "control object" structs, for nested control object...
#define LSST_CONTROL_FIELD(NAME, TYPE, DOC)
A preprocessor macro used to define fields in C++ "control object" structs.
double Scalar
Typedefs to be used for probability and parameter values.
Simple class used to define and document flags The name and doc constitute the identity of the FlagDe...