LSST Applications g070148d5b3+33e5256705,g0d53e28543+25c8b88941,g0da5cf3356+2dd1178308,g1081da9e2a+62d12e78cb,g17e5ecfddb+7e422d6136,g1c76d35bf8+ede3a706f7,g295839609d+225697d880,g2e2c1a68ba+cc1f6f037e,g2ffcdf413f+853cd4dcde,g38293774b4+62d12e78cb,g3b44f30a73+d953f1ac34,g48ccf36440+885b902d19,g4b2f1765b6+7dedbde6d2,g5320a0a9f6+0c5d6105b6,g56b687f8c9+ede3a706f7,g5c4744a4d9+ef6ac23297,g5ffd174ac0+0c5d6105b6,g6075d09f38+66af417445,g667d525e37+2ced63db88,g670421136f+2ced63db88,g71f27ac40c+2ced63db88,g774830318a+463cbe8d1f,g7876bc68e5+1d137996f1,g7985c39107+62d12e78cb,g7fdac2220c+0fd8241c05,g96f01af41f+368e6903a7,g9ca82378b8+2ced63db88,g9d27549199+ef6ac23297,gabe93b2c52+e3573e3735,gb065e2a02a+3dfbe639da,gbc3249ced9+0c5d6105b6,gbec6a3398f+0c5d6105b6,gc9534b9d65+35b9f25267,gd01420fc67+0c5d6105b6,geee7ff78d7+a14128c129,gf63283c776+ede3a706f7,gfed783d017+0c5d6105b6,w.2022.47
LSST Data Management Base Package
Loading...
Searching...
No Matches
ImagePsf.cc
Go to the documentation of this file.
1// -*- LSST-C++ -*-
2/*
3 * LSST Data Management System
4 * Copyright 2008-2013 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
24#include "lsst/geom/Point.h"
30
31namespace lsst {
32namespace afw {
33namespace table {
34namespace io {
35
38
39} // namespace io
40} // namespace table
41} // namespace afw
42namespace meas {
43namespace algorithms {
44
45double ImagePsf::doComputeApertureFlux(double radius, geom::Point2D const& position,
46 afw::image::Color const& color) const {
47 geom::Point2D const center(0.0, 0.0);
48 afw::geom::ellipses::Axes const axes(radius, radius);
49 afw::geom::ellipses::Ellipse ellipse(axes, center);
50 geom::Box2I box(ellipse.computeBBox());
51 // perhaps needs a grow here
52 afw::image::Image<double> image(*computeKernelImage(position, color, INTERNAL));
53 if (!image.getBBox().contains(box)) {
54 box.include(image.getBBox());
55 afw::image::Image<double> paddedImage(box);
56 paddedImage = 0.0;
57 paddedImage.assign(image, image.getBBox());
58 image = paddedImage;
59 }
60 base::ApertureFluxResult result = base::ApertureFluxAlgorithm::computeSincFlux(
62 return result.instFlux;
63}
64
65afw::geom::ellipses::Quadrupole ImagePsf::doComputeShape(geom::Point2D const& position,
66 afw::image::Color const& color) const {
67 std::shared_ptr<Image> image = computeKernelImage(position, color, INTERNAL);
69 *image, geom::Point2D(0.0, 0.0) // image has origin at the center
70 )
71 .getShape();
72}
73
74} // namespace algorithms
75} // namespace meas
76} // namespace lsst
py::object result
Definition: _schema.cc:429
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
lsst::geom::Box2D computeBBox() const
Return the bounding box of the ellipse.
Definition: Ellipse.cc:55
An ellipse core with quadrupole moments as parameters.
Definition: Quadrupole.h:47
Describe the colour of a source.
Definition: Color.h:25
void assign(ImageBase const &rhs, lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT)
Copy pixels from another image to a specified subregion of this image.
Definition: Image.cc:153
A class to represent a 2-dimensional array of pixels.
Definition: Image.h:51
static std::shared_ptr< T > dynamicCast(std::shared_ptr< Persistable > const &ptr)
Dynamically cast a shared_ptr.
Definition: Persistable.cc:18
An integer coordinate rectangle.
Definition: Box.h:55
void include(Point2I const &point)
Expand this to ensure that this->contains(point).
Definition: Box.cc:152
Configuration object for multiple-aperture flux algorithms.
Definition: ApertureFlux.h:49
static Result computeAdaptiveMoments(ImageT const &image, geom::Point2D const &position, bool negative=false, Control const &ctrl=Control())
Compute the adaptive Gaussian-weighted moments of an image.
A Result struct for running an aperture flux algorithm with a single radius.
Definition: ApertureFlux.h:217
Shape const getShape() const
Return an afw::geom::ellipses object corresponding to xx, yy, xy.