LSST Applications g1653933729+a8ce1bb630,g171997e3ee+76e92115be,g1a997c3884+a8ce1bb630,g28da252d5a+4013ff5194,g2bbee38e9b+d6d0f9f6ae,g2bc492864f+d6d0f9f6ae,g2cdde0e794+ccb74358b7,g3156d2b45e+07302053f8,g347aa1857d+d6d0f9f6ae,g35bb328faa+a8ce1bb630,g3a166c0a6a+d6d0f9f6ae,g3e281a1b8c+130fae20e3,g4005a62e65+17cd334064,g414038480c+c9f68e2a12,g41af890bb2+3e1f62f438,g4e1a3235cc+9db7d56ad0,g7b55021d1b+7b623691d5,g80478fca09+334cc8d2bd,g82479be7b0+b568f6b267,g858d7b2824+37b39d8760,g9125e01d80+a8ce1bb630,ga5288a1d22+11cb34fefe,gae0086650b+a8ce1bb630,gb4ec7eb0ab+37b39d8760,gb58c049af0+d64f4d3760,gc081298178+284e133171,gc28159a63d+d6d0f9f6ae,gcf0d15dbbd+00fe2e0b07,gd6b7c0dfd1+8b62435e69,gda3e153d99+37b39d8760,gda6a2b7d83+00fe2e0b07,gdaeeff99f8+1711a396fd,gdd5a9049c5+23f3b3239a,ge2409df99d+5d9f551a54,ge33fd446bb+37b39d8760,ge79ae78c31+d6d0f9f6ae,gf0baf85859+2dea8344a2,gf5289d68f6+3777f3df5e,w.2024.41
LSST Data Management Base Package
|
Base class for multiple-aperture photometry algorithms. More...
#include <ApertureFlux.h>
Public Types | |
typedef ApertureFluxControl | Control |
typedef ApertureFluxResult | Result |
Result object returned by static methods. | |
Public Member Functions | |
ApertureFluxAlgorithm (Control const &ctrl, std::string const &name, afw::table::Schema &schema, daf::base::PropertySet &metadata) | |
Construct the algorithm and add its fields to the given Schema. | |
virtual | ~ApertureFluxAlgorithm () |
virtual void | measure (afw::table::SourceRecord &record, afw::image::Exposure< float > const &exposure) const =0 |
Measure the configured apertures on the given image. | |
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. | |
void | measureForced (afw::table::SourceRecord &measRecord, afw::image::Exposure< float > const &exposure, afw::table::SourceRecord const &refRecord, afw::geom::SkyWcs const &refWcs) const override |
Called to measure a single child source in an image. | |
void | measureNForced (afw::table::SourceCatalog const &measCat, afw::image::Exposure< float > const &exposure, afw::table::SourceCatalog const &refRecord, afw::geom::SkyWcs const &refWcs) const override |
Called to simultaneously measure all children in a deblend family, in a single image. | |
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. | |
std::string | getLogName () const |
Static Public Member Functions | |
static FlagDefinitionList const & | getFlagDefinitions () |
template<typename T > | |
static Result | computeSincFlux (afw::image::Image< T > const &image, afw::geom::ellipses::Ellipse const &ellipse, Control const &ctrl=Control()) |
Compute the instFlux (and optionally, uncertanties) within an aperture using Sinc photometry. | |
template<typename T > | |
static Result | computeSincFlux (afw::image::MaskedImage< T > const &image, afw::geom::ellipses::Ellipse const &ellipse, Control const &ctrl=Control()) |
template<typename T > | |
static Result | computeNaiveFlux (afw::image::Image< T > const &image, afw::geom::ellipses::Ellipse const &ellipse, Control const &ctrl=Control()) |
Compute the instFlux (and optionally, uncertanties) within an aperture using naive photometry. | |
template<typename T > | |
static Result | computeNaiveFlux (afw::image::MaskedImage< T > const &image, afw::geom::ellipses::Ellipse const &ellipse, Control const &ctrl=Control()) |
template<typename T > | |
static Result | computeFlux (afw::image::Image< T > const &image, afw::geom::ellipses::Ellipse const &ellipse, Control const &ctrl=Control()) |
Compute the instFlux (and optionally, uncertanties) within an aperture using the algorithm determined by its size and the maxSincRadius control parameter. | |
template<typename T > | |
static Result | computeFlux (afw::image::MaskedImage< T > const &image, afw::geom::ellipses::Ellipse const &ellipse, Control const &ctrl=Control()) |
static std::string | makeFieldPrefix (std::string const &name, double radius) |
Construct an appropriate prefix for table fields. | |
Static Public Attributes | |
static unsigned int const | N_FLAGS = 3 |
static FlagDefinition const | FAILURE = flagDefinitions.addFailureFlag() |
static FlagDefinition const | APERTURE_TRUNCATED |
static FlagDefinition const | SINC_COEFFS_TRUNCATED |
Protected Member Functions | |
void | copyResultToRecord (Result const &result, afw::table::SourceRecord &record, int index) const |
FlagHandler const & | getFlagHandler (int index) const |
Protected Attributes | |
Control const | _ctrl |
SafeCentroidExtractor | _centroidExtractor |
std::string | _logName |
Base class for multiple-aperture photometry algorithms.
ApertureFluxAlgorithm serves as an intermediate base class for all aperture fluxes, which it assumes have that capability of measuring multiple apertures (even if they are not always configured to do so).
Concrete implementations for single-aperture flux measurements are provided as static methods, as well as a consistent interface and control object for its derived classes. Currently, we only have one derived class, CircularApertureFluxAlgorithm, but in the future we anticipate adding more derived classes for e.g. elliptical apertures, or apertures that are circular in sky coordinates rather than pixel coordinates.
Definition at line 80 of file ApertureFlux.h.
Definition at line 89 of file ApertureFlux.h.
Result object returned by static methods.
Definition at line 92 of file ApertureFlux.h.
|
explicit |
Construct the algorithm and add its fields to the given Schema.
Definition at line 71 of file ApertureFlux.cc.
|
inlinevirtual |
Definition at line 163 of file ApertureFlux.h.
|
static |
Compute the instFlux (and optionally, uncertanties) within an aperture using the algorithm determined by its size and the maxSincRadius control parameter.
This method delegates to computeSincFlux is the minor axis of the aperture is smaller than ctrl.maxSincRadius, and delegates to computeNaiveFlux otherwise.
[in] | image | Image or MaskedImage to be measured. If a MaskedImage is provided, uncertainties will be returned as well as instFluxes. |
[in] | ellipse | Ellipse that defines the outer boundary of the aperture. |
[in] | ctrl | Control object. |
Definition at line 223 of file ApertureFlux.cc.
|
static |
Definition at line 232 of file ApertureFlux.cc.
|
static |
Compute the instFlux (and optionally, uncertanties) within an aperture using naive photometry.
The naive algorithm just counts the instFlux in pixels whose centers lie within the aperture, ignoring the effects of sub-pixel aperture boundaries.
[in] | image | Image or MaskedImage to be measured. If a MaskedImage is provided, uncertainties will be returned as well as instFluxes. |
[in] | ellipse | Ellipse that defines the outer boundary of the aperture. |
Definition at line 176 of file ApertureFlux.cc.
|
static |
Definition at line 196 of file ApertureFlux.cc.
|
static |
Compute the instFlux (and optionally, uncertanties) within an aperture using Sinc photometry.
The Sinc algorithm is slower than a naive aperture, but more accurate, in that it correctly handles sub-pixel aperture boundaries on well-sampled data. This improved accuracy is most important for smaller apertures.
[in] | image | Image or MaskedImage to be measured. If a MaskedImage is provided, uncertainties will be returned as well as instFluxes. |
[in] | ellipse | Ellipse that defines the outer boundary of the aperture. |
[in] | ctrl | Control object. |
Definition at line 146 of file ApertureFlux.cc.
|
static |
Definition at line 158 of file ApertureFlux.cc.
|
protected |
Definition at line 96 of file ApertureFlux.cc.
|
virtual |
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.
Implements lsst::meas::base::BaseAlgorithm.
Definition at line 87 of file ApertureFlux.cc.
|
static |
Definition at line 49 of file ApertureFlux.cc.
|
inlineprotected |
Definition at line 196 of file ApertureFlux.h.
|
inlineinherited |
Definition at line 66 of file Algorithm.h.
|
static |
Construct an appropriate prefix for table fields.
Given a plugin name (e.g. base_CircularApertureFlux) and an aperture radius (e.g. 12 pixels) return an appropriate prefix for table fields to contain the measurement results (e.g. base_CircularApertureFlux_12_0). Table fields can then be created named <prefix>_instFlux, <prefix>_instFluxErr, etc.
[in] | pluginName | Name of measurement plugin. |
[in] | radius | Aperture radius (pixels). |
Definition at line 57 of file ApertureFlux.cc.
|
pure virtual |
Measure the configured apertures on the given image.
Python plugins will delegate to this method.
[in,out] | record | Record used to save outputs and retrieve positions. |
[in] | exposure | Image to be measured. |
Implements lsst::meas::base::SingleFrameAlgorithm.
Implemented in lsst::meas::base::CircularApertureFluxAlgorithm.
|
inlineoverridevirtualinherited |
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.
Implements lsst::meas::base::ForcedAlgorithm.
Reimplemented in lsst::meas::extensions::photometryKron::KronFluxAlgorithm.
Definition at line 172 of file Algorithm.h.
|
virtualinherited |
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.
Definition at line 31 of file Algorithm.cc.
|
inlineoverridevirtualinherited |
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.
Reimplemented from lsst::meas::base::ForcedAlgorithm.
Definition at line 179 of file Algorithm.h.
|
protected |
Definition at line 199 of file ApertureFlux.h.
|
protected |
Definition at line 198 of file ApertureFlux.h.
|
protectedinherited |
Definition at line 69 of file Algorithm.h.
|
static |
Definition at line 86 of file ApertureFlux.h.
|
static |
Definition at line 85 of file ApertureFlux.h.
|
static |
Definition at line 84 of file ApertureFlux.h.
|
static |
Definition at line 87 of file ApertureFlux.h.