LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
|
#include <ApertureFlux.h>
Classes | |
struct | Keys |
Public Types | |
enum | FlagBits { FAILURE =0, APERTURE_TRUNCATED, SINC_COEFFS_TRUNCATED, N_FLAGS } |
typedef ApertureFluxControl | Control |
Typedef to the control object associated with this algorithm, defined above. More... | |
typedef ApertureFluxResult | Result |
Result object returned by static methods. More... | |
Public Member Functions | |
ApertureFluxAlgorithm (Control const &ctrl, std::string const &name, afw::table::Schema &schema, daf::base::PropertySet &metadata) | |
virtual | ~ApertureFluxAlgorithm () |
virtual void | measure (afw::table::SourceRecord &record, afw::image::Exposure< float > const &exposure) const =0 |
virtual void | fail (afw::table::SourceRecord &measRecord, MeasurementError *error=NULL) const |
Public Member Functions inherited from lsst::meas::base::SimpleAlgorithm | |
virtual void | measureForced (afw::table::SourceRecord &measRecord, afw::image::Exposure< float > const &exposure, afw::table::SourceRecord const &refRecord, afw::image::Wcs const &refWcs) const |
virtual void | measureNForced (afw::table::SourceCatalog const &measCat, afw::image::Exposure< float > const &exposure, afw::table::SourceCatalog const &refRecord, afw::image::Wcs const &refWcs) const |
Public Member Functions inherited from lsst::meas::base::SingleFrameAlgorithm | |
virtual void | measureN (afw::table::SourceCatalog const &measCat, afw::image::Exposure< float > const &exposure) const |
Public Member Functions inherited from lsst::meas::base::BaseAlgorithm | |
virtual | ~BaseAlgorithm () |
Static Public Member Functions | |
static std::string | makeFieldPrefix (std::string const &name, double radius) |
template<typename T > | |
static Result | computeSincFlux (afw::image::Image< T > const &image, afw::geom::ellipses::Ellipse const &ellipse, Control const &ctrl=Control()) |
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()) |
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()) |
template<typename T > | |
static Result | computeFlux (afw::image::MaskedImage< T > const &image, afw::geom::ellipses::Ellipse const &ellipse, Control const &ctrl=Control()) |
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 |
Private Attributes | |
std::vector< Keys > | _keys |
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 82 of file ApertureFlux.h.
Typedef to the control object associated with this algorithm, defined above.
Definition at line 94 of file ApertureFlux.h.
Result object returned by static methods.
Definition at line 97 of file ApertureFlux.h.
Enumerator | |
---|---|
FAILURE | |
APERTURE_TRUNCATED | |
SINC_COEFFS_TRUNCATED | |
N_FLAGS |
Definition at line 86 of file ApertureFlux.h.
|
explicit |
Construct the algorithm and add its fields to the given Schema.
Definition at line 80 of file ApertureFlux.cc.
|
inlinevirtual |
Definition at line 186 of file ApertureFlux.h.
|
static |
Compute the flux (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 fluxes. |
[in] | ellipse | Ellipse that defines the outer boundary of the aperture. |
[in] | ctrl | Control object. |
Definition at line 262 of file ApertureFlux.cc.
|
static |
Compute the flux (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 fluxes. |
[in] | ellipse | Ellipse that defines the outer boundary of the aperture. |
[in] | ctrl | Control object. |
Definition at line 273 of file ApertureFlux.cc.
|
static |
Compute the flux (and optionally, uncertanties) within an aperture using naive photometry
The naive algorithm just counts the flux 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 fluxes. |
[in] | ellipse | Ellipse that defines the outer boundary of the aperture. |
Definition at line 198 of file ApertureFlux.cc.
|
static |
Compute the flux (and optionally, uncertanties) within an aperture using naive photometry
The naive algorithm just counts the flux 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 fluxes. |
[in] | ellipse | Ellipse that defines the outer boundary of the aperture. |
Definition at line 226 of file ApertureFlux.cc.
|
static |
Compute the flux (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 fluxes. |
[in] | ellipse | Ellipse that defines the outer boundary of the aperture. |
[in] | ctrl | Control object. |
Definition at line 164 of file ApertureFlux.cc.
|
static |
Compute the flux (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 fluxes. |
[in] | ellipse | Ellipse that defines the outer boundary of the aperture. |
[in] | ctrl | Control object. |
Definition at line 179 of file ApertureFlux.cc.
|
protected |
Definition at line 107 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 98 of file ApertureFlux.cc.
|
inlineprotected |
Definition at line 225 of file ApertureFlux.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>_flux, <prefix>_fluxErr, etc.
[in] | pluginName | Name of measurement plugin. |
[in] | radius | Aperture radius (pixels). |
Definition at line 62 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.
|
protected |
Definition at line 228 of file ApertureFlux.h.
|
protected |
Definition at line 227 of file ApertureFlux.h.
|
private |
Definition at line 239 of file ApertureFlux.h.