File SdssShape.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
SdssShapeAlgorithm
: public lsst::meas::base::SimpleAlgorithm - #include <SdssShape.h>
Measure the image moments of source using adaptive Gaussian weights.
This algorithm measures the weighted second moments of an image using a Gaussian weight function, which is iteratively updated to match the current weights. If this iteration does not converge, it can fall back to using unweighted moments, which can be significantly noisier.
See Bernstein & Jarvis, 2002, for more information on this type of algorithm. Note that the code here makes no attempt to correct for the PSF; for PSF corrected ellipticities using weighted moments please use the shapeHSM package.
Public Types
-
typedef SdssShapeControl
Control
-
typedef SdssShapeResult
Result
-
typedef SdssShapeResultKey
ResultKey
Public Functions
-
virtual void
measure
(afw::table::SourceRecord &measRecord, afw::image::Exposure<float> const &exposure) 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
fail
(afw::table::SourceRecord &measRecord, MeasurementError *error = nullptr) const 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.
Public Static Functions
-
static FlagDefinitionList const &
getFlagDefinitions
()
-
template<typename
ImageT
>
static ResultcomputeAdaptiveMoments
(ImageT const &image, geom::Point2D const &position, bool negative = false, Control const &ctrl = Control()) Compute the adaptive Gaussian-weighted moments of an image.
- Parameters
[in] image
: An Image or MaskedImage instance with int, float, or double pixels. This need not be a small postage stamp (the pixel region actually used in the fit will be a subset of this image determined automatically).[in] position
: Center position of the object to be measured, in the image’s PARENT coordinates.[in] negative
: Boolean, specify if the source is in negative instFlux space[in] ctrl
: Control object specifying the details of how the object is to be measured.
-
template<typename
ImageT
>
static FluxResultcomputeFixedMomentsFlux
(ImageT const &image, afw::geom::ellipses::Quadrupole const &shape, geom::Point2D const &position) Compute the instFlux within a fixed Gaussian aperture.
- Parameters
[in] image
: An Image or MaskedImage instance with int, float, or double pixels. This need not be a small postage stamp (the pixel region actually used in the fit will be a subset of this image determined automatically).[in] shape
: Ellipse object specifying the 1-sigma contour of the Gaussian.[in] position
: Center position of the object to be measured, in the image’s PARENT coordinates.
Public Static Attributes
-
unsigned int const
N_FLAGS
= 6
-
FlagDefinition const
FAILURE
-
FlagDefinition const
UNWEIGHTED_BAD
-
FlagDefinition const
UNWEIGHTED
-
FlagDefinition const
SHIFT
-
FlagDefinition const
MAXITER
-
FlagDefinition const
PSF_SHAPE_BAD
-
typedef SdssShapeControl
-
class
SdssShapeControl
- #include <SdssShape.h>
A C++ control class to handle SdssShapeAlgorithm’s configuration.
Public Functions
-
lsst::meas::base::SdssShapeControl::LSST_CONTROL_FIELD(background, double, "Additional value to add to background")
-
lsst::meas::base::SdssShapeControl::LSST_CONTROL_FIELD(maxIter, int, "Maximum number of iterations")
-
lsst::meas::base::SdssShapeControl::LSST_CONTROL_FIELD(maxShift, double, "Maximum centroid shift, limited to 2-10")
-
lsst::meas::base::SdssShapeControl::LSST_CONTROL_FIELD(tol1, float, "Convergence tolerance for e1, e2")
-
lsst::meas::base::SdssShapeControl::LSST_CONTROL_FIELD(tol2, float, "Convergence tolerance for FWHM")
-
lsst::meas::base::SdssShapeControl::LSST_CONTROL_FIELD(doMeasurePsf, bool, "Whether to also compute the shape of the PSF model")
-
SdssShapeControl
()
-
-
class
SdssShapeResult
: public lsst::meas::base::ShapeResult, public lsst::meas::base::CentroidResult, public lsst::meas::base::FluxResult - #include <SdssShape.h>
Result object SdssShapeAlgorithm.
Because we have use cases for running SdssShape outside of the measurement framework (in particular, we need to run it on PSF model images), we provide an interface that doesn’t need to use SourceRecord for its inputs and outputs. Instead, it returns an instance of this class.
Note: for what I guess are historical reasons, SdssShape computes covariance terms between the instFlux and the shape, but not between the instFlux and centroid or centroid and shape.
This should logically be an inner class, but Swig doesn’t know how to parse those.
Public Functions
-
bool
getFlag
(unsigned int index) const Flag getter for Swig, which doesn’t understand std::bitset.
-
bool
getFlag
(std::string const &name) const
-
SdssShapeResult
() Constructor; initializes everything to NaN.
Public Members
-
ErrElement
instFlux_xx_Cov
instFlux, xx term in the uncertainty covariance matrix
-
ErrElement
instFlux_yy_Cov
instFlux, yy term in the uncertainty covariance matrix
-
ErrElement
instFlux_xy_Cov
instFlux, xy term in the uncertainty covariance matrix
-
std::bitset<SdssShapeAlgorithm::N_FLAGS>
flags
Status flags (see SdssShapeAlgorithm).
-
bool
-
class
SdssShapeResultKey
: public lsst::afw::table::FunctorKey<SdssShapeResult> - #include <SdssShape.h>
A FunctorKey that maps SdssShapeResult to afw::table Records.
This is used internally by SdssShapeAlgorithm to transfer results from SdssShapeResult to SourceRecord, but it can also be used in the other direction by codes that need to extra an SdssShapeResult from a record.
Unnamed Group
-
bool
operator==
(SdssShapeResultKey const &other) const Compare the FunctorKey for equality with another, using the underlying Keys.
-
bool
operator!=
(SdssShapeResultKey const &other) const
Public Functions
-
SdssShapeResultKey
() Default constructor; instance will not be usuable unless subsequently assigned to.
-
SdssShapeResultKey
(afw::table::SubSchema const &s) Construct from a subschema, assuming _xx, _yy, etc. subfields.
If a schema has “a_xx”, “a_yy”, etc. fields, this constructor allows you to construct a SdssShapeResultKey via:
SdssShapeResultKey k(schema["a"]);
-
virtual SdssShapeResult
get
(afw::table::BaseRecord const &record) const Get an SdssShapeResult from the given record.
-
virtual void
set
(afw::table::BaseRecord &record, SdssShapeResult const &value) const Set an SdssShapeResult in the given record.
-
virtual afw::geom::ellipses::Quadrupole
getPsfShape
(afw::table::BaseRecord const &record) const Get a Quadrupole for the Psf from the given record.
-
virtual void
setPsfShape
(afw::table::BaseRecord &record, afw::geom::ellipses::Quadrupole const &value) const Set a Quadrupole for the Psf at the position of the given record.
-
bool
isValid
() const Return True if the key is valid.
-
FlagHandler const &
getFlagHandler
() const
Public Static Functions
-
static SdssShapeResultKey
addFields
(afw::table::Schema &schema, std::string const &name, bool doMeasurePsf) Add the appropriate fields to a Schema, and return a SdssShapeResultKey that manages them.
- Parameters
[inout] schema
: Schema to add fields to.[in] name
: Name prefix for all fields; “_xx”, “_yy”, etc. will be appended to this to form the full field names.[in] numFlags
: Integer to accommodate not setting the Psf shape fields when doMeasurePsf is false.[in] doMeasurePsf
: Boolean indicating whether or not the Psf is being measured (as set in the SdssShapeControl class).
Private Members
-
bool
_includePsf
¶
-
ShapeResultKey
_shapeResult
¶
-
CentroidResultKey
_centroidResult
¶
-
FluxResultKey
_instFluxResult
¶
-
afw::table::QuadrupoleKey
_psfShapeResult
¶
-
afw::table::Key<ErrElement>
_instFlux_xx_Cov
¶
-
afw::table::Key<ErrElement>
_instFlux_yy_Cov
¶
-
afw::table::Key<ErrElement>
_instFlux_xy_Cov
¶
-
FlagHandler
_flagHandler
¶
-
bool
-
class
SdssShapeTransform
: public lsst::meas::base::BaseTransform - #include <SdssShape.h>
Transformation for SdssShape measurements.
SdssShape measures not just shape but also instFlux and centroid. This transform operates on the first directly, and delegates to the Flux and Centroid transforms for the other two.
Public Types
-
typedef SdssShapeControl
Control
Public Functions
-
SdssShapeTransform
(Control const &ctrl, std::string const &name, afw::table::SchemaMapper &mapper)
-
virtual void
operator()
(afw::table::SourceCatalog const &inputCatalog, afw::table::BaseCatalog &outputCatalog, afw::geom::SkyWcs const &wcs, afw::image::PhotoCalib const &photoCalib) const
Private Members
-
FluxTransform
_instFluxTransform
¶
-
CentroidTransform
_centroidTransform
¶
-
ShapeResultKey
_outShapeKey
¶
-
afw::table::QuadrupoleKey
_outPsfShapeKey
¶
-
bool
_transformPsf
¶
-
typedef SdssShapeControl
-
class
-
namespace