24 #ifndef LSST_MEAS_BASE_ApertureFlux_h_INCLUDED
25 #define LSST_MEAS_BASE_ApertureFlux_h_INCLUDED
28 #include "lsst/pex/config.h"
29 #include "lsst/afw/image/Exposure.h"
30 #include "lsst/afw/table/arrays.h"
38 namespace lsst {
namespace meas {
namespace base {
49 radii, std::vector<double>,
50 "Radius (in pixels) of apertures."
55 "Maximum radius (in pixels) for which the sinc algorithm should be used instead of the "
56 "faster naive algorithm. For elliptical apertures, this is the minor axis radius."
61 "Warping kernel used to shift Sinc photometry coefficients to different center positions"
110 template <
typename T>
112 afw::image::Image<T>
const & image,
113 afw::geom::ellipses::Ellipse
const & ellipse,
116 template <
typename T>
118 afw::image::MaskedImage<T>
const & image,
119 afw::geom::ellipses::Ellipse
const & ellipse,
134 template <
typename T>
136 afw::image::Image<T>
const & image,
137 afw::geom::ellipses::Ellipse
const & ellipse,
140 template <
typename T>
142 afw::image::MaskedImage<T>
const & image,
143 afw::geom::ellipses::Ellipse
const & ellipse,
160 template <
typename T>
162 afw::image::Image<T>
const & image,
163 afw::geom::ellipses::Ellipse
const & ellipse,
167 template <
typename T>
169 afw::image::MaskedImage<T>
const & image,
170 afw::geom::ellipses::Ellipse
const & ellipse,
180 std::string
const & name,
181 afw::table::Schema & schema,
182 daf::base::PropertySet & metadata
196 afw::table::SourceRecord & record,
197 afw::image::Exposure<float>
const & exposure
202 afw::table::SourceRecord & measRecord,
218 static std::string
makeFieldPrefix(std::string
const & name,
double radius);
239 Keys(afw::table::Schema & schema, std::string
const & prefix, std::string
const & doc,
bool isSinc);
242 std::vector<Keys> _keys;
254 bool getFlag(
unsigned int index)
const {
return _flags[index]; }
257 bool getFlag(std::string
const & name)
const {
262 void setFlag(
unsigned int index,
bool value=
true) { _flags[index] = value; }
265 void unsetFlag(
unsigned int index) { _flags[index] =
false; }
268 std::bitset<ApertureFluxAlgorithm::N_FLAGS> _flags;
291 virtual void operator()(afw::table::SourceCatalog
const & inputCatalog,
292 afw::table::BaseCatalog & outputCatalog,
293 afw::image::Wcs
const & wcs,
294 afw::image::Calib
const & calib)
const;
296 std::vector<MagResultKey> _magKeys;
302 #endif // !LSST_MEAS_BASE_ApertureFlux_h_INCLUDED
FlagDefinition getDefinition(std::size_t index) const
get a reference to the FlagDefinition with specified index.
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...
static unsigned int const N_FLAGS
void setFlag(unsigned int index, bool value=true)
Set the flag value associated with the given bit.
Simple class used to define and document flags The name and doc constitute the identity of the FlagDe...
virtual void measure(afw::table::SourceRecord &record, afw::image::Exposure< float > const &exposure) const =0
Measure the configured apertures on the given image.
static FlagDefinitionList const & getFlagDefinitions()
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.
Exception to be thrown when a measurement algorithm experiences a known failure mode.
void copyResultToRecord(Result const &result, afw::table::SourceRecord &record, int index) const
Return the flag definitions which apply to aperture flux measurements.
Configuration object for multiple-aperture flux algorithms.
Utility class for handling flag fields that indicate the failure modes of an algorithm.
bool getFlag(std::string const &name) const
Return the flag value associated with the given flag name.
static FlagDefinition const FAILURE
static FlagDefinition const APERTURE_TRUNCATED
Base class for multiple-aperture photometry algorithms.
static Result computeFlux(afw::image::Image< T > const &image, afw::geom::ellipses::Ellipse const &ellipse, Control const &ctrl=Control())
Compute the flux (and optionally, uncertanties) within an aperture using the algorithm determined by ...
double maxSincRadius
"Maximum radius (in pixels) for which the sinc algorithm should be used instead of the " "faster naiv...
static std::string makeFieldPrefix(std::string const &name, double radius)
Construct an appropriate prefix for table fields.
static FlagDefinition const SINC_COEFFS_TRUNCATED
static Result computeNaiveFlux(afw::image::Image< T > const &image, afw::geom::ellipses::Ellipse const &ellipse, Control const &ctrl=Control())
Compute the flux (and optionally, uncertanties) within an aperture using naive photometry.
FlagHandler const & getFlagHandler(int index) const
A FunctorKey for FluxResult.
void unsetFlag(unsigned int index)
Clear (i.e. set to false) the flag associated with the given bit.
An abstract base classes for which the same implementation can be used for both SingleFrameAlgorithm ...
bool getFlag(unsigned int index) const
Return the flag value associated with the given bit.
ApertureFluxControl Control
static Result computeSincFlux(afw::image::Image< T > const &image, afw::geom::ellipses::Ellipse const &ellipse, Control const &ctrl=Control())
Compute the flux (and optionally, uncertanties) within an aperture using Sinc photometry.
std::string shiftKernel
"Warping kernel used to shift Sinc photometry coefficients to different center positions" ; ...
std::vector< double > radii
"Radius (in pixels) of apertures." ;
vector-type utility class to build a collection of FlagDefinitions
ApertureFluxResult Result
Result object returned by static methods.
A reusable result struct for flux measurements.
SafeCentroidExtractor _centroidExtractor
virtual ~ApertureFluxAlgorithm()
A Result struct for running an aperture flux algorithm with a single radius.