File Algorithm.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 base
class BaseAlgorithm
#include <Algorithm.h>

Ultimate abstract base class for all C++ measurement algorithms

New algorithms should not inherit directly from this class.

Subclassed by lsst::meas::base::ForcedAlgorithm, lsst::meas::base::SingleFrameAlgorithm

Public Functions

virtual void fail(afw::table::SourceRecord &measRecord, MeasurementError *error = nullptr) const = 0

Handle an exception thrown by the current algorithm by setting flags in the given record.

fail() is called by the measurement framework when an exception is allowed to propagate out of one the algorithm’s measure() methods. It should generally set both a general failure flag for the algorithm as well as a specific flag indicating the error condition, if possible. To aid in this, if the exception was an instance of MeasurementError, it will be passed in, carrying information about what flag to set.

An algorithm can also to chose to set flags within its own measure() methods, and then just return, rather than throw an exception. However, fail() should be implemented even when all known failure modes do not throw exceptions, to ensure that unexpected exceptions thrown in lower-level code are properly handled.

virtual ~BaseAlgorithm()
std::string getLogName() const

Protected Attributes

std::string _logName
class ForcedAlgorithm : public virtual lsst::meas::base::BaseAlgorithm
#include <Algorithm.h>

Base class for algorithms that measure the properties of sources on one image, using previous measurements on another image to hold certain quantities fixed.

ForcedAlgorithm can be used when measuring both on single exposures and coadds, and is typically used to measure colors by holding centroids, apertures, or other model parameters fixed while allowing amplitudes to vary.

In addition to the virtual methods defined here, ForcedAlgorithm also puts requirements on constructor signatures; see the wrapForcedAlgorithm Python function for more information.

Most algorithms will not need to make use of the reference record or WCS, as transformed centroids and shapes should generally be available via the slots in measRecord, but these are made available for algorithms that need to transform more complex information. If that is the case, the algorithm may want to inherit from SimpleAlgorithm instead of inheriting from ForcedAlgorithm directly.

Subclassed by lsst::meas::base::SimpleAlgorithm

Public Functions

virtual void measureForced(afw::table::SourceRecord &measRecord, afw::image::Exposure<float> const &exposure, afw::table::SourceRecord const &refRecord, afw::geom::SkyWcs const &refWcs) const = 0

Called to measure a single child source in an image.

Before this method is called, all neighbors will be replaced with noise, using the outputs of the deblender. Outputs should be saved in the given SourceRecord, which can also be used to obtain centroid (see SafeCentroidExtractor) and shape (see SafeShapeExtractor) information.

virtual void measureNForced(afw::table::SourceCatalog const &measCat, afw::image::Exposure<float> const &exposure, afw::table::SourceCatalog const &refRecord, afw::geom::SkyWcs const &refWcs) const

Called to simultaneously measure all children in a deblend family, in a single image.

Outputs should be saved in the given SourceCatalog, which can also be used to obtain centroid (see SafeCentroidExtractor) and shape (see SafeShapeExtractor) information.

The default implementation simply throws an exception, indicating that simultaneous measurement is not supported.

class SimpleAlgorithm : public lsst::meas::base::SingleFrameAlgorithm, public lsst::meas::base::ForcedAlgorithm
#include <Algorithm.h>

An abstract base classes for which the same implementation can be used for both SingleFrameAlgorithm and ForcedAlgorithm.

SimpleAlgorithm allows a ForcedAlgorithm to be defined using the measure() and measureN() signatures of SingleFrameAlgorithm. It should be used for any algorithm for which the forced version of the algorithm does not require anything to be transformed beyond the centroid and shape, and for which the the parameters being fit are the same for both single-frame and forced measurement. This should be the case for all flux algorithms that don’t involve fitting any additional model parameters. It can also be used for centroid and shape algorithms, where having a version that can re-measure values in forced mode may be useful for diagnostic purposes even if it is not useful for science.

Subclassed by lsst::ip::diffim::DipoleCentroidAlgorithm, lsst::ip::diffim::DipoleFluxAlgorithm, lsst::meas::base::ApertureFluxAlgorithm, lsst::meas::base::BlendednessAlgorithm, lsst::meas::base::GaussianFluxAlgorithm, lsst::meas::base::LocalBackgroundAlgorithm, lsst::meas::base::NaiveCentroidAlgorithm, lsst::meas::base::PeakLikelihoodFluxAlgorithm, lsst::meas::base::PixelFlagsAlgorithm, lsst::meas::base::PsfFluxAlgorithm, lsst::meas::base::ScaledApertureFluxAlgorithm, lsst::meas::base::SdssCentroidAlgorithm, lsst::meas::base::SdssShapeAlgorithm, lsst::meas::extensions::photometryKron::KronFluxAlgorithm, lsst::meas::extensions::simpleShape::SimpleShape, lsst::meas::modelfit::DoubleShapeletPsfApproxAlgorithm

Public Functions

virtual void measureForced(afw::table::SourceRecord &measRecord, afw::image::Exposure<float> const &exposure, afw::table::SourceRecord const &refRecord, afw::geom::SkyWcs const &refWcs) const

Called to measure a single child source in an image.

Before this method is called, all neighbors will be replaced with noise, using the outputs of the deblender. Outputs should be saved in the given SourceRecord, which can also be used to obtain centroid (see SafeCentroidExtractor) and shape (see SafeShapeExtractor) information.

virtual void measureNForced(afw::table::SourceCatalog const &measCat, afw::image::Exposure<float> const &exposure, afw::table::SourceCatalog const &refRecord, afw::geom::SkyWcs const &refWcs) const

Called to simultaneously measure all children in a deblend family, in a single image.

Outputs should be saved in the given SourceCatalog, which can also be used to obtain centroid (see SafeCentroidExtractor) and shape (see SafeShapeExtractor) information.

The default implementation simply throws an exception, indicating that simultaneous measurement is not supported.

class SingleFrameAlgorithm : public virtual lsst::meas::base::BaseAlgorithm
#include <Algorithm.h>

Base class for algorithms that measure the properties of sources on single image.

SingleFrameAlgorithm defines the interface used in measuring both on single exposure images and on coadds.

In addition to the virtual methods defined here, SingleFrameAlgorithm also puts requirements on constructor signatures; see the wrapSingleFrameAlgorithm Python function for more information.

Subclassed by lsst::meas::base::SimpleAlgorithm

Public Functions

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

Called to measure a single child source in an image.

Before this method is called, all neighbors will be replaced with noise, using the outputs of the deblender. Outputs should be saved in the given SourceRecord, which can also be used to obtain centroid (see SafeCentroidExtractor) and shape (see SafeShapeExtractor) information.

virtual void measureN(afw::table::SourceCatalog const &measCat, afw::image::Exposure<float> const &exposure) const

Called to simultaneously measure all children in a deblend family, in a single image.

Outputs should be saved in the given SourceCatalog, which can also be used to obtain centroid (see SafeCentroidExtractor) and shape (see SafeShapeExtractor) information.

The default implementation simply throws an exception, indicating that simultaneous measurement is not supported.