File DoubleShapeletPsfApprox.h

namespace lsst

Class for a simple mapping implementing a generic AstrometryTransform.

Remove all non-astronomical counts from the Chunk Exposure’s pixels.

Forward declarations for lsst::utils::Cache

For details on the Cache class, see the Cache.h file.

It uses a template rather than a pointer so that the derived classes can use the specifics of the transform. The class simplePolyMapping overloads a few routines.

A base class for image defects

Numeric constants used by the Integrate.h integrator routines.

Compute Image Statistics

Note

Gauss-Kronrod-Patterson quadrature coefficients for use in quadpack routine qng. These coefficients were calculated with 101 decimal digit arithmetic by L. W. Fullerton, Bell Labs, Nov 1981.

Note

The Statistics class itself can only handle lsst::afw::image::MaskedImage() types. The philosophy has been to handle other types by making them look like lsst::afw::image::MaskedImage() and reusing that code. Users should have no need to instantiate a Statistics object directly, but should use the overloaded makeStatistics() factory functions.

namespace meas
namespace modelfit
class DoubleShapeletPsfApproxAlgorithm : public lsst::meas::base::SimpleAlgorithm
#include <DoubleShapeletPsfApprox.h>

An algorithm that fits a 2-component shapelet approximation to the PSF model.

This algorithm fits a similar model to the one that has been used on the HSC side for several data releases, but uses the improved optimizer in meas_modelfit instead of the one in (the now defunct) meas_extensions_multiShapelet and using moments to reduce the number of parameters in the fit. It is faster and more robust than GeneralShapeletPsfApprox, but much less flexible.

The model is not a fully general one, even for two shapelet components. We tie the ellipticities of the two components together, hold the center fixed, and keep their radii fixed at a value set in the configuration; this means we fit only one set of ellipse parameters, instead of two.

Public Types

typedef DoubleShapeletPsfApproxControl Control

Public Functions

DoubleShapeletPsfApproxAlgorithm(Control const &ctrl, std::string const &name, afw::table::Schema &schema)

Failure modes passed by MeasurementErrors thrown by this class.

Construct an algorithm for use with record outputs.

Essentially all of the functionality of this class is accessible through static methods, so an instance only needs to be constructed if you want to store the results in a record object.

Parameters
  • [in] ctrl: Control object specifying the details of the model and how to fit it.

  • [in] name: Name of the algorithm; will be used as the prefix for all field names.

  • [inout] schema: Schema to which fields will be added. Must already contain a slot_Centroid alias pointing to fields with position information.

void measure(afw::table::SourceRecord &measRecord, afw::image::Exposure<float> const &exposure) const

Run all fitting stages on the Psf attached to the given Exposure, saving the results in measRecord.

We first call fitMoments(), then fitProfile(), then fitShapelets().

void fail(afw::table::SourceRecord &measRecord, lsst::meas::base::MeasurementError *error = nullptr) const

Handle failures caught by the measurement plugin system, setting failure flags as appropriate.

Public Static Functions

static base::FlagDefinitionList const &getFlagDefinitions()
static shapelet::MultiShapeletFunction initializeResult(Control const &ctrl)

Create a MultiShapeletFunction with orders and radii and amplitude ratios from the control object.

This creates a circular two-component MultiShapeletFunction with unit total flux and unit circle moments, with zeroth-order amplitudes matching ctrl.peakRatio and ellipse radii matching ctrl.radiusRatio.

static void fitMoments(shapelet::MultiShapeletFunction &result, Control const &ctrl, afw::image::Image<Scalar> const &psfImage)

Update a MultiShapeletFunction’s ellipses to match the first and second moments of a PSF image.

The relative ampltidues, radii, and ellipticities of the ellipses will not be modified; both ellipses will simply be transformed (together) such that the moments of the MultiShapeletFunction match the (unweighted) moments of the image, and the two components will be scaled together to match the total flux in the image.

Parameters
  • [inout] result: MultiShapeletFunction to update. Must have unit circle moments. Probably the result of a call to initializeResult().

  • [in] ctrl: Control object specifying the details of the model and how to fit it.

  • [in] psfImage: Image of the PSF to fit. Should have xy0 set such that (0,0) is at the center of the image. Probably the result of a call to Psf::computeKernelImage().

Exceptions
  • meas::base::MeasurementError: if the resulting moments are invalid, either because they have negative determinant or the radii are out of bounds.

static void fitShapelets(shapelet::MultiShapeletFunction &result, Control const &ctrl, afw::image::Image<Scalar> const &psfImage)

Update a MultiShapeletFunction’s higher-order shapelet terms, holding everything else fixed.

All ellipse parameters and the zeroth-order (Gaussian) shapelet coefficients will be held fixed.

Parameters
  • [inout] result: MultiShapeletFunction to update. Probably the result of a call to fitProfile().

  • [in] ctrl: Control object specifying the details of the model and how to fit it.

  • [in] psfImage: Image of the PSF to fit. Should have xy0 set such that (0,0) is at the center of the image. Probably the result of a call to Psf::computeKernelImage().

Public Static Attributes

base::FlagDefinition const FAILURE
base::FlagDefinition const INVALID_POINT_FOR_PSF
base::FlagDefinition const INVALID_MOMENTS
base::FlagDefinition const MAX_ITERATIONS

Private Members

Control _ctrl
meas::base::SafeCentroidExtractor _centroidExtractor
shapelet::MultiShapeletFunctionKey _key
lsst::meas::base::FlagHandler _flagHandler
class DoubleShapeletPsfApproxControl
#include <DoubleShapeletPsfApprox.h>

Control object used to configure a 2-shapelet fit to a PSF model; see DoubleShapeletPsfApproxAlgorithm.

Public Functions

DoubleShapeletPsfApproxControl()
lsst::meas::modelfit::DoubleShapeletPsfApproxControl::LSST_CONTROL_FIELD(innerOrder, int, "Shapelet order of inner expansion (0 == Gaussian)")
lsst::meas::modelfit::DoubleShapeletPsfApproxControl::LSST_CONTROL_FIELD(outerOrder, int, "Shapelet order of outer expansion (0 == Gaussian)")
lsst::meas::modelfit::DoubleShapeletPsfApproxControl::LSST_CONTROL_FIELD(radiusRatio, double, "Initial outer radius divided by inner radius")
lsst::meas::modelfit::DoubleShapeletPsfApproxControl::LSST_CONTROL_FIELD(peakRatio, double, "Initial outer Gaussian peak height divided by inner Gaussian peak height")
lsst::meas::modelfit::DoubleShapeletPsfApproxControl::LSST_CONTROL_FIELD(minRadius, double, "Don't allow the semi-minor radius of any component to drop below this value (pixels)")
lsst::meas::modelfit::DoubleShapeletPsfApproxControl::LSST_CONTROL_FIELD(minRadiusDiff, double, "Don't allow the determinant radii of the two components to differ by less than this (pixels)")
lsst::meas::modelfit::DoubleShapeletPsfApproxControl::LSST_CONTROL_FIELD(maxRadiusBoxFraction, double, "Don't allow the semi-major radius of any component to go above this fraction of the PSF image width")
lsst::meas::modelfit::DoubleShapeletPsfApproxControl::LSST_NESTED_CONTROL_FIELD(optimizer, lsst.meas.modelfit. optimizer, OptimizerControl, "Configuration of the optimizer used by DoubleShapeletPsfsApproxAlgorithm::fitProfile().")