LSST Applications g0f08755f38+9c285cab97,g1635faa6d4+13f3999e92,g1653933729+a8ce1bb630,g1a0ca8cf93+bf6eb00ceb,g28da252d5a+0829b12dee,g29321ee8c0+5700dc9eac,g2bbee38e9b+9634bc57db,g2bc492864f+9634bc57db,g2cdde0e794+c2c89b37c4,g3156d2b45e+41e33cbcdc,g347aa1857d+9634bc57db,g35bb328faa+a8ce1bb630,g3a166c0a6a+9634bc57db,g3e281a1b8c+9f2c4e2fc3,g414038480c+077ccc18e7,g41af890bb2+fde0dd39b6,g5fbc88fb19+17cd334064,g781aacb6e4+a8ce1bb630,g80478fca09+55a9465950,g82479be7b0+d730eedb7d,g858d7b2824+9c285cab97,g9125e01d80+a8ce1bb630,g9726552aa6+10f999ec6a,ga5288a1d22+2a84bb7594,gacf8899fa4+c69c5206e8,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc28159a63d+9634bc57db,gcf0d15dbbd+4b7d09cae4,gda3e153d99+9c285cab97,gda6a2b7d83+4b7d09cae4,gdaeeff99f8+1711a396fd,ge2409df99d+5e831397f4,ge79ae78c31+9634bc57db,gf0baf85859+147a0692ba,gf3967379c6+41c94011de,gf3fb38a9a8+8f07a9901b,gfb92a5be7c+9c285cab97,w.2024.46
LSST Data Management Base Package
|
Class for fitting multishapelet models to PSF images. More...
#include <GeneralPsfFitter.h>
Public Member Functions | |
GeneralPsfFitter (GeneralPsfFitterControl const &ctrl) | |
Initialize the fitter class with the given control object. | |
shapelet::MultiShapeletFunctionKey | addFields (afw::table::Schema &schema, std::string const &prefix) const |
Add fields to a Schema that can be used to store the MultiShapeletFunction returned by apply(). | |
std::shared_ptr< Model > | getModel () const |
Return the Model object that corresponds to the configuration. | |
std::shared_ptr< Prior > | getPrior () const |
Return the Prior object that corresponds to the configuration. | |
shapelet::MultiShapeletFunction | adapt (shapelet::MultiShapeletFunction const &previousFit, std::shared_ptr< Model > previousModel) const |
Adapt a differently-configured previous fit to be used as an starting point for this GeneralPsfFitter. | |
shapelet::MultiShapeletFunction | apply (afw::image::Image< Pixel > const &image, afw::geom::ellipses::Quadrupole const &moments, Scalar noiseSigma=-1, int *pState=nullptr) const |
Perform an initial fit to a PSF image. | |
shapelet::MultiShapeletFunction | apply (afw::image::Image< double > const &image, afw::geom::ellipses::Quadrupole const &moments, Scalar noiseSigma=-1, int *pState=nullptr) const |
shapelet::MultiShapeletFunction | apply (afw::image::Image< Pixel > const &image, shapelet::MultiShapeletFunction const &initial, Scalar noiseSigma=-1, int *pState=nullptr) const |
Perform a fit to a PSF image, using a previous fit as a starting point. | |
shapelet::MultiShapeletFunction | apply (afw::image::Image< double > const &image, shapelet::MultiShapeletFunction const &initial, Scalar noiseSigma=-1, int *pState=nullptr) const |
Class for fitting multishapelet models to PSF images.
This class fits up to four shapelet expansions simultaneously to a PSF image, with the relative radii and number of shapelet coefficients for each expansion separately configurable. These expansions are also named; this allows us to map different fits with some expansions disabled to each other, in order to first fit an approximate model and follow this up with a more complete model, using the approximate model as a starting point.
The configuration also defines a simple Bayesian prior for the fit, defined using simple independent Gaussians for the ellipse parameters of each component. The priors can be disabled by setting their width (xxPriorSigma in the control object) to infinity, and those parameters can be held fixed at their input values by setting the prior width to zero. The priors are always centered at the input value, meaning that it may be more appropriate to think of the priors as a form of regularization, rather than a rigorous prior. In fact, it's impossible to use a prior here rigorously without a noise model for the PSF image, which is something the LSST Psf class doesn't provide, and here is just provided as a constant noise sigma to be provided by the user (who generally just has to chose a small number arbitrarily). Decreasing the noise sigma will of course decrease the effect of the priors (and vice versa). In any case, having some sort of regularization is probably a good idea, as this is a very high-dimensional fit.
Definition at line 148 of file GeneralPsfFitter.h.
|
explicit |
Initialize the fitter class with the given control object.
shapelet::MultiShapeletFunction lsst::meas::modelfit::GeneralPsfFitter::adapt | ( | shapelet::MultiShapeletFunction const & | previousFit, |
std::shared_ptr< Model > | previousModel ) const |
Adapt a differently-configured previous fit to be used as an starting point for this GeneralPsfFitter.
[in] | previousFit | The return value of apply() from a differently-configured instance of GeneralPsfFitter. |
[in] | previousModel | The Model associated with the GeneralPsfFitter used to create previousFit. |
shapelet::MultiShapeletFunctionKey lsst::meas::modelfit::GeneralPsfFitter::addFields | ( | afw::table::Schema & | schema, |
std::string const & | prefix ) const |
Add fields to a Schema that can be used to store the MultiShapeletFunction returned by apply().
[in,out] | schema | Schema to add fields to. |
[in] | prefix | Field name prefix for all fields. |
|
inline |
Definition at line 221 of file GeneralPsfFitter.h.
|
inline |
Definition at line 251 of file GeneralPsfFitter.h.
shapelet::MultiShapeletFunction lsst::meas::modelfit::GeneralPsfFitter::apply | ( | afw::image::Image< Pixel > const & | image, |
afw::geom::ellipses::Quadrupole const & | moments, | ||
Scalar | noiseSigma = -1, | ||
int * | pState = nullptr ) const |
Perform an initial fit to a PSF image.
[in] | image | The image to fit, typically the result of Psf::computeKernelImage(). The image's xy0 should be set such that the center of the PSF is at (0,0). |
[in] | moments | Second moments of the PSF, typically result of Psf::computeShape() or running some other adaptive moments code on the PSF image. This will be used to set the initial ellipses of the multishapelet model. |
[in] | noiseSigma | An estimate of the noise in the image. As LSST PSF images are generally assumed to be noise-free, this is really just a fiddle-factor for the user. A default value from the control object is used if this is negative. |
[in] | pState | Pointer to an integer which is used to return the optimizerState from apply. |
shapelet::MultiShapeletFunction lsst::meas::modelfit::GeneralPsfFitter::apply | ( | afw::image::Image< Pixel > const & | image, |
shapelet::MultiShapeletFunction const & | initial, | ||
Scalar | noiseSigma = -1, | ||
int * | pState = nullptr ) const |
Perform a fit to a PSF image, using a previous fit as a starting point.
[in] | image | The image to fit, typically the result of Psf::computeKernelImage(). The image's xy0 should be set such that the center of the PSF is at (0,0). |
[in] | initial | The result of a previous call to apply(), using an identically-configured GeneralPsfFitter instance. To use a result from a differently-configured GeneralPsfFitter, use adapt(). |
[in] | noiseSigma | An estimate of the noise in the image. As LSST PSF images are generally assumed to be noise-free, this is really just a fiddle-factor for the user. A default value from the control object is used if this is negative. |
[in] | pState | Pointer to an integer which is used to return the optimizerState from apply. |
|
inline |
Return the Model object that corresponds to the configuration.
In addition to the shapelet coefficients (stored in the "amplitudes" array), this Model stores all the initial ellipse parameters in the "fixed" array, as these are used to define the center of the prior; the "nonlinear" parameters are the free-to-vary ellipse parameters minus the corresponding initial values.
Definition at line 174 of file GeneralPsfFitter.h.
|
inline |