LSSTApplications  19.0.0-14-gb0260a2+72efe9b372,20.0.0+7927753e06,20.0.0+8829bf0056,20.0.0+995114c5d2,20.0.0+b6f4b2abd1,20.0.0+bddc4f4cbe,20.0.0-1-g253301a+8829bf0056,20.0.0-1-g2b7511a+0d71a2d77f,20.0.0-1-g5b95a8c+7461dd0434,20.0.0-12-g321c96ea+23efe4bbff,20.0.0-16-gfab17e72e+fdf35455f6,20.0.0-2-g0070d88+ba3ffc8f0b,20.0.0-2-g4dae9ad+ee58a624b3,20.0.0-2-g61b8584+5d3db074ba,20.0.0-2-gb780d76+d529cf1a41,20.0.0-2-ged6426c+226a441f5f,20.0.0-2-gf072044+8829bf0056,20.0.0-2-gf1f7952+ee58a624b3,20.0.0-20-geae50cf+e37fec0aee,20.0.0-25-g3dcad98+544a109665,20.0.0-25-g5eafb0f+ee58a624b3,20.0.0-27-g64178ef+f1f297b00a,20.0.0-3-g4cc78c6+e0676b0dc8,20.0.0-3-g8f21e14+4fd2c12c9a,20.0.0-3-gbd60e8c+187b78b4b8,20.0.0-3-gbecbe05+48431fa087,20.0.0-38-ge4adf513+a12e1f8e37,20.0.0-4-g97dc21a+544a109665,20.0.0-4-gb4befbc+087873070b,20.0.0-4-gf910f65+5d3db074ba,20.0.0-5-gdfe0fee+199202a608,20.0.0-5-gfbfe500+d529cf1a41,20.0.0-6-g64f541c+d529cf1a41,20.0.0-6-g9a5b7a1+a1cd37312e,20.0.0-68-ga3f3dda+5fca18c6a4,20.0.0-9-g4aef684+e18322736b,w.2020.45
LSSTDataManagementBasePackage
ApertureFlux.cc
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 /*
3  * LSST Data Management System
4  * Copyright 2008-2016 AURA/LSST.
5  *
6  * This product includes software developed by the
7  * LSST Project (http://www.lsst.org/).
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the LSST License Statement and
20  * the GNU General Public License along with this program. If not,
21  * see <http://www.lsstcorp.org/LegalNotices/>.
22  */
23 
24 #include <numeric>
25 
26 #include "boost/algorithm/string.hpp"
27 
28 #include "ndarray/eigen.h"
29 
32 #include "lsst/afw/table/Source.h"
35 
36 namespace lsst {
37 namespace meas {
38 namespace base {
39 namespace {
40 FlagDefinitionList flagDefinitions;
41 } // namespace
42 
43 FlagDefinition const ApertureFluxAlgorithm::FAILURE = flagDefinitions.addFailureFlag();
44 FlagDefinition const ApertureFluxAlgorithm::APERTURE_TRUNCATED =
45  flagDefinitions.add("flag_apertureTruncated", "aperture did not fit within measurement image");
46 FlagDefinition const ApertureFluxAlgorithm::SINC_COEFFS_TRUNCATED = flagDefinitions.add(
47  "flag_sincCoeffsTruncated", "full sinc coefficient image did not fit within measurement image");
48 
50 
51 ApertureFluxControl::ApertureFluxControl() : radii(10), maxSincRadius(10.0), shiftKernel("lanczos5") {
52  // defaults here stolen from HSC pipeline defaults
53  static std::array<double, 10> defaultRadii = {{3.0, 4.5, 6.0, 9.0, 12.0, 17.0, 25.0, 35.0, 50.0, 70.0}};
54  std::copy(defaultRadii.begin(), defaultRadii.end(), radii.begin());
55 }
56 
58  std::string prefix = (boost::format("%s_%.1f") % name % radius).str();
59  return boost::replace_all_copy(prefix, ".", "_");
60 }
61 
62 ApertureFluxAlgorithm::Keys::Keys(afw::table::Schema &schema, std::string const &prefix,
63  std::string const &doc, bool isSinc)
64  : instFluxKey(FluxResultKey::addFields(schema, prefix, doc)),
65  flags(
66  // The exclusion List can either be empty, or constain the sinc coeffs flag
67  FlagHandler::addFields(
68  schema, prefix, ApertureFluxAlgorithm::getFlagDefinitions(),
70 
73 
74  )
75  : _ctrl(ctrl), _centroidExtractor(schema, name) {
76  _keys.reserve(ctrl.radii.size());
77  for (std::size_t i = 0; i < ctrl.radii.size(); ++i) {
78  std::string upperName(name);
79  boost::to_upper(upperName);
80  metadata.add(upperName + "_RADII", ctrl.radii[i]);
82  std::string doc = (boost::format("instFlux within %f-pixel aperture") % ctrl.radii[i]).str();
83  _keys.push_back(Keys(schema, prefix, doc, ctrl.radii[i] <= ctrl.maxSincRadius));
84  }
85 }
86 
88  // This should only get called in the case of completely unexpected failures, so it's not terrible
89  // that we just set the general failure flags for all radii here instead of trying to figure out
90  // which ones we've already done. Any known failure modes are handled inside measure().
91  for (std::size_t i = 0; i < _ctrl.radii.size(); ++i) {
92  _keys[i].flags.handleFailure(measRecord, error);
93  }
94 }
95 
97  int index) const {
98  record.set(_keys[index].instFluxKey, result);
99  if (result.getFlag(FAILURE.number)) {
100  _keys[index].flags.setValue(record, FAILURE.number, true);
101  }
102  if (result.getFlag(APERTURE_TRUNCATED.number)) {
103  _keys[index].flags.setValue(record, APERTURE_TRUNCATED.number, true);
104  }
105  if (result.getFlag(SINC_COEFFS_TRUNCATED.number)) {
106  _keys[index].flags.setValue(record, SINC_COEFFS_TRUNCATED.number, true);
107  }
108 }
109 
110 namespace {
111 
112 // Helper function for computeSincFlux get Sinc instFlux coefficients, and handle cases where the coeff
113 // image needs to be clipped to fit in the measurement image
114 template <typename T>
116 getSincCoeffs(geom::Box2I const &bbox, // measurement image bbox we need to fit inside
117  afw::geom::ellipses::Ellipse const &ellipse, // ellipse that defines the aperture
118  ApertureFluxAlgorithm::Result &result, // result object where we set flags if we do clip
119  ApertureFluxAlgorithm::Control const &ctrl // configuration
120 ) {
121  CONST_PTR(afw::image::Image<T>) cImage = SincCoeffs<T>::get(ellipse.getCore(), 0.0);
122  cImage = afw::math::offsetImage(*cImage, ellipse.getCenter().getX(), ellipse.getCenter().getY(),
123  ctrl.shiftKernel);
124  if (!bbox.contains(cImage->getBBox())) {
125  // We had to clip out at least part part of the coeff image,
126  // but since that's much larger than the aperture (and close
127  // to zero outside the aperture), it may not be a serious
128  // problem.
130  geom::Box2I overlap = cImage->getBBox();
131  overlap.clip(bbox);
132  if (!overlap.contains(geom::Box2I(ellipse.computeBBox()))) {
133  // The clipping was indeed serious, as we we did have to clip within
134  // the aperture; can't expect any decent answer at this point.
136  result.setFlag(ApertureFluxAlgorithm::FAILURE.number);
137  }
138  cImage = std::make_shared<afw::image::Image<T> >(*cImage, overlap);
139  }
140  return cImage;
141 }
142 
143 } // namespace
144 
145 template <typename T>
147  afw::image::Image<T> const &image, afw::geom::ellipses::Ellipse const &ellipse, Control const &ctrl) {
148  Result result;
149  CONST_PTR(afw::image::Image<T>) cImage = getSincCoeffs<T>(image.getBBox(), ellipse, result, ctrl);
150  if (result.getFlag(APERTURE_TRUNCATED.number)) return result;
151  afw::image::Image<T> subImage(image, cImage->getBBox());
152  result.instFlux =
153  (ndarray::asEigenArray(subImage.getArray()) * ndarray::asEigenArray(cImage->getArray())).sum();
154  return result;
155 }
156 
157 template <typename T>
160  Control const &ctrl) {
161  Result result;
162  CONST_PTR(afw::image::Image<T>) cImage = getSincCoeffs<T>(image.getBBox(), ellipse, result, ctrl);
163  if (result.getFlag(APERTURE_TRUNCATED.number)) return result;
165  result.instFlux = (ndarray::asEigenArray(subImage.getImage()->getArray()) *
166  ndarray::asEigenArray(cImage->getArray()))
167  .sum();
168  result.instFluxErr =
169  std::sqrt((ndarray::asEigenArray(subImage.getVariance()->getArray()).template cast<T>() *
170  ndarray::asEigenArray(cImage->getArray()).square())
171  .sum());
172  return result;
173 }
174 
175 template <typename T>
177  afw::image::Image<T> const &image, afw::geom::ellipses::Ellipse const &ellipse, Control const &ctrl) {
178  Result result;
179  afw::geom::ellipses::PixelRegion region(ellipse); // behaves mostly like a Footprint
180  if (!image.getBBox().contains(region.getBBox())) {
182  result.setFlag(FAILURE.number);
183  return result;
184  }
185  result.instFlux = 0;
186  for (afw::geom::ellipses::PixelRegion::Iterator spanIter = region.begin(), spanEnd = region.end();
187  spanIter != spanEnd; ++spanIter) {
188  typename afw::image::Image<T>::x_iterator pixIter =
189  image.x_at(spanIter->getBeginX() - image.getX0(), spanIter->getY() - image.getY0());
190  result.instFlux += std::accumulate(pixIter, pixIter + spanIter->getWidth(), 0.0);
191  }
192  return result;
193 }
194 
195 template <typename T>
198  Control const &ctrl) {
199  Result result;
200  afw::geom::ellipses::PixelRegion region(ellipse); // behaves mostly like a Footprint
201  if (!image.getBBox().contains(region.getBBox())) {
203  result.setFlag(FAILURE.number);
204  return result;
205  }
206  result.instFlux = 0.0;
207  result.instFluxErr = 0.0;
208  for (afw::geom::ellipses::PixelRegion::Iterator spanIter = region.begin(), spanEnd = region.end();
209  spanIter != spanEnd; ++spanIter) {
210  typename afw::image::MaskedImage<T>::Image::x_iterator pixIter = image.getImage()->x_at(
211  spanIter->getBeginX() - image.getX0(), spanIter->getY() - image.getY0());
212  typename afw::image::MaskedImage<T>::Variance::x_iterator varIter = image.getVariance()->x_at(
213  spanIter->getBeginX() - image.getX0(), spanIter->getY() - image.getY0());
214  result.instFlux += std::accumulate(pixIter, pixIter + spanIter->getWidth(), 0.0);
215  // we use this to hold variance as we accumulate...
216  result.instFluxErr += std::accumulate(varIter, varIter + spanIter->getWidth(), 0.0);
217  }
218  result.instFluxErr = std::sqrt(result.instFluxErr); // ...and switch back to sigma here.
219  return result;
220 }
221 
222 template <typename T>
224  afw::geom::ellipses::Ellipse const &ellipse,
225  Control const &ctrl) {
226  return (afw::geom::ellipses::Axes(ellipse.getCore()).getB() <= ctrl.maxSincRadius)
227  ? computeSincFlux(image, ellipse, ctrl)
228  : computeNaiveFlux(image, ellipse, ctrl);
229 }
230 
231 template <typename T>
233  afw::geom::ellipses::Ellipse const &ellipse,
234  Control const &ctrl) {
235  return (afw::geom::ellipses::Axes(ellipse.getCore()).getB() <= ctrl.maxSincRadius)
236  ? computeSincFlux(image, ellipse, ctrl)
237  : computeNaiveFlux(image, ellipse, ctrl);
238 }
239 #define INSTANTIATE(T) \
240  template ApertureFluxAlgorithm::Result ApertureFluxAlgorithm::computeFlux( \
241  afw::image::Image<T> const &, afw::geom::ellipses::Ellipse const &, Control const &); \
242  template ApertureFluxAlgorithm::Result ApertureFluxAlgorithm::computeFlux( \
243  afw::image::MaskedImage<T> const &, afw::geom::ellipses::Ellipse const &, Control const &); \
244  template ApertureFluxAlgorithm::Result ApertureFluxAlgorithm::computeSincFlux( \
245  afw::image::Image<T> const &, afw::geom::ellipses::Ellipse const &, Control const &); \
246  template ApertureFluxAlgorithm::Result ApertureFluxAlgorithm::computeSincFlux( \
247  afw::image::MaskedImage<T> const &, afw::geom::ellipses::Ellipse const &, Control const &); \
248  template ApertureFluxAlgorithm::Result ApertureFluxAlgorithm::computeNaiveFlux( \
249  afw::image::Image<T> const &, afw::geom::ellipses::Ellipse const &, Control const &); \
250  template ApertureFluxAlgorithm::Result ApertureFluxAlgorithm::computeNaiveFlux( \
251  afw::image::MaskedImage<T> const &, afw::geom::ellipses::Ellipse const &, Control const &)
252 
253 INSTANTIATE(float);
254 INSTANTIATE(double);
255 
258  : BaseTransform(name), _ctrl(ctrl) {
259  for (std::size_t i = 0; i < _ctrl.radii.size(); ++i) {
262  if (_ctrl.radii[i] > _ctrl.maxSincRadius &&
264  continue;
265  }
266  mapper.addMapping(
267  mapper.getInputSchema()
268  .find<afw::table::Flag>(
269  (boost::format("%s_%s") %
271  .str())
272  .key);
273  }
274  _magKeys.push_back(MagResultKey::addFields(
275  mapper.editOutputSchema(), ApertureFluxAlgorithm::makeFieldPrefix(name, _ctrl.radii[i])));
276  }
277 }
278 
280  afw::table::BaseCatalog &outputCatalog, afw::geom::SkyWcs const &wcs,
281  afw::image::PhotoCalib const &photoCalib) const {
282  checkCatalogSize(inputCatalog, outputCatalog);
283  std::vector<FluxResultKey> instFluxKeys;
284  for (std::size_t i = 0; i < _ctrl.radii.size(); ++i) {
285  instFluxKeys.push_back(FluxResultKey(
286  inputCatalog.getSchema()[ApertureFluxAlgorithm::makeFieldPrefix(_name, _ctrl.radii[i])]));
287  }
288  afw::table::SourceCatalog::const_iterator inSrc = inputCatalog.begin();
289  afw::table::BaseCatalog::iterator outSrc = outputCatalog.begin();
290  {
291  for (; inSrc != inputCatalog.end() && outSrc != outputCatalog.end(); ++inSrc, ++outSrc) {
292  for (std::size_t i = 0; i < _ctrl.radii.size(); ++i) {
293  FluxResult instFluxResult = instFluxKeys[i].get(*inSrc);
294  _magKeys[i].set(*outSrc, photoCalib.instFluxToMagnitude(instFluxResult.instFlux,
295  instFluxResult.instFluxErr));
296  }
297  }
298  }
299 }
300 
301 } // namespace base
302 } // namespace meas
303 } // namespace lsst
schema
table::Schema schema
Definition: Amplifier.cc:115
lsst::afw::table::CatalogT::end
iterator end()
Definition: Catalog.h:397
lsst::afw::image
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
Definition: imageAlgorithm.dox:1
offsetImage.h
lsst::meas::base::ApertureFluxAlgorithm::computeFlux
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...
Definition: ApertureFlux.cc:223
lsst::afw::geom::ellipses::PixelRegion::getBBox
lsst::geom::Box2I const & getBBox() const
Return the bounding box of the pixel region.
Definition: PixelRegion.h:80
lsst::meas::base::FlagDefinition::number
std::size_t number
Definition: FlagHandler.h:54
std::string
STL class.
lsst::meas::base::FluxResult::instFlux
meas::base::Flux instFlux
Measured instFlux in DN.
Definition: FluxUtilities.h:42
lsst::meas::base::FluxResult
A reusable result struct for instFlux measurements.
Definition: FluxUtilities.h:41
lsst::log.log.logContinued.error
def error(fmt, *args)
Definition: logContinued.py:213
lsst::meas::base::ApertureFluxAlgorithm::APERTURE_TRUNCATED
static FlagDefinition const APERTURE_TRUNCATED
Definition: ApertureFlux.h:86
lsst::afw::table::SourceRecord
Record class that contains measurements made on a single exposure.
Definition: Source.h:80
lsst::afw::geom::ellipses::PixelRegion::Iterator
std::vector< Span >::const_iterator Iterator
Iterator type used by begin() and end().
Definition: PixelRegion.h:50
lsst::afw::geom::ellipses::Axes::getB
double const getB() const
Definition: Axes.h:54
std::vector::reserve
T reserve(T... args)
wcs
table::Key< table::Array< std::uint8_t > > wcs
Definition: SkyWcs.cc:71
lsst::afw::geom::ellipses::Ellipse::computeBBox
lsst::geom::Box2D computeBBox() const
Return the bounding box of the ellipse.
Definition: Ellipse.cc:55
std::vector
STL class.
lsst::daf::base::PropertySet::add
void add(std::string const &name, T const &value)
Append a single value to the vector of values for a property name (possibly hierarchical).
std::vector::size
T size(T... args)
lsst::meas::base::MeasurementError
Exception to be thrown when a measurement algorithm experiences a known failure mode.
Definition: exceptions.h:48
lsst::meas::base::ApertureFluxTransform::operator()
virtual void operator()(afw::table::SourceCatalog const &inputCatalog, afw::table::BaseCatalog &outputCatalog, afw::geom::SkyWcs const &wcs, afw::image::PhotoCalib const &photoCalib) const
Definition: ApertureFlux.cc:279
lsst::afw::table::Schema
Defines the fields and offsets for a table.
Definition: Schema.h:50
lsst::afw::geom::ellipses::Axes
An ellipse core for the semimajor/semiminor axis and position angle parametrization (a,...
Definition: Axes.h:47
lsst.pex.config.history.format
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:174
lsst::afw::geom::SkyWcs
A 2-dimensional celestial WCS that transform pixels to ICRS RA/Dec, using the LSST standard for pixel...
Definition: SkyWcs.h:117
lsst::afw::image::MaskedImage::getWidth
int getWidth() const
Return the number of columns in the image.
Definition: MaskedImage.h:1082
lsst.pipe.tasks.processCcdWithFakes.radius
radius
Definition: processCcdWithFakes.py:345
lsst::afw::geom.transform.transformContinued.name
string name
Definition: transformContinued.py:32
lsst::meas::base::FlagDefinition::name
std::string name
Definition: FlagHandler.h:52
lsst::meas::base::ApertureFluxResult
A Result struct for running an aperture flux algorithm with a single radius.
Definition: ApertureFlux.h:217
lsst::meas::base::FluxResultKey
A FunctorKey for FluxResult.
Definition: FluxUtilities.h:59
lsst::meas::base::ApertureFluxControl::shiftKernel
std::string shiftKernel
"Warping kernel used to shift Sinc photometry coefficients to different center positions" ;
Definition: ApertureFlux.h:62
std::sqrt
T sqrt(T... args)
lsst::meas::base::ApertureFluxAlgorithm::FAILURE
static FlagDefinition const FAILURE
Definition: ApertureFlux.h:85
lsst::meas::base::SincCoeffs::get
static boost::shared_ptr< CoeffT const > get(afw::geom::ellipses::Axes const &outerEllipse, float const innerRadiusFactor=0.0)
Get the coefficients for an aperture.
Definition: SincCoeffs.cc:505
lsst::meas::base::FlagDefinitionList
vector-type utility class to build a collection of FlagDefinitions
Definition: FlagHandler.h:60
std::vector::push_back
T push_back(T... args)
lsst::meas::base::FluxResult::instFluxErr
meas::base::FluxErrElement instFluxErr
Standard deviation of instFlux in DN.
Definition: FluxUtilities.h:43
ApertureFlux.h
lsst::afw::image::MaskedImage
A class to manipulate images, masks, and variance as a single object.
Definition: MaskedImage.h:73
lsst::meas::base::ApertureFluxControl::maxSincRadius
double maxSincRadius
"Maximum radius (in pixels) for which the sinc algorithm should be used instead of the " "faster naiv...
Definition: ApertureFlux.h:58
lsst::meas::base::BaseTransform::_name
std::string _name
Definition: Transform.h:107
lsst::meas::base::FlagHandler
Utility class for handling flag fields that indicate the failure modes of an algorithm.
Definition: FlagHandler.h:148
lsst::afw::geom::ellipses::PixelRegion::begin
Iterator begin() const
Iterator range over Spans whose pixels are within the Ellipse.
Definition: PixelRegion.h:68
lsst::meas::base::ApertureFluxAlgorithm::copyResultToRecord
void copyResultToRecord(Result const &result, afw::table::SourceRecord &record, int index) const
Definition: ApertureFlux.cc:96
lsst::afw::geom::ellipses::Ellipse::getCenter
lsst::geom::Point2D const & getCenter() const
Return the center point.
Definition: Ellipse.h:62
lsst::meas::base::BaseTransform::checkCatalogSize
void checkCatalogSize(afw::table::BaseCatalog const &cat1, afw::table::BaseCatalog const &cat2) const
Ensure that catalogs have the same size.
Definition: Transform.h:102
lsst::afw::table._source.SourceCatalog
Definition: _source.py:32
lsst::geom::Box2I::contains
bool contains(Point2I const &point) const noexcept
Return true if the box contains the point.
Definition: Box.cc:114
lsst::afw::table::SchemaMapper
A mapping between the keys of two Schemas, used to copy data between them.
Definition: SchemaMapper.h:21
std::array
STL class.
lsst::meas::base::MagResultKey::addFields
static MagResultKey addFields(afw::table::Schema &schema, std::string const &name)
Add a pair of _mag, _magErr fields to a Schema, and return a MagResultKey that points to them.
Definition: FluxUtilities.cc:57
INSTANTIATE
#define INSTANTIATE(T)
Definition: ApertureFlux.cc:239
lsst::afw::table::CatalogIterator
Iterator class for CatalogT.
Definition: Catalog.h:39
std::copy
T copy(T... args)
lsst::afw::image::ImageBase::getArray
Array getArray()
Definition: ImageBase.h:474
std::accumulate
T accumulate(T... args)
lsst::afw::image::PhotoCalib
The photometric calibration of an exposure.
Definition: PhotoCalib.h:114
CONST_PTR
#define CONST_PTR(...)
A shared pointer to a const object.
Definition: base.h:47
result
py::object result
Definition: _schema.cc:429
lsst::afw::geom::ellipses::PixelRegion::end
Iterator end() const
Definition: PixelRegion.h:69
lsst::afw::image::ImageBase::x_iterator
_view_t::x_iterator x_iterator
An iterator for traversing the pixels in a row.
Definition: ImageBase.h:133
Source.h
lsst::meas::base::ApertureFluxAlgorithm::makeFieldPrefix
static std::string makeFieldPrefix(std::string const &name, double radius)
Construct an appropriate prefix for table fields.
Definition: ApertureFlux.cc:57
lsst
A base class for image defects.
Definition: imageAlgorithm.dox:1
lsst::afw::image::MaskedImage::getVariance
VariancePtr getVariance() const
Return a (shared_ptr to) the MaskedImage's variance.
Definition: MaskedImage.h:1079
lsst::afw::geom::ellipses::Ellipse
An ellipse defined by an arbitrary BaseCore and a center point.
Definition: Ellipse.h:51
lsst::afw::geom::ellipses::PixelRegion
A pixelized region containing all pixels whose centers are within an Ellipse.
Definition: PixelRegion.h:46
PixelRegion.h
lsst::meas::base::ApertureFluxAlgorithm::computeSincFlux
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.
Definition: ApertureFlux.cc:146
lsst::meas::base::FlagDefinitionList::size
std::size_t size() const
return the current size (number of defined elements) of the collection
Definition: FlagHandler.h:125
SincCoeffs.h
lsst::meas::base::ApertureFluxAlgorithm::getFlagDefinitions
static FlagDefinitionList const & getFlagDefinitions()
Definition: ApertureFlux.cc:49
photoCalib
Key< int > photoCalib
Definition: Exposure.cc:67
lsst::meas::base::FlagDefinition
Simple class used to define and document flags The name and doc constitute the identity of the FlagDe...
Definition: FlagHandler.h:40
lsst::meas::base::ApertureFluxTransform::ApertureFluxTransform
ApertureFluxTransform(Control const &ctrl, std::string const &name, afw::table::SchemaMapper &mapper)
Definition: ApertureFlux.cc:256
lsst::meas::base::ApertureFluxAlgorithm::ApertureFluxAlgorithm
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.
Definition: ApertureFlux.cc:71
lsst::meas::base::ApertureFluxControl::radii
std::vector< double > radii
"Radius (in pixels) of apertures." ;
Definition: ApertureFlux.h:53
lsst::geom::Box2I::clip
void clip(Box2I const &other) noexcept
Shrink this to ensure that other.contains(*this).
Definition: Box.cc:189
std::array::begin
T begin(T... args)
lsst::afw::math::offsetImage
std::shared_ptr< ImageT > offsetImage(ImageT const &image, float dx, float dy, std::string const &algorithmName="lanczos5", unsigned int buffer=0)
Return an image offset by (dx, dy) using the specified algorithm.
Definition: offsetImage.cc:41
lsst::daf::base::PropertySet
Class for storing generic metadata.
Definition: PropertySet.h:67
lsst::meas::base::ApertureFluxAlgorithm::fail
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.
Definition: ApertureFlux.cc:87
lsst::geom::Box2I
An integer coordinate rectangle.
Definition: Box.h:55
mapper
SchemaMapper * mapper
Definition: SchemaMapper.cc:78
lsst::afw::image::PARENT
@ PARENT
Definition: ImageBase.h:94
lsst::afw::image::MaskedImage::getImage
ImagePtr getImage() const
Return a (shared_ptr to) the MaskedImage's image.
Definition: MaskedImage.h:1046
lsst::meas::base::ApertureFluxAlgorithm
Base class for multiple-aperture photometry algorithms.
Definition: ApertureFlux.h:80
std::size_t
lsst::afw::geom::ellipses::Ellipse::getCore
BaseCore const & getCore() const
Return the ellipse core.
Definition: Ellipse.h:71
lsst::meas::base::ApertureFluxControl::ApertureFluxControl
ApertureFluxControl()
Definition: ApertureFlux.cc:51
std::array::end
T end(T... args)
lsst::afw::table::BaseRecord::set
void set(Key< T > const &key, U const &value)
Set value of a field for the given key.
Definition: BaseRecord.h:164
lsst::meas::base::ApertureFluxControl
Configuration object for multiple-aperture flux algorithms.
Definition: ApertureFlux.h:49
lsst::afw::image::Image
A class to represent a 2-dimensional array of pixels.
Definition: Image.h:58
lsst::meas::base::BaseTransform
Abstract base class for all C++ measurement transformations.
Definition: Transform.h:86
lsst::afw::table::CatalogT::begin
iterator begin()
Iterator access.
Definition: Catalog.h:396
lsst::meas::base::ApertureFluxAlgorithm::_ctrl
Control const _ctrl
Definition: ApertureFlux.h:198
lsst::afw::table::CatalogT< BaseRecord >
prefix
std::string prefix
Definition: SchemaMapper.cc:79
lsst::meas::base::ApertureFluxAlgorithm::computeNaiveFlux
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.
Definition: ApertureFlux.cc:176
lsst::afw::image::ImageBase::getWidth
int getWidth() const
Return the number of columns in the image.
Definition: ImageBase.h:294
bbox
AmpInfoBoxKey bbox
Definition: Amplifier.cc:117
lsst::meas::base::ApertureFluxAlgorithm::SINC_COEFFS_TRUNCATED
static FlagDefinition const SINC_COEFFS_TRUNCATED
Definition: ApertureFlux.h:87