24 #ifndef LSST_MEAS_MODELFIT_SoftenedLinearPrior_h_INCLUDED
25 #define LSST_MEAS_MODELFIT_SoftenedLinearPrior_h_INCLUDED
27 #include "lsst/pex/config.h"
30 namespace lsst {
namespace meas {
namespace modelfit {
36 "Maximum ellipticity magnitude (conformal shear units)"
41 "Ellipticity magnitude (conformal shear units) at which the softened cutoff begins"
51 "ln(radius) at which the softened cutoff begins towards the minimum"
61 "ln(radius) at which the softened cutoff begins towards the maximum"
66 "The ratio P(logRadiusMinInner)/P(logRadiusMaxInner)"
90 ndarray::Array<Scalar const,1,1>
const & nonlinear,
91 ndarray::Array<Scalar const,1,1>
const & amplitudes
96 ndarray::Array<Scalar const,1,1>
const & nonlinear,
97 ndarray::Array<Scalar const,1,1>
const & amplitudes,
98 ndarray::Array<Scalar,1,1>
const & nonlinearGradient,
99 ndarray::Array<Scalar,1,1>
const & amplitudeGradient,
100 ndarray::Array<Scalar,2,1>
const & nonlinearHessian,
101 ndarray::Array<Scalar,2,1>
const & amplitudeHessian,
102 ndarray::Array<Scalar,2,1>
const & crossHessian
108 ndarray::Array<Scalar const,1,1>
const & nonlinear
114 ndarray::Array<Scalar const,1,1>
const & nonlinear,
115 ndarray::Array<Scalar,1,1>
const & amplitudes
121 ndarray::Array<Scalar const,1,1>
const & nonlinear,
122 afw::math::Random & rng,
123 ndarray::Array<Scalar,2,1>
const & amplitudes,
124 ndarray::Array<Scalar,1,1>
const & weights,
125 bool multiplyWeights=
false
132 Scalar _evaluate(ndarray::Array<Scalar const,1,1>
const & nonlinear)
const;
136 double _logRadiusSlope;
137 double _logRadiusMinRampFraction;
138 double _logRadiusMaxRampFraction;
139 double _ellipticityMaxRampFraction;
140 Eigen::Matrix<double,4,1,Eigen::DontAlign> _logRadiusPoly1;
141 Eigen::Matrix<double,4,1,Eigen::DontAlign> _logRadiusPoly2;
142 Eigen::Matrix<double,4,1,Eigen::DontAlign> _ellipticityPoly;
147 #endif // !LSST_MEAS_MODELFIT_SoftenedLinearPrior_h_INCLUDED
Scalar maximize(Vector const &gradient, Matrix const &hessian, ndarray::Array< Scalar const, 1, 1 > const &nonlinear, ndarray::Array< Scalar, 1, 1 > const &litudes) const override
Compute the amplitude vector that maximizes the prior x likelihood product.
A prior that's linear in radius and flat in ellipticity, with a cubic roll-off at the edges...
void evaluateDerivatives(ndarray::Array< Scalar const, 1, 1 > const &nonlinear, ndarray::Array< Scalar const, 1, 1 > const &litudes, ndarray::Array< Scalar, 1, 1 > const &nonlinearGradient, ndarray::Array< Scalar, 1, 1 > const &litudeGradient, ndarray::Array< Scalar, 2, 1 > const &nonlinearHessian, ndarray::Array< Scalar, 2, 1 > const &litudeHessian, ndarray::Array< Scalar, 2, 1 > const &crossHessian) const override
Evaluate the derivatives of the prior at the given point in nonlinear and amplitude space...
void drawAmplitudes(Vector const &gradient, Matrix const &fisher, ndarray::Array< Scalar const, 1, 1 > const &nonlinear, afw::math::Random &rng, ndarray::Array< Scalar, 2, 1 > const &litudes, ndarray::Array< Scalar, 1, 1 > const &weights, bool multiplyWeights=false) const override
Draw a set of Monte Carlo amplitude vectors.
Scalar evaluate(ndarray::Array< Scalar const, 1, 1 > const &nonlinear, ndarray::Array< Scalar const, 1, 1 > const &litudes) const override
Evaluate the prior at the given point in nonlinear and amplitude space.
double Scalar
Typedefs to be used for probability and parameter values.
double logRadiusMinInner
"ln(radius) at which the softened cutoff begins towards the minimum" ;
SoftenedLinearPrior(Control const &ctrl=Control())
double ellipticityMaxOuter
"Maximum ellipticity magnitude (conformal shear units)" ;
SoftenedLinearPriorControl Control
Control const & getControl() const
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > Matrix
Typedefs to be used for probability and parameter values.
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Typedefs to be used for probability and parameter values.
Base class for Bayesian priors.
SoftenedLinearPriorControl()
double logRadiusMaxInner
"ln(radius) at which the softened cutoff begins towards the maximum" ;
Scalar marginalize(Vector const &gradient, Matrix const &hessian, ndarray::Array< Scalar const, 1, 1 > const &nonlinear) const override
Return the -log amplitude integral of the prior*likelihood product.
double logRadiusMaxOuter
"Maximum ln(radius)" ;
double ellipticityMaxInner
"Ellipticity magnitude (conformal shear units) at which the softened cutoff begins" ; ...
double logRadiusMinOuter
"Minimum ln(radius)" ;
double logRadiusMinMaxRatio
"The ratio P(logRadiusMinInner)/P(logRadiusMaxInner)" ;