File InputUtilities.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 SafeCentroidExtractor
#include <InputUtilities.h>

Utility class for measurement algorithms that extracts a position from the Centroid slot and handles errors in a safe and consistent way.

Public Functions

SafeCentroidExtractor(afw::table::Schema &schema, std::string const &name, bool isCentroider = false)

Construct the extractor, creating a flag alias that indicates failure in the input centroid by linking to the slot centroid flag.

Parameters
  • [out] schema: Schema to which the alias should be added. The “slot_Centroid” alias must already be present in the Schema’s AliasMap.

  • [in] name: The name of the algorithm; the flag alias added will be “<name>_flag_badCentroid”, or “<name>_flag_badInitialCentroid” if isCentroider=true.

  • [in] isCentroider: Indicates whether the calling algorithm is itself a centroid measurement algorithm. If true,, falling back to the Peak because there was no previous centroider or a previous centroider failed will not cause the general failure flag of the current algorithm to be set.

geom::Point2D operator()(afw::table::SourceRecord &record, FlagHandler const &flags) const

Extract a position from the given record.

We use the Centroid slot if it is not NaN, and fall back to the Peak on the Footprint otherwise.

If the Centroid slot is not defined, we throw FatalAlgorithmError, as this indicates a configuration problem.

If the Centroid slot value is NaN and is not flagged (or there is no Centroid slot flag), we throw RuntimeError, which should cause the measurement framework to log a warning and set the current algorithm’s general failure flag if it is allowed to propagate out of the algorithm implementation.

If the Centroid slot is NaN and there is no Footprint or Peak (even if the centroid is flagged), we also throw RuntimeError, as this indicates something wrong in another stage of the pipeline that should be addressed before measurement is run.

If the Centroid slot is flagged and we nevertheless obtain a usable position (either from a the Centroid slot itself or from a successful fall-back to the Peak), we set the current algorithm’s general failure flag, but return the position as well, allowing it to continue while indicating that the result may not be reliable.

Private Members

std::string _name
bool _isCentroider
class SafeShapeExtractor
#include <InputUtilities.h>

Utility class for measurement algorithms that extracts an ellipse from the Shape slot and handles errors in a safe and consistent way.

Public Functions

SafeShapeExtractor(afw::table::Schema &schema, std::string const &name)

Construct the extractor, creating a flag alias that indicates failure in the input centroid by linking to the slot shape flag.

Parameters
  • [out] schema: Schema to which the alias should be added. The “slot_Shape” alias must already be present in the Schema’s AliasMap.

  • [in] name: The name of the algorithm; the flag alias added will be “<name>_flag_badShape”.

afw::geom::ellipses::Quadrupole operator()(afw::table::SourceRecord &record, FlagHandler const &flags) const

Extract a shape from the given record.

We use the Shape slot if it is not NaN, and throw MeasurementError if it is (with only the general failure code attached to the MeasurementError).

If the Shape slot is not defined, we throw FatalAlgorithmError, as this indicates a configuration problem.

If the Shape slot value is NaN and is not flagged (or there is no Shape slot flag), we throw RuntimeError, which should cause the measurement framework to log a warning and set the current algorithm’s general failure flag if it is allowed to propagate out of the algorithm implementation.

If the Shape slot is flagged and we nevertheless obtain a usable ellipse, we set the current algorithm’s general failure flag, but return the ellipse as well, allowing it to continue while indicating that the result may not be reliable. A singular ellipse (i.e. one with a non-positive quadrupole matrix determinant) is treated the same as a NaN ellipse; it is not considered usable.

Private Members

std::string _name