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
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
lsst::shapelet::RadialProfile Class Referenceabstract

Registry and utility class for multi-Gaussian approximations to radial profiles. More...

#include <RadialProfile.h>

Public Member Functions

std::string const getName () const
 Return the name of the profile. More...
 
virtual double evaluate (double r) const =0
 Evaluate the profile at the given radius. More...
 
ndarray::Array< double, 1, 1 > evaluate (ndarray::Array< double const, 1, 1 > const &r) const
 Evaluate the profile at the given radius (vectorized). More...
 
double getMomentsRadiusFactor () const
 Return the 2nd-moment radius in units of the half-light radius. More...
 
std::shared_ptr< MultiShapeletBasisgetBasis (int nComponents, int maxRadius=0) const
 Return a multi-Gaussian approximation to the radial profile. More...
 
void registerBasis (std::shared_ptr< MultiShapeletBasis > basis, int nComponents, int maxRadius)
 Register a basis with the profile, making it available to callers of getBasis(). More...
 

Static Public Member Functions

static RadialProfileget (std::string const &name)
 Return a predefined radial profile given its name. More...
 

Protected Member Functions

 RadialProfile (std::string const &name, int defaultMaxRadius)
 

Protected Attributes

double _momentsRadiusFactor
 

Detailed Description

Registry and utility class for multi-Gaussian approximations to radial profiles.

RadialProfile provides C++ access to the saved multi-Gaussian approximations stored in the pickle files in the data subdirectory of the shapelet package, by maintaining a singleton registry of these that is populated at import time by tractor.py. It also provides access to the true (exact) profiles, (mostly useful for educational/diagnostic purposes) and information about the relationship between different radii for this profile (see getMomentsRadiusFactor()).

Each RadialProfile object represents a particular "true" profile, and can hold multiple multi-Gaussian (or multi-Shapelet) approximations with different degrees of fidelity, as controlled by the number of components in the approximation and the maximum radius at which the approximation was fit. For more information about these approximations, see tractor.py and references therein. All RadialProfiles are defined in units of the half-light radius of the true profile, even for profiles for which this is not the radius typically used.

Several predefined subclasses of RadialProfile are defined privately, and can be accessed by name through the static get() method:

Definition at line 60 of file RadialProfile.h.

Constructor & Destructor Documentation

◆ RadialProfile()

lsst::shapelet::RadialProfile::RadialProfile ( std::string const &  name,
int  defaultMaxRadius 
)
explicitprotected

Member Function Documentation

◆ evaluate() [1/2]

virtual double lsst::shapelet::RadialProfile::evaluate ( double  r) const
pure virtual

Evaluate the profile at the given radius.

Radius is given in units of half-light radius, and the profile is normalized to 1 at r=1.

◆ evaluate() [2/2]

ndarray::Array<double,1,1> lsst::shapelet::RadialProfile::evaluate ( ndarray::Array< double const, 1, 1 > const &  r) const

Evaluate the profile at the given radius (vectorized).

Radius is given in units of half-light radius, and the profile is normalized to 1 at r=1.

◆ get()

static RadialProfile& lsst::shapelet::RadialProfile::get ( std::string const &  name)
static

Return a predefined radial profile given its name.

New RadialProfile classes are registered when their constructor is invoked, so all subclasses should only be instantiated once (at module scope).

◆ getBasis()

std::shared_ptr<MultiShapeletBasis> lsst::shapelet::RadialProfile::getBasis ( int  nComponents,
int  maxRadius = 0 
) const

Return a multi-Gaussian approximation to the radial profile.

Unlike the evaluate() method, the returned basis is normalized that the integrated flux is equal to the (single) amplitude.

Parameters
[in]nComponentsNumber of Gaussians used to approximate the profile.
[in]maxRadiusMaximum radius used in fitting the approximation. Passing 0 selects the default for that profile.

Gaussian approximations are computed in advance and persisted, and are usually loaded and registered with the RadialProfile object in Python at module-import time.

Throws NotFoundError if the a basis with the given combination of nComponents and maxRadius has not been added to the RadialProfile.

◆ getMomentsRadiusFactor()

double lsst::shapelet::RadialProfile::getMomentsRadiusFactor ( ) const
inline

Return the 2nd-moment radius in units of the half-light radius.

Definition at line 89 of file RadialProfile.h.

◆ getName()

std::string const lsst::shapelet::RadialProfile::getName ( ) const
inline

Return the name of the profile.

Definition at line 72 of file RadialProfile.h.

72 { return _name; }

◆ registerBasis()

void lsst::shapelet::RadialProfile::registerBasis ( std::shared_ptr< MultiShapeletBasis basis,
int  nComponents,
int  maxRadius 
)

Register a basis with the profile, making it available to callers of getBasis().

Member Data Documentation

◆ _momentsRadiusFactor

double lsst::shapelet::RadialProfile::_momentsRadiusFactor
protected

Definition at line 118 of file RadialProfile.h.


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