lsst.meas.algorithms g1581cd22ba+dee93ecadb
Loading...
Searching...
No Matches
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"
33
34namespace lsst {
35namespace meas {
36namespace algorithms {
37
46
48 double flux;
49
51 double variance;
52
55
58
61
63 bool too_many_bad_pixels = false;
64
67
69 bool bad_pixel_in_center = false;
70
73
78
80 ndarray::Array<float, 1, 1> get_x_array() const;
81
83 ndarray::Array<float, 1, 1> get_y_array() const;
84
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
123 afw::image::MaskedImage<float> const& masked_image,
125 int order, double scale);
126};
127
128} // namespace algorithms
129} // namespace meas
130} // namespace lsst
131
132#endif // !LSST_MEAS_ALGORITHMS_SpanSetMoments_h_INCLUDED
std::int32_t MaskPixel
Point< double, 2 > Point2D
A struct that computes the unweighted moments of the pixels in an lsst.afw.geom.SpanSet.
bool any_flags_set() const
Test whether any failure flag is set.
bool center_out_of_bounds
Flag set if the center did not lie within the SpanSet.
static shapelet::ShapeletFunction fit_shapelets(afw::image::MaskedImage< float > const &masked_image, std::vector< std::shared_ptr< SpanSetMoments > > const &moments, int order, double scale)
Fit a common shapelet expansion to multiple sources whose moments have already been computed.
bool bad_pixel_in_center
Flag set if there was a bad pixel too close to the center.
ndarray::Array< float, 1, 1 > get_y_array() const
Return a flattened array of the y coordinates in spans.
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.
bool singular_second_moments
Flag set if the second moments did not resolve to an ellipse.
geom::Point2D center
Center derived from the unweighted first moment of the image.
double flux
Total flux within the SpanSet.
double variance
Total variance within the SpanSet.
std::shared_ptr< afw::geom::SpanSet > spans
The pixels actually used to compute the moments.
ndarray::Array< float, 1, 1 > get_x_array() const
Return a flattened array of the x coordinates in spans.
afw::geom::ellipses::Quadrupole shape
Shape derived from the unweighted second moment of the image.
bool too_many_bad_pixels
Flag set if there were too many bad pixels to compute the moments.