24 #ifndef LSST_MEAS_MODELFIT_CModelFit_h_INCLUDED 25 #define LSST_MEAS_MODELFIT_CModelFit_h_INCLUDED 45 namespace lsst {
namespace meas {
namespace modelfit {
165 "Name of the shapelet.RadialProfile that defines the model to fit" 170 "One of 'FILE', 'LINEAR', 'EMPIRICAL', or 'NONE', indicating whether the prior should be loaded " 171 "from disk, created from one of the nested prior config/control objects, or None" 176 "Name of the Prior that defines the model to fit (a filename in $MEAS_MODELFIT_DIR/data, " 177 "with no extension), if priorSource='FILE'. Ignored for forced fitting." 182 "Configuration for a linear prior, used if priorSource='LINEAR'." 187 "Configuration for an empirical prior, used if priorSource='EMPIRICAL'." 195 "Maximum radius used in approximating profile with Gaussians (0=default for this profile)" 201 "Use per-pixel variances as weights in the nonlinear fit (the final linear fit for" 202 " flux never uses per-pixel variances)" 208 "Scale the likelihood by this factor to artificially reweight it w.r.t. the prior." 213 "Configuration for how the objective surface is explored. Ignored for forced fitting" 218 "Whether to record the steps the optimizer takes (or just the number, if running as a plugin)" 223 "Whether to record the time spent in this stage" 235 psfName(
"modelfit_DoubleShapeletPsfApprox"),
236 minInitialRadius(0.1),
237 fallbackInitialMomentsPsfFactor(1.5)
239 initial.nComponents = 3;
240 initial.optimizer.gradientThreshold = 1E-3;
241 initial.optimizer.minTrustRadiusThreshold = 1E-2;
242 initial.usePixelWeights =
true;
243 dev.profileName =
"luv";
245 exp.optimizer.maxOuterIterations = 250;
251 "Field name prefix of the Shapelet PSF approximation used to convolve the galaxy model; " 252 "must contain a set of fields matching the schema defined by shapelet.MultiShapeletFunctionKey." 257 "Configuration parameters related to the determination of the pixels to include in the fit." 262 "An initial fit (usually with a fast, approximate model) used to warm-start the exp and dev fits, " 263 "convolved with only the zeroth-order terms in the multi-shapelet PSF approximation." 268 "Independent fit of the exponential component" 273 "Independent fit of the de Vaucouleur component" 277 minInitialRadius,
double,
278 "Minimum initial radius in pixels (used to regularize initial moments-based PSF deconvolution)" 282 fallbackInitialMomentsPsfFactor,
double,
283 "If the 2nd-moments shape used to initialize the fit failed, use the PSF moments multiplied by this." 284 " If <= 0.0, abort the fit early instead." 322 ndarray::Array<Scalar const,1,1>
fixed;
339 REGION_MAX_BAD_PIXEL_FRACTION,
340 REGION_USED_FOOTPRINT_AREA,
342 REGION_USED_PSF_AREA,
345 REGION_USED_INITIAL_ELLIPSE_MIN,
347 REGION_USED_INITIAL_ELLIPSE_MAX,
408 Control
const & ctrl,
429 Control
const & ctrl,
487 Result
const & reference,
547 friend class CModelAlgorithmControl;
564 void _applyForcedImpl(
569 Result
const & reference,
574 template <
typename PixelT>
588 #endif // !LSST_MEAS_MODELFIT_CModelFit_h_INCLUDED
An ellipse core with quadrupole moments as parameters.
Defines the fields and offsets for a table.
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)
A mapping between the keys of two Schemas, used to copy data between them.
Scalar instFluxInner
Flux measured strictly within the fit region (no extrapolation).
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.
Scalar instFluxErr
Flux uncertainty from the final linear fit.
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)
ndarray::Array< Scalar const, 1, 1 > nonlinear
Opaque nonlinear parameters in specialized units.
CModelResult Result
Typedef to the master Result struct.
Exception to be thrown when a measurement algorithm experiences a known failure mode.
#define LSST_CONTROL_FIELD(NAME, TYPE, DOC)
A preprocessor macro used to define fields in C++ "control object" structs.
double weightsMultiplier
"Scale the likelihood by this factor to artificially reweight it w.r.t. the prior." ;
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)
Return a predefined radial profile given its name.
Registry and utility class for multi-Gaussian approximations to radial profiles.
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...
Main public interface class for CModel algorithm.
std::bitset< N_FLAGS > flags
Array of flags.
A base class for image defects.
A multi-scale shapelet function.
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...
Scalar instFluxInner
Flux measured strictly within the fit region (no extrapolation).
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 instFluxErr
Flux uncertainty from just this stage fit.
Scalar time
Time spent in this fit in seconds.
#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...
const char * source()
Source function that allows astChannel to source from a Stream.
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.
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'." ;
Scalar instFlux
Flux from the final linear fit.
Base class for all records.
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)" ; ...
def measure(mi, x, y, size, statistic, stats)
Reference fit failed, so forced fit will fail as well.
Record class that contains measurements made on a single exposure.
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.
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.
Scalar instFlux
Flux measured from just this stage fit.
CModelStageResult exp
Results from the exponential (Sersic n=1) fit.