lsst.meas.algorithms
g4a7591d645+ff8a1bd350
Toggle main menu visibility
Loading...
Searching...
No Matches
src
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
"
25
#include "
lsst/afw/image/MaskedImage.h
"
26
#include "
lsst/afw/table/io/Persistable.cc
"
27
#include "
lsst/meas/algorithms/ImagePsf.h
"
28
#include "
lsst/meas/base/SdssShape.h
"
29
#include "
lsst/meas/base/ApertureFlux.h
"
30
31
namespace
lsst
{
32
namespace
afw
{
33
namespace
table
{
34
namespace
io
{
35
36
template
std::shared_ptr<meas::algorithms::ImagePsf>
37
PersistableFacade<meas::algorithms::ImagePsf>::dynamicCast
(std::shared_ptr<Persistable>
const
&);
38
39
}
// namespace io
40
}
// namespace table
41
}
// namespace afw
42
namespace
meas
{
43
namespace
algorithms {
44
45
double
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
(
61
image
, ellipse,
base::ApertureFluxControl
());
62
return
result.
instFlux
;
63
}
64
65
afw::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
);
68
return
meas::base::SdssShapeAlgorithm::computeAdaptiveMoments
(
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
ApertureFlux.h
ImagePsf.h
MaskedImage.h
Point.h
SdssShape.h
lsst::afw::detection::Psf::computeKernelImage
std::shared_ptr< Image > computeKernelImage(lsst::geom::Point2D position, image::Color color=image::Color(), ImageOwnerEnum owner=COPY) const
lsst::afw::detection::Psf::INTERNAL
INTERNAL
lsst::afw::geom::ellipses::Axes
lsst::afw::geom::ellipses::Ellipse
lsst::afw::geom::ellipses::Ellipse::computeBBox
lsst::geom::Box2D computeBBox() const
lsst::afw::geom::ellipses::Quadrupole
lsst::afw::image::Color
lsst::afw::image::Image::assign
void assign(ImageBase const &rhs, lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT)
lsst::afw::image::Image
lsst::afw::table::io::PersistableFacade::dynamicCast
static std::shared_ptr< T > dynamicCast(std::shared_ptr< Persistable > const &ptr)
lsst::geom::Box2I
lsst::geom::Box2I::include
void include(Point2I const &point)
lsst::meas::algorithms::ImagePsf::doComputeShape
virtual afw::geom::ellipses::Quadrupole doComputeShape(geom::Point2D const &position, afw::image::Color const &color) const
Definition
ImagePsf.cc:65
lsst::meas::algorithms::ImagePsf::doComputeApertureFlux
virtual double doComputeApertureFlux(double radius, geom::Point2D const &position, afw::image::Color const &color) const
Definition
ImagePsf.cc:45
lsst::meas::base::ApertureFluxAlgorithm::computeSincFlux
static Result computeSincFlux(afw::image::Image< T > const &image, afw::geom::ellipses::Ellipse const &ellipse, Control const &ctrl=Control())
lsst::meas::base::ApertureFluxControl
lsst::meas::base::SdssShapeAlgorithm::computeAdaptiveMoments
SdssShapeResult computeAdaptiveMoments(ImageT const &image, geom::Point2D const ¢er, bool negative, Control const &control)
Persistable.cc
lsst::afw::image
lsst::afw::table::io
lsst::afw::table
lsst::afw
lsst::geom::Point2D
Point< double, 2 > Point2D
lsst::meas
lsst
std::shared_ptr
lsst::meas::base::ApertureFluxResult
lsst::meas::base::ApertureFluxResult::instFlux
meas::base::Flux instFlux
lsst::meas::base::SdssShapeResult::getShape
Shape const getShape() const
Generated on
for lsst.meas.algorithms by
1.17.0