LSST Applications g0603fd7c41+022847dfd1,g0aad566f14+f45185db35,g180d380827+40e913b07a,g2079a07aa2+86d27d4dc4,g2305ad1205+696e5f3872,g2bbee38e9b+047b288a59,g337abbeb29+047b288a59,g33d1c0ed96+047b288a59,g3a166c0a6a+047b288a59,g3d1719c13e+f45185db35,g3de15ee5c7+5201731f0d,g487adcacf7+19f9b77d7d,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+248b16177b,g63cd9335cc+585e252eca,g858d7b2824+f45185db35,g88963caddf+0cb8e002cc,g991b906543+f45185db35,g99cad8db69+1747e75aa3,g9b9dfce982+78139cbddb,g9ddcbc5298+9a081db1e4,ga1e77700b3+a912195c07,gae0086650b+585e252eca,gb0e22166c9+60f28cb32d,gb3a676b8dc+b4feba26a1,gb4b16eec92+f82f04eb54,gba4ed39666+c2a2e4ac27,gbb8dafda3b+215b19b0ab,gc120e1dc64+b0284b5341,gc28159a63d+047b288a59,gc3e9b769f7+dcad4ace9a,gcf0d15dbbd+78139cbddb,gdaeeff99f8+f9a426f77a,ge79ae78c31+047b288a59,w.2024.19
LSST Data Management Base Package
Loading...
Searching...
No Matches
CircularApertureFlux.cc
Go to the documentation of this file.
1// -*- lsst-c++ -*-
2/*
3 * LSST Data Management System
4 * Copyright 2008-2014 LSST Corporation.
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
28
29namespace lsst {
30namespace meas {
31namespace base {
32
34 afw::table::Schema& schema,
35 daf::base::PropertySet& metadata)
36 : ApertureFluxAlgorithm(ctrl, name, schema, metadata) {
37 for (std::size_t i = 0; i < ctrl.radii.size(); ++i) {
38 if (ctrl.radii[i] > ctrl.maxSincRadius) break;
39 SincCoeffs<float>::cache(0.0, ctrl.radii[i]);
40 }
41}
42
44 afw::image::Exposure<float> const& exposure) const {
47 axes = std::static_pointer_cast<afw::geom::ellipses::Axes>(ellipse.getCorePtr());
48 for (std::size_t i = 0; i < _ctrl.radii.size(); ++i) {
49 // Each call to _centroidExtractor within this loop goes through exactly the same error-checking
50 // logic and returns the same result, but it's not expensive logic, so we just call it repeatedly
51 // instead of coming up with a new interface that would allow us to move it outside the loop.
52 ellipse.setCenter(_centroidExtractor(measRecord, getFlagHandler(i)));
53 axes->setA(_ctrl.radii[i]);
54 axes->setB(_ctrl.radii[i]);
55 ApertureFluxAlgorithm::Result result = computeFlux(exposure.getMaskedImage(), ellipse, _ctrl);
56 copyResultToRecord(result, measRecord, i);
57 }
58}
59
60} // namespace base
61} // namespace meas
62} // namespace lsst
An ellipse core for the semimajor/semiminor axis and position angle parametrization (a,...
Definition Axes.h:47
An ellipse defined by an arbitrary BaseCore and a center point.
Definition Ellipse.h:51
void setCenter(lsst::geom::Point2D const &center)
Set the center point.
Definition Ellipse.h:68
std::shared_ptr< BaseCore const > getCorePtr() const
Return the ellipse core.
Definition Ellipse.h:77
A class to contain the data, WCS, and other information needed to describe an image of the sky.
Definition Exposure.h:72
Defines the fields and offsets for a table.
Definition Schema.h:51
Record class that contains measurements made on a single exposure.
Definition Source.h:78
Class for storing generic metadata.
Definition PropertySet.h:66
Base class for multiple-aperture photometry algorithms.
void copyResultToRecord(Result const &result, afw::table::SourceRecord &record, int index) const
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...
FlagHandler const & getFlagHandler(int index) const
Configuration object for multiple-aperture flux algorithms.
double maxSincRadius
"Maximum radius (in pixels) for which the sinc algorithm should be used instead of the " "faster naiv...
std::vector< double > radii
"Radius (in pixels) of apertures." ;
virtual void measure(afw::table::SourceRecord &record, afw::image::Exposure< float > const &exposure) const
Measure the configured apertures on the given image.
CircularApertureFluxAlgorithm(Control const &ctrl, std::string const &name, afw::table::Schema &schema, daf::base::PropertySet &metadata)
static void cache(float rInner, float rOuter)
Cache the coefficients for a particular aperture.
T size(T... args)
A Result struct for running an aperture flux algorithm with a single radius.