LSST Applications g0265f82a02+d6b5cd48b5,g02d81e74bb+a41d3748ce,g1470d8bcf6+6be6c9203b,g2079a07aa2+14824f138e,g212a7c68fe+a4f2ea4efa,g2305ad1205+72971fe858,g295015adf3+ab2c85acae,g2bbee38e9b+d6b5cd48b5,g337abbeb29+d6b5cd48b5,g3ddfee87b4+31b3a28dff,g487adcacf7+082e807817,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+b2918d57ae,g5a732f18d5+66d966b544,g64a986408d+a41d3748ce,g858d7b2824+a41d3748ce,g8a8a8dda67+a6fc98d2e7,g99cad8db69+7fe4acdf18,g9ddcbc5298+d4bad12328,ga1e77700b3+246acaaf9c,ga8c6da7877+84af8b3ff8,gb0e22166c9+3863383f4c,gb6a65358fc+d6b5cd48b5,gba4ed39666+9664299f35,gbb8dafda3b+d8d527deb2,gc07e1c2157+b2dbe6b631,gc120e1dc64+61440b2abb,gc28159a63d+d6b5cd48b5,gcf0d15dbbd+31b3a28dff,gdaeeff99f8+a38ce5ea23,ge6526c86ff+39927bb362,ge79ae78c31+d6b5cd48b5,gee10cc3b42+a6fc98d2e7,gf1cff7945b+a41d3748ce,v24.1.5.rc1
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
lsst::meas::modelfit::Model Class Referenceabstract

Abstract base class and concrete factories that define multi-shapelet galaxy models. More...

#include <Model.h>

Inheritance diagram for lsst::meas::modelfit::Model:
lsst::meas::modelfit::MultiModel

Public Types

enum  CenterEnum { FIXED_CENTER = 0x0 , SINGLE_CENTER = 0x1 , MULTI_CENTER = 0x2 }
 
typedef std::vector< std::stringNameVector
 
typedef std::vector< std::shared_ptr< shapelet::MultiShapeletBasis > > BasisVector
 
typedef std::vector< afw::geom::ellipses::EllipseEllipseVector
 
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.
 
int getAmplitudeDim () const
 Return the number of linear parameters.
 
int getFixedDim () const
 Return the number of fixed nonlinear parameters.
 
int getBasisCount () const
 Return the number of MultiShapeletBasis objects (equivalently, the number of ellipses)
 
NameVector const & getNonlinearNames () const
 Return the names of the free nonlinear parameters.
 
NameVector const & getAmplitudeNames () const
 Return the names of the amplitude parameters.
 
NameVector const & getFixedNames () const
 Return the names of the fixed nonlinear parameters.
 
BasisVector const & getBasisVector () const
 Return the MultiShapeletBasis objects that comprise the Model.
 
shapelet::MultiShapeletFunction 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.
 
virtual std::shared_ptr< PrioradaptPrior (std::shared_ptr< Prior > prior) const =0
 Given an arbitrary prior, return one compatible with this Model or throw LogicError.
 
virtual EllipseVector makeEllipseVector () const =0
 Return an uninitialized vector of afw::geom::ellipses::Ellipse with the parametrization expected by readEllipses() and writeEllipses().
 
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.
 
virtual void readEllipses (EllipseConstIterator ellipseIter, Scalar *nonlinearIter, Scalar *fixedIter) const =0
 Convert a vector of ellipses to a set of nonlinear+fixed parameter arrays.
 
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.
 
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.
 
virtual void transformParameters (LocalUnitTransform const &transform, ndarray::Array< Scalar, 1, 1 > const &nonlinear, ndarray::Array< Scalar, 1, 1 > const &amplitudes, ndarray::Array< Scalar, 1, 1 > const &fixed) const
 Transform (in-place) parameter vectors from one unit system to another.
 
virtual ~Model ()
 
 Model (const Model &)=delete
 
Modeloperator= (const Model &)=delete
 
 Model (Model &&)=delete
 
Modeloperator= (Model &&)=delete
 

Static Public Member Functions

static std::shared_ptr< Modelmake (BasisVector basisVector, NameVector const &prefixes, CenterEnum center)
 Construct a concrete Model instance with multiple ellipses and multishapelet bases.
 
static std::shared_ptr< Modelmake (std::shared_ptr< shapelet::MultiShapeletBasis > basis, CenterEnum center)
 Construct a concrete Model instance with a single ellipse and multishapelet basis.
 
static std::shared_ptr< ModelmakeGaussian (CenterEnum center, double radius=1.0)
 Construct a concrete Model instance that represents a single elliptical Gaussian function.
 

Protected Member Functions

 Model (BasisVector basisVector, NameVector nonlinearNames, NameVector amplitudeNames, NameVector fixedNames)
 

Detailed Description

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()

Definition at line 56 of file Model.h.

Member Typedef Documentation

◆ BasisVector

Definition at line 66 of file Model.h.

◆ EllipseConstIterator

Definition at line 69 of file Model.h.

◆ EllipseIterator

Definition at line 68 of file Model.h.

◆ EllipseVector

Definition at line 67 of file Model.h.

◆ NameVector

Definition at line 65 of file Model.h.

Member Enumeration Documentation

◆ CenterEnum

Enumerator
FIXED_CENTER 
SINGLE_CENTER 
MULTI_CENTER 

Definition at line 59 of file Model.h.

Constructor & Destructor Documentation

◆ ~Model()

virtual lsst::meas::modelfit::Model::~Model ( )
inlinevirtual

Definition at line 251 of file Model.h.

251{}

◆ Model() [1/3]

lsst::meas::modelfit::Model::Model ( const Model & )
delete

◆ Model() [2/3]

lsst::meas::modelfit::Model::Model ( Model && )
delete

◆ Model() [3/3]

lsst::meas::modelfit::Model::Model ( BasisVector basisVector,
NameVector nonlinearNames,
NameVector amplitudeNames,
NameVector fixedNames )
protected

Member Function Documentation

◆ adaptPrior()

virtual std::shared_ptr< Prior > lsst::meas::modelfit::Model::adaptPrior ( std::shared_ptr< Prior > prior) const
pure virtual

Given an arbitrary prior, return one compatible with this Model or throw LogicError.

Implemented in lsst::meas::modelfit::MultiModel.

◆ getAmplitudeDim()

int lsst::meas::modelfit::Model::getAmplitudeDim ( ) const
inline

Return the number of linear parameters.

Definition at line 127 of file Model.h.

127{ return _amplitudeNames.size(); }
T size(T... args)

◆ getAmplitudeNames()

NameVector const & lsst::meas::modelfit::Model::getAmplitudeNames ( ) const
inline

Return the names of the amplitude parameters.

Definition at line 139 of file Model.h.

139{ return _amplitudeNames; }

◆ getBasisCount()

int lsst::meas::modelfit::Model::getBasisCount ( ) const
inline

Return the number of MultiShapeletBasis objects (equivalently, the number of ellipses)

Definition at line 133 of file Model.h.

133{ return _basisVector.size(); }

◆ getBasisVector()

BasisVector const & lsst::meas::modelfit::Model::getBasisVector ( ) const
inline

Return the MultiShapeletBasis objects that comprise the Model.

Definition at line 145 of file Model.h.

145{ return _basisVector; }

◆ getFixedDim()

int lsst::meas::modelfit::Model::getFixedDim ( ) const
inline

Return the number of fixed nonlinear parameters.

Definition at line 130 of file Model.h.

130{ return _fixedNames.size(); }

◆ getFixedNames()

NameVector const & lsst::meas::modelfit::Model::getFixedNames ( ) const
inline

Return the names of the fixed nonlinear parameters.

Definition at line 142 of file Model.h.

142{ return _fixedNames; }

◆ getNonlinearDim()

int lsst::meas::modelfit::Model::getNonlinearDim ( ) const
inline

Return the number of free nonlinear parameters.

Definition at line 124 of file Model.h.

124{ return _nonlinearNames.size(); }

◆ getNonlinearNames()

NameVector const & lsst::meas::modelfit::Model::getNonlinearNames ( ) const
inline

Return the names of the free nonlinear parameters.

Definition at line 136 of file Model.h.

136{ return _nonlinearNames; }

◆ make() [1/2]

static std::shared_ptr< Model > lsst::meas::modelfit::Model::make ( BasisVector basisVector,
NameVector const & prefixes,
CenterEnum center )
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.

Parameters
[in]basisVectorA vector of MultiShapeletBasis objects, one for each component. Each component will have a separate set of ellipse parameters.
[in]prefixesA 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]centerAn enum specifying whether the different components should have a fixed center (FIXED_CENTER), the same center (SINGLE_CENTER), or independent centers (MULTI_CENTER).

◆ make() [2/2]

static std::shared_ptr< Model > lsst::meas::modelfit::Model::make ( std::shared_ptr< shapelet::MultiShapeletBasis > basis,
CenterEnum 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.

Parameters
[in]basisA MultiShapeletBasis object, of the sort provided by the lsst.shapelet.tractor module.
[in]centerAn 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.

◆ makeEllipseVector()

virtual EllipseVector lsst::meas::modelfit::Model::makeEllipseVector ( ) const
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.

◆ makeGaussian()

static std::shared_ptr< Model > lsst::meas::modelfit::Model::makeGaussian ( CenterEnum center,
double radius = 1.0 )
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().

Parameters
[in]centerAn enum specifying whether the model should have a fixed center (FIXED_CENTER) or parametrized center (SINGLE_CENTER or MULTI_CENTER).
[in]radiusThe 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)).

◆ makeShapeletFunction()

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.

◆ operator=() [1/2]

Model & lsst::meas::modelfit::Model::operator= ( const Model & )
delete

◆ operator=() [2/2]

Model & lsst::meas::modelfit::Model::operator= ( Model && )
delete

◆ readEllipses() [1/2]

virtual void lsst::meas::modelfit::Model::readEllipses ( EllipseConstIterator ellipseIter,
Scalar * nonlinearIter,
Scalar * fixedIter ) const
pure virtual

Convert a vector of ellipses to a set of nonlinear+fixed parameter arrays.

Parameters
[in]ellipseIterIterator to the beginning of an ellipse vector, as returned by makeEllipseVector().
[out]nonlinearIterPointer to the beginning of a nonlinear parameter array.
[out]fixedIterPointer to the beginning of a fixed parameter array.
Warning
The ellipse iterator must point to an EllipseVector originally constructed by makeEllipseVector()
Calling writeEllipses() followed by readEllipses() does not guarantee that that the parameters on output will be the same as those on input, as the parameters may be degenerate. However, calling readEllipses() followed by writeEllipses() is guaranteed to round-trip the ellipses.

Implemented in lsst::meas::modelfit::MultiModel.

◆ readEllipses() [2/2]

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.

Parameters
[in]ellipsesAn ellipse vector, as returned by makeEllipseVector().
[out]nonlinearOutput nonlinear parameter array.
[out]fixedOutput fixed parameter array.
Warning
The EllipseVector must have been originally constructed by makeEllipseVector()

◆ transformParameters()

virtual void lsst::meas::modelfit::Model::transformParameters ( LocalUnitTransform const & transform,
ndarray::Array< Scalar, 1, 1 > const & nonlinear,
ndarray::Array< Scalar, 1, 1 > const & amplitudes,
ndarray::Array< Scalar, 1, 1 > const & fixed ) const
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.

◆ writeEllipses() [1/2]

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.

Parameters
[in]nonlinearnonlinear parameter array.
[in]fixedfixed 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.

◆ writeEllipses() [2/2]

virtual void lsst::meas::modelfit::Model::writeEllipses ( Scalar const * nonlinearIter,
Scalar const * fixedIter,
EllipseIterator ellipseIter ) const
pure virtual

Convert a set of nonlinear+fixed parameter arrays to a vector of ellipses.

Parameters
[in]nonlinearIterPointer to the beginning of a nonlinear parameter array.
[in]fixedIterPointer to the beginning of a fixed parameter array.
[out]ellipseIterIterator to the beginning of an ellipse vector, as returned by makeEllipseVector().
Warning
The ellipse iterator must point to an EllipseVector originally constructed by makeEllipseVector()
Calling writeEllipses() followed by readEllipses() does not guarantee that that the parameters on output will be the same as those on input, as the parameters may be degenerate. However, calling readEllipses() followed by writeEllipses() is guaranteed to round-trip the ellipses.

Implemented in lsst::meas::modelfit::MultiModel.


The documentation for this class was generated from the following file: