24 #ifndef LSST_MEAS_MODELFIT_CModelFit_h_INCLUDED 25 #define LSST_MEAS_MODELFIT_CModelFit_h_INCLUDED 42 namespace lsst {
namespace meas {
namespace modelfit {
162 "Name of the shapelet.RadialProfile that defines the model to fit" 167 "One of 'FILE', 'LINEAR', 'EMPIRICAL', or 'NONE', indicating whether the prior should be loaded " 168 "from disk, created from one of the nested prior config/control objects, or None" 173 "Name of the Prior that defines the model to fit (a filename in $MEAS_MODELFIT_DIR/data, " 174 "with no extension), if priorSource='FILE'. Ignored for forced fitting." 179 "Configuration for a linear prior, used if priorSource='LINEAR'." 184 "Configuration for an empirical prior, used if priorSource='EMPIRICAL'." 192 "Maximum radius used in approximating profile with Gaussians (0=default for this profile)" 198 "Use per-pixel variances as weights in the nonlinear fit (the final linear fit for" 199 " flux never uses per-pixel variances)" 205 "Scale the likelihood by this factor to artificially reweight it w.r.t. the prior." 210 "Configuration for how the objective surface is explored. Ignored for forced fitting" 215 "Whether to record the steps the optimizer takes (or just the number, if running as a plugin)" 220 "Whether to record the time spent in this stage" 232 psfName(
"modelfit_DoubleShapeletPsfApprox"),
233 minInitialRadius(0.1),
234 fallbackInitialMomentsPsfFactor(1.5)
236 initial.nComponents = 3;
237 initial.optimizer.gradientThreshold = 1E-2;
238 initial.optimizer.minTrustRadiusThreshold = 1E-2;
239 initial.usePixelWeights =
true;
240 dev.profileName =
"luv";
242 exp.optimizer.maxOuterIterations = 250;
248 "Field name prefix of the Shapelet PSF approximation used to convolve the galaxy model; " 249 "must contain a set of fields matching the schema defined by shapelet.MultiShapeletFunctionKey." 254 "Configuration parameters related to the determination of the pixels to include in the fit." 259 "An initial fit (usually with a fast, approximate model) used to warm-start the exp and dev fits, " 260 "convolved with only the zeroth-order terms in the multi-shapelet PSF approximation." 265 "Independent fit of the exponential component" 270 "Independent fit of the de Vaucouleur component" 274 minInitialRadius,
double,
275 "Minimum initial radius in pixels (used to regularize initial moments-based PSF deconvolution)" 279 fallbackInitialMomentsPsfFactor,
double,
280 "If the 2nd-moments shape used to initialize the fit failed, use the PSF moments multiplied by this." 281 " If <= 0.0, abort the fit early instead." 319 ndarray::Array<Scalar const,1,1>
fixed;
336 REGION_MAX_BAD_PIXEL_FRACTION,
337 REGION_USED_FOOTPRINT_AREA,
339 REGION_USED_PSF_AREA,
342 REGION_USED_INITIAL_ELLIPSE_MIN,
344 REGION_USED_INITIAL_ELLIPSE_MAX,
405 Control
const & ctrl,
426 Control
const & ctrl,
484 Result
const & reference,
544 friend class CModelAlgorithmControl;
561 void _applyForcedImpl(
566 Result
const & reference,
571 template <
typename PixelT>
585 #endif // !LSST_MEAS_MODELFIT_CModelFit_h_INCLUDED
shapelet::RadialProfile const & getProfile() const
LocalUnitTransform fitSysToMeasSys
Transforms to the coordinate system where parameters are defined.
boost::shared_ptr< OptimizerObjective > objfunc
Objective class used by the optimizer.
Control const & getControl() const
Return the control object the algorithm was constructed with.
Scalar objective
Value of the objective function at the best fit point: chisq/2 - ln(prior)
std::bitset< N_FLAGS > flags
Array of flags.
ndarray::Array< Scalar const, 1, 1 > amplitudes
Opaque linear parameters in specialized units.
afw::geom::ellipses::Quadrupole ellipse
Best fit half-light ellipse in pixel coordinates.
double Scalar
Typedefs to be used for probability and parameter values.
boost::shared_ptr< Model > model
Model object that defines the parametrization (defined fully by Control struct)
Scalar fluxInner
Flux measured strictly within the fit region (no extrapolation).
ndarray::Array< Scalar const, 1, 1 > nonlinear
Opaque nonlinear parameters in specialized units.
CModelResult Result
Typedef to the master Result struct.
#define LSST_CONTROL_FIELD(NAME, TYPE, DOC)
double weightsMultiplier
"Scale the likelihood by this factor to artificially reweight it w.r.t. the prior." ;
Scalar fluxSigma
Flux uncertainty from the final linear fit.
std::string profileName
"Name of the shapelet.RadialProfile that defines the model to fit" ;
bool doRecordTime
"Whether to record the time spent in this stage" ;
Nested control object for CModel that configures one of the three ("initial", "exp", "dev") nonlinear fitting stages.
CModelStageResult dev
Results from the de Vaucouleur (Sersic n=4) fit.
static RadialProfile & get(std::string const &name)
CModelStageResult initial
Results from the initial approximate nonlinear fit that feeds the others.
Abstract base class and concrete factories that define multi-shapelet galaxy models.
boost::shared_ptr< Prior > prior
Bayesian priors on the parameters (defined fully by Control struct)
std::string priorSource
"One of 'FILE', 'LINEAR', 'EMPIRICAL', or 'NONE', indicating whether the prior should be loaded " "fr...
Scalar fluxInner
Flux measured strictly within the fit region (no extrapolation).
Main public interface class for CModel algorithm.
std::bitset< N_FLAGS > flags
Array of flags.
Scalar fluxSigma
Flux uncertainty from just this stage fit.
std::string priorName
"Name of the Prior that defines the model to fit (a filename in $MEAS_MODELFIT_DIR/data, " "with no extension), if priorSource='FILE'. Ignored for forced fitting." ;
The main control object for CModel, containing parameters for the final linear fit and aggregating th...
afw::geom::ellipses::Quadrupole initialFitRegion
Pixels used in the initial fit.
afw::geom::ellipses::Quadrupole finalFitRegion
Pixels used in the exp, dev, and linear fits.
Scalar time
Time spent in this fit in seconds.
#define LSST_NESTED_CONTROL_FIELD(NAME, MODULE, TYPE, DOC)
int nComponents
"Number of Gaussian used to approximate the profile" ;
bool doRecordHistory
"Whether to record the steps the optimizer takes (or just the number, if running as a plugin)" ; ...
SoftenedLinearPriorControl linearPriorConfig
"Configuration for a linear prior, used if priorSource='LINEAR'." ;
Configuration object for Optimizer.
std::unique_ptr< SchemaItem< U > > result
Scalar fracDev
Fraction of flux from the final linear fit in the de Vaucouleur component (always between 0 and 1)...
Base class for Bayesian priors.
FlagBit
Flags that apply to all four CModel fits or just the last one.
boost::shared_ptr< UnitTransformedLikelihood > likelihood
Object used to evaluate models and compare to data.
SemiEmpiricalPriorControl empiricalPriorConfig
"Configuration for an empirical prior, used if priorSource='EMPIRICAL'." ;
CModelControl Control
Typedef to the master Control struct.
bool usePixelWeights
"Use per-pixel variances as weights in the nonlinear fit (the final linear fit for" " flux never uses...
int maxRadius
"Maximum radius used in approximating profile with Gaussians (0=default for this profile)" ; ...
Reference fit failed, so forced fit will fail as well.
Scalar flux
Flux from the final linear fit.
FlagBit
Flags for a single CModel stage (note that there are additional flags for the full multi-stage fit) ...
Base class for objective functions for Optimizer.
ndarray::Array< Scalar const, 1, 1 > fixed
Opaque fixed parameters in specialized units.
afw::table::BaseCatalog history
Trace of the optimizer's path, if enabled by diagnostic options.
Scalar flux
Flux measured from just this stage fit.
Master result object for CModel, containing results for the final linear fit and three nested CModelS...
boost::shared_ptr< Prior > getPrior() const
Result object for a single nonlinear fitting stage of the CModel algorithm.
OptimizerControl optimizer
"Configuration for how the objective surface is explored. Ignored for forced fitting" ; ...
boost::shared_ptr< Model > getModel() const
Input centroid did not land within the fit region.
CModelStageResult exp
Results from the exponential (Sersic n=1) fit.