LSST Applications
21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
|
Abstract base class and concrete factories that define multi-shapelet galaxy models. More...
#include <Model.h>
Public Types | |
enum | CenterEnum { FIXED_CENTER = 0x0 , SINGLE_CENTER = 0x1 , MULTI_CENTER = 0x2 } |
typedef std::vector< std::string > | NameVector |
typedef std::vector< std::shared_ptr< shapelet::MultiShapeletBasis > > | BasisVector |
typedef std::vector< afw::geom::ellipses::Ellipse > | EllipseVector |
typedef std::vector< afw::geom::ellipses::Ellipse >::iterator | EllipseIterator |
typedef std::vector< afw::geom::ellipses::Ellipse >::const_iterator | EllipseConstIterator |
Public Member Functions | |
int | getNonlinearDim () const |
Return the number of free nonlinear parameters. More... | |
int | getAmplitudeDim () const |
Return the number of linear parameters. More... | |
int | getFixedDim () const |
Return the number of fixed nonlinear parameters. More... | |
int | getBasisCount () const |
Return the number of MultiShapeletBasis objects (equivalently, the number of ellipses) More... | |
NameVector const & | getNonlinearNames () const |
Return the names of the free nonlinear parameters. More... | |
NameVector const & | getAmplitudeNames () const |
Return the names of the amplitude parameters. More... | |
NameVector const & | getFixedNames () const |
Return the names of the fixed nonlinear parameters. More... | |
BasisVector const & | getBasisVector () const |
Return the MultiShapeletBasis objects that comprise the Model. More... | |
shapelet::MultiShapeletFunction | makeShapeletFunction (ndarray::Array< Scalar const, 1, 1 > const &nonlinear, ndarray::Array< Scalar const, 1, 1 > const &litudes, ndarray::Array< Scalar const, 1, 1 > const &fixed) const |
Create a MultiShapeletFunction object from a set of parameter vectors. More... | |
virtual std::shared_ptr< Prior > | adaptPrior (std::shared_ptr< Prior > prior) const =0 |
Given an arbitrary prior, return one compatible with this Model or throw LogicError. More... | |
virtual EllipseVector | makeEllipseVector () const =0 |
Return an uninitialized vector of afw::geom::ellipses::Ellipse with the parametrization expected by readEllipses() and writeEllipses(). More... | |
virtual void | writeEllipses (Scalar const *nonlinearIter, Scalar const *fixedIter, EllipseIterator ellipseIter) const =0 |
Convert a set of nonlinear+fixed parameter arrays to a vector of ellipses. More... | |
virtual void | readEllipses (EllipseConstIterator ellipseIter, Scalar *nonlinearIter, Scalar *fixedIter) const =0 |
Convert a vector of ellipses to a set of nonlinear+fixed parameter arrays. More... | |
EllipseVector | writeEllipses (ndarray::Array< Scalar const, 1, 1 > const &nonlinear, ndarray::Array< Scalar const, 1, 1 > const &fixed) const |
Convert a set of nonlinear+fixed parameter arrays to a vector of ellipses. More... | |
void | readEllipses (EllipseVector const &ellipses, ndarray::Array< Scalar, 1, 1 > const &nonlinear, ndarray::Array< Scalar, 1, 1 > const &fixed) const |
Convert a vector of ellipses to a set of nonlinear+fixed parameter arrays. More... | |
virtual void | transformParameters (LocalUnitTransform const &transform, ndarray::Array< Scalar, 1, 1 > const &nonlinear, ndarray::Array< Scalar, 1, 1 > const &litudes, ndarray::Array< Scalar, 1, 1 > const &fixed) const |
Transform (in-place) parameter vectors from one unit system to another. More... | |
virtual | ~Model () |
Model (const Model &)=delete | |
Model & | operator= (const Model &)=delete |
Model (Model &&)=delete | |
Model & | operator= (Model &&)=delete |
Static Public Member Functions | |
static std::shared_ptr< Model > | make (BasisVector basisVector, NameVector const &prefixes, CenterEnum center) |
Construct a concrete Model instance with multiple ellipses and multishapelet bases. More... | |
static std::shared_ptr< Model > | make (std::shared_ptr< shapelet::MultiShapeletBasis > basis, CenterEnum center) |
Construct a concrete Model instance with a single ellipse and multishapelet basis. More... | |
static std::shared_ptr< Model > | makeGaussian (CenterEnum center, double radius=1.0) |
Construct a concrete Model instance that represents a single elliptical Gaussian function. More... | |
Protected Member Functions | |
Model (BasisVector basisVector, NameVector nonlinearNames, NameVector amplitudeNames, NameVector fixedNames) | |
Abstract base class and concrete factories that define multi-shapelet galaxy models.
A Model provides a mapping from its parameters to ellipses and to a realization using shapelet objects. A Model does not "hold" its parameters; parameters are always stored in separate arrays.
Model parameters are split into three categories: nonlinear, amplitudes, and fixed. These are described more fully in Models, Interpreters, and Parameters.
A few private concrete subclasses of Model have been provided that will meet most needs; instances can be constructed via the make() and makeGaussian()
typedef std::vector<afw::geom::ellipses::Ellipse>::const_iterator lsst::meas::modelfit::Model::EllipseConstIterator |
typedef std::vector<afw::geom::ellipses::Ellipse>::iterator lsst::meas::modelfit::Model::EllipseIterator |
|
inlinevirtual |
|
delete |
|
delete |
|
protected |
|
pure virtual |
Given an arbitrary prior, return one compatible with this Model or throw LogicError.
Implemented in lsst::meas::modelfit::MultiModel.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |
Construct a concrete Model instance with multiple ellipses and multishapelet bases.
This can be used to construct a multi-component model (for instance, a bulge-disk decomposition), using MultiShapeletBasis objects such as those loaded by the lsst.shapelet.tractor module.
[in] | basisVector | A vector of MultiShapeletBasis objects, one for each component. Each component will have a separate set of ellipse parameters. |
[in] | prefixes | A vector of parameter name prefixes, one for each basis. These will be prepended to the names described in the documentation for the other overload of make(). |
[in] | center | An enum specifying whether the different components should have a fixed center (FIXED_CENTER), the same center (SINGLE_CENTER), or independent centers (MULTI_CENTER). |
|
static |
Construct a concrete Model instance with a single ellipse and multishapelet basis.
This can be used to construct a single-component model (e.g. a single fixed-index Sersic profile), or a linear combination model with only one ellipse.
[in] | basis | A MultiShapeletBasis object, of the sort provided by the lsst.shapelet.tractor module. |
[in] | center | An enum specifying whether the model should have a fixed center (FIXED_CENTER) or parametrized center (SINGLE_CENTER or MULTI_CENTER). |
The names of the nonlinear and fixed parameters will be ["eta1", "eta2", "logR", "x", "y"], with "x" and "y" in the fixed parameters if center==FIXED_CENTER. The amplitudes will be labeled "alphaN", where "N" is an integer starting from 0.
As implied by the parameter names, the ellipse is parametrized using afw::geom::ellipses::SeparableConformalShearLogTraceRadius. For the basis objects provided by lsst.shapelet.tractor, that generally means that logR=0 corresponds to the half-light radius.
|
pure virtual |
Return an uninitialized vector of afw::geom::ellipses::Ellipse with the parametrization expected by readEllipses() and writeEllipses().
Implemented in lsst::meas::modelfit::MultiModel.
|
static |
Construct a concrete Model instance that represents a single elliptical Gaussian function.
The Models returned by this method use the same ellipse parametrization and naming schemes as those returned by make().
[in] | center | An enum specifying whether the model should have a fixed center (FIXED_CENTER) or parametrized center (SINGLE_CENTER or MULTI_CENTER). |
[in] | radius | The radius at which logR=0, in units of the Gaussian sigma parameter (i.e. radius=1 corresponds to a model in which the radius parameter is ln(sigma)). |
shapelet::MultiShapeletFunction lsst::meas::modelfit::Model::makeShapeletFunction | ( | ndarray::Array< Scalar const, 1, 1 > const & | nonlinear, |
ndarray::Array< Scalar const, 1, 1 > const & | amplitudes, | ||
ndarray::Array< Scalar const, 1, 1 > const & | fixed | ||
) | const |
Create a MultiShapeletFunction object from a set of parameter vectors.
|
pure virtual |
Convert a vector of ellipses to a set of nonlinear+fixed parameter arrays.
[in] | ellipseIter | Iterator to the beginning of an ellipse vector, as returned by makeEllipseVector(). |
[out] | nonlinearIter | Pointer to the beginning of a nonlinear parameter array. |
[out] | fixedIter | Pointer to the beginning of a fixed parameter array. |
Implemented in lsst::meas::modelfit::MultiModel.
void lsst::meas::modelfit::Model::readEllipses | ( | EllipseVector const & | ellipses, |
ndarray::Array< Scalar, 1, 1 > const & | nonlinear, | ||
ndarray::Array< Scalar, 1, 1 > const & | fixed | ||
) | const |
Convert a vector of ellipses to a set of nonlinear+fixed parameter arrays.
[in] | ellipses | An ellipse vector, as returned by makeEllipseVector(). |
[out] | nonlinear | Output nonlinear parameter array. |
[out] | fixed | Output fixed parameter array. |
|
virtual |
Transform (in-place) parameter vectors from one unit system to another.
The default implementation transforms nonlinear and fixed parameters by converting them to ellipses, transforming the ellipses, and converting back to parameters. The amplitudes are simply multiplied by transform.flux. Subclasses for which this isn't appropriate should override.
EllipseVector lsst::meas::modelfit::Model::writeEllipses | ( | ndarray::Array< Scalar const, 1, 1 > const & | nonlinear, |
ndarray::Array< Scalar const, 1, 1 > const & | fixed | ||
) | const |
Convert a set of nonlinear+fixed parameter arrays to a vector of ellipses.
[in] | nonlinear | nonlinear parameter array. |
[in] | fixed | fixed parameter array. |
This is a convenient method that combines the call to makeEllipseVector() with a call to the other overload of writeEllipses(), for cases when there is no need to reuse an existing ellipse vector.
|
pure virtual |
Convert a set of nonlinear+fixed parameter arrays to a vector of ellipses.
[in] | nonlinearIter | Pointer to the beginning of a nonlinear parameter array. |
[in] | fixedIter | Pointer to the beginning of a fixed parameter array. |
[out] | ellipseIter | Iterator to the beginning of an ellipse vector, as returned by makeEllipseVector(). |
Implemented in lsst::meas::modelfit::MultiModel.