24 #ifndef LSST_MEAS_MODELFIT_CModelFit_h_INCLUDED 25 #define LSST_MEAS_MODELFIT_CModelFit_h_INCLUDED 46 namespace lsst {
namespace meas {
namespace modelfit {
166 "Name of the shapelet.RadialProfile that defines the model to fit" 171 "One of 'FILE', 'LINEAR', 'EMPIRICAL', or 'NONE', indicating whether the prior should be loaded " 172 "from disk, created from one of the nested prior config/control objects, or None" 177 "Name of the Prior that defines the model to fit (a filename in $MEAS_MODELFIT_DIR/data, " 178 "with no extension), if priorSource='FILE'. Ignored for forced fitting." 183 "Configuration for a linear prior, used if priorSource='LINEAR'." 188 "Configuration for an empirical prior, used if priorSource='EMPIRICAL'." 196 "Maximum radius used in approximating profile with Gaussians (0=default for this profile)" 202 "Use per-pixel variances as weights in the nonlinear fit (the final linear fit for" 203 " flux never uses per-pixel variances)" 209 "Scale the likelihood by this factor to artificially reweight it w.r.t. the prior." 214 "Configuration for how the objective surface is explored. Ignored for forced fitting" 219 "Whether to record the steps the optimizer takes (or just the number, if running as a plugin)" 224 "Whether to record the time spent in this stage" 236 psfName(
"modelfit_DoubleShapeletPsfApprox"),
237 minInitialRadius(0.1),
238 fallbackInitialMomentsPsfFactor(1.5)
240 initial.nComponents = 3;
241 initial.optimizer.gradientThreshold = 1E-3;
242 initial.optimizer.minTrustRadiusThreshold = 1E-2;
243 initial.usePixelWeights =
true;
244 dev.profileName =
"luv";
246 exp.optimizer.maxOuterIterations = 250;
252 "Field name prefix of the Shapelet PSF approximation used to convolve the galaxy model; " 253 "must contain a set of fields matching the schema defined by shapelet.MultiShapeletFunctionKey." 258 "Configuration parameters related to the determination of the pixels to include in the fit." 263 "An initial fit (usually with a fast, approximate model) used to warm-start the exp and dev fits, " 264 "convolved with only the zeroth-order terms in the multi-shapelet PSF approximation." 269 "Independent fit of the exponential component" 274 "Independent fit of the de Vaucouleur component" 278 minInitialRadius,
double,
279 "Minimum initial radius in pixels (used to regularize initial moments-based PSF deconvolution)" 283 fallbackInitialMomentsPsfFactor,
double,
284 "If the 2nd-moments shape used to initialize the fit failed, use the PSF moments multiplied by this." 285 " If <= 0.0, abort the fit early instead." 323 ndarray::Array<Scalar const,1,1>
fixed;
340 REGION_MAX_BAD_PIXEL_FRACTION,
341 REGION_USED_FOOTPRINT_AREA,
343 REGION_USED_PSF_AREA,
346 REGION_USED_INITIAL_ELLIPSE_MIN,
348 REGION_USED_INITIAL_ELLIPSE_MAX,
409 Control
const & ctrl,
430 Control
const & ctrl,
488 Result
const & reference,
548 friend class CModelAlgorithmControl;
565 void _applyForcedImpl(
570 Result
const & reference,
575 template <
typename PixelT>
589 #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.