lsst.meas.algorithms
g4a7591d645+fa9daf83c6
Toggle main menu visibility
Loading...
Searching...
No Matches
include
lsst
meas
algorithms
SpanSetMoments.h
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
#ifndef LSST_MEAS_ALGORITHMS_SpanSetMoments_h_INCLUDED
25
#define LSST_MEAS_ALGORITHMS_SpanSetMoments_h_INCLUDED
26
27
#include "ndarray.h"
28
#include "
lsst/geom/Point.h
"
29
#include "
lsst/afw/image/MaskedImage.h
"
30
#include "
lsst/afw/geom/ellipses/Quadrupole.h
"
31
#include "
lsst/afw/geom/SpanSet.h
"
32
#include "
lsst/shapelet/ShapeletFunction.h
"
33
34
namespace
lsst
{
35
namespace
meas
{
36
namespace
algorithms
{
37
45
struct
SpanSetMoments
{
46
48
double
flux
;
49
51
double
variance
;
52
54
geom::Point2D
center
;
55
57
afw::geom::ellipses::Quadrupole
shape
;
58
60
std::shared_ptr<afw::geom::SpanSet>
spans
;
61
63
bool
too_many_bad_pixels
=
false
;
64
66
bool
center_out_of_bounds
=
false
;
67
69
bool
bad_pixel_in_center
=
false
;
70
72
bool
singular_second_moments
=
false
;
73
75
bool
any_flags_set
()
const
{
76
return
too_many_bad_pixels
||
center_out_of_bounds
||
bad_pixel_in_center
||
singular_second_moments
;
77
}
78
80
ndarray::Array<float, 1, 1>
get_x_array
()
const
;
81
83
ndarray::Array<float, 1, 1>
get_y_array
()
const
;
84
100
static
std::shared_ptr<SpanSetMoments>
compute
(
afw::geom::SpanSet
const
&
spans
,
101
afw::image::MaskedImage<float>
const
& masked_image,
102
afw::image::MaskPixel
bad_bitmask,
103
double
bad_pixel_max_fraction,
104
double
bad_pixel_exclusion_radius);
105
125
static
shapelet::ShapeletFunction
fit_shapelets
(
126
afw::image::MaskedImage<float>
const
& masked_image,
127
std::vector
<
std::shared_ptr<SpanSetMoments>
>
const
& moments,
128
int
order,
double
scale,
bool
circular);
129
};
130
131
}
// namespace algorithms
132
}
// namespace meas
133
}
// namespace lsst
134
135
#endif
// !LSST_MEAS_ALGORITHMS_SpanSetMoments_h_INCLUDED
MaskedImage.h
Point.h
Quadrupole.h
ShapeletFunction.h
SpanSet.h
lsst::afw::geom::SpanSet
lsst::afw::geom::ellipses::Quadrupole
lsst::afw::image::MaskedImage
lsst::shapelet::ShapeletFunction
lsst::afw::image::MaskPixel
std::int32_t MaskPixel
lsst::geom::Point2D
Point< double, 2 > Point2D
lsst::meas::algorithms
Definition
mainpage.dox:13
lsst::meas
lsst
std::shared_ptr
lsst::meas::algorithms::SpanSetMoments
A struct that computes the unweighted moments of the pixels in an lsst.afw.geom.SpanSet.
Definition
SpanSetMoments.h:45
lsst::meas::algorithms::SpanSetMoments::any_flags_set
bool any_flags_set() const
Test whether any failure flag is set.
Definition
SpanSetMoments.h:75
lsst::meas::algorithms::SpanSetMoments::center_out_of_bounds
bool center_out_of_bounds
Flag set if the center did not lie within the SpanSet.
Definition
SpanSetMoments.h:66
lsst::meas::algorithms::SpanSetMoments::bad_pixel_in_center
bool bad_pixel_in_center
Flag set if there was a bad pixel too close to the center.
Definition
SpanSetMoments.h:69
lsst::meas::algorithms::SpanSetMoments::get_y_array
ndarray::Array< float, 1, 1 > get_y_array() const
Return a flattened array of the y coordinates in spans.
Definition
SpanSetMoments.cc:44
lsst::meas::algorithms::SpanSetMoments::compute
static std::shared_ptr< SpanSetMoments > compute(afw::geom::SpanSet const &spans, afw::image::MaskedImage< float > const &masked_image, afw::image::MaskPixel bad_bitmask, double bad_pixel_max_fraction, double bad_pixel_exclusion_radius)
Compute the unweighted moments of an image within a SpanSet.
Definition
SpanSetMoments.cc:51
lsst::meas::algorithms::SpanSetMoments::singular_second_moments
bool singular_second_moments
Flag set if the second moments did not resolve to an ellipse.
Definition
SpanSetMoments.h:72
lsst::meas::algorithms::SpanSetMoments::center
geom::Point2D center
Center derived from the unweighted first moment of the image.
Definition
SpanSetMoments.h:54
lsst::meas::algorithms::SpanSetMoments::flux
double flux
Total flux within the SpanSet.
Definition
SpanSetMoments.h:48
lsst::meas::algorithms::SpanSetMoments::variance
double variance
Total variance within the SpanSet.
Definition
SpanSetMoments.h:51
lsst::meas::algorithms::SpanSetMoments::spans
std::shared_ptr< afw::geom::SpanSet > spans
The pixels actually used to compute the moments.
Definition
SpanSetMoments.h:60
lsst::meas::algorithms::SpanSetMoments::get_x_array
ndarray::Array< float, 1, 1 > get_x_array() const
Return a flattened array of the x coordinates in spans.
Definition
SpanSetMoments.cc:37
lsst::meas::algorithms::SpanSetMoments::fit_shapelets
static shapelet::ShapeletFunction fit_shapelets(afw::image::MaskedImage< float > const &masked_image, std::vector< std::shared_ptr< SpanSetMoments > > const &moments, int order, double scale, bool circular)
Fit a common shapelet expansion to multiple sources whose moments have already been computed.
Definition
SpanSetMoments.cc:126
lsst::meas::algorithms::SpanSetMoments::shape
afw::geom::ellipses::Quadrupole shape
Shape derived from the unweighted second moment of the image.
Definition
SpanSetMoments.h:57
lsst::meas::algorithms::SpanSetMoments::too_many_bad_pixels
bool too_many_bad_pixels
Flag set if there were too many bad pixels to compute the moments.
Definition
SpanSetMoments.h:63
std::vector
Generated on
for lsst.meas.algorithms by
1.17.0