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" 88 static unsigned int const N_FLAGS = 3;
110 template <
typename T>
111 static Result computeSincFlux(
112 afw::image::Image<T>
const & image,
113 afw::geom::ellipses::Ellipse
const & ellipse,
116 template <
typename T>
117 static Result computeSincFlux(
118 afw::image::MaskedImage<T>
const & image,
119 afw::geom::ellipses::Ellipse
const & ellipse,
134 template <
typename T>
135 static Result computeNaiveFlux(
136 afw::image::Image<T>
const & image,
137 afw::geom::ellipses::Ellipse
const & ellipse,
140 template <
typename T>
141 static Result computeNaiveFlux(
142 afw::image::MaskedImage<T>
const & image,
143 afw::geom::ellipses::Ellipse
const & ellipse,
160 template <
typename T>
161 static Result computeFlux(
162 afw::image::Image<T>
const & image,
163 afw::geom::ellipses::Ellipse
const & ellipse,
167 template <
typename T>
168 static Result computeFlux(
169 afw::image::MaskedImage<T>
const & image,
170 afw::geom::ellipses::Ellipse
const & ellipse,
179 Control
const & ctrl,
180 std::string
const & name,
181 afw::table::Schema & schema,
182 daf::base::PropertySet & metadata
195 virtual void measure(
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);
226 void copyResultToRecord(Result
const & result, afw::table::SourceRecord & record,
int index)
const;
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;
280 ApertureFluxTransform(Control
const & ctrl, std::string
const & name, afw::table::SchemaMapper & mapper);
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 bool getFlag(std::string const &name) const
Return the flag value associated with the given flag name.
bool getFlag(unsigned int index) const
Return the flag value associated with the given bit.
void setFlag(unsigned int index, bool value=true)
Set the flag value associated with the given bit.
static FlagDefinitionList const & getFlagDefinitions()
Simple class used to define and document flags The name and doc constitute the identity of the FlagDe...
Exception to be thrown when a measurement algorithm experiences a known failure mode.
Configuration object for multiple-aperture flux algorithms.
Utility class for handling flag fields that indicate the failure modes of an algorithm.
static FlagDefinition const FAILURE
static FlagDefinition const APERTURE_TRUNCATED
Base class for multiple-aperture photometry algorithms.
double maxSincRadius
"Maximum radius (in pixels) for which the sinc algorithm should be used instead of the " "faster naiv...
static FlagDefinition const SINC_COEFFS_TRUNCATED
FlagHandler const & getFlagHandler(int index) const
FlagDefinition getDefinition(std::size_t index) const
get a reference to the FlagDefinition with specified index.
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 ...
ApertureFluxControl Control
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.