lsst.meas.modelfit  15.0-3-g150fc43+8
PixelFitRegion.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 /*
3  * LSST Data Management System
4  * Copyright 2015-2016 LSST/AURA
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_MODELFIT_PixelFitRegion_h_INCLUDED
25 #define LSST_MEAS_MODELFIT_PixelFitRegion_h_INCLUDED
26 
27 #include "lsst/pex/config.h"
29 #include "lsst/afw/image/Mask.h"
31 #include "lsst/afw/geom/ellipses.h"
32 
33 namespace lsst { namespace meas { namespace modelfit {
34 
35 
37 
39  nKronRadii(1.5),
40  nPsfSigmaMin(4.0),
41  nPsfSigmaGrow(2.0),
42  nFitRadiiMin(1.0),
43  nFitRadiiMax(3.0),
44  maxArea(100000),
46  {
47  badMaskPlanes.push_back("EDGE");
48  badMaskPlanes.push_back("SAT");
49  badMaskPlanes.push_back("BAD");
50  badMaskPlanes.push_back("NO_DATA");
51  }
52 
54  nKronRadii, double,
55  "Use this multiple of the Kron ellipse to set the fit region (for the final fit region, "
56  "subject to the nFitRadiiMin and nFitRadiiMax constraints)."
57  );
58 
60  nPsfSigmaMin, double,
61  "If the Kron radius is less than this multiple of the PSF width, ignore it and fall back "
62  "to a PSF-oriented ellipse scaled to match the area of the footprint or this radius "
63  "(whichever is larger)."
64  );
65 
67  nPsfSigmaGrow, double,
68  "Grow the initial fit ellipses by this factor before comparing with the Kron/Footprint region"
69  );
70 
72  nFitRadiiMin, double,
73  "Use this multiple of the initial fit ellipse then grow by the PSF width "
74  "to determine the minimum final fit region size."
75  );
76 
78  nFitRadiiMax, double,
79  "Use this multiple of the initial fit ellipse then grow by the PSF width "
80  "to determine the maximum final fit region size."
81  );
82 
84  maxArea, int,
85  "Abort if the fit region grows beyond this many pixels."
86  );
87 
90  "Mask planes that indicate pixels that should be ignored in the fit."
91  );
92 
94  maxBadPixelFraction, double,
95  "Maximum fraction of pixels that may be ignored due to masks; "
96  "more than this and we don't even try."
97  );
98 
99 };
100 
101 
103 public:
104 
106  PixelFitRegionControl const & ctrl,
107  afw::geom::ellipses::Quadrupole const & moments,
108  afw::geom::ellipses::Quadrupole const & psfMoments,
109  Scalar kronRadius,
110  int footprintArea
111  );
112 
114  PixelFitRegionControl const & ctrl,
115  afw::geom::ellipses::Quadrupole const & ellipse
116  );
117 
118  bool applyEllipse(
119  afw::geom::ellipses::Quadrupole const & deconvolved,
120  afw::geom::ellipses::Quadrupole const & psfMoments
121  );
122 
123  void applyMask(afw::image::Mask<> const & mask, afw::geom::Point2D const & center);
124 
129  bool maxArea;
133 
134 private:
135  PixelFitRegionControl _ctrl;
136  afw::image::MaskPixel _badPixelMask;
137 };
138 
139 
140 }}} // lsst::meas::modelfit
141 
142 #endif // !LSST_MEAS_MODELFIT_PixelFitRegion_h_INCLUDED
143 
double nKronRadii
"Use this multiple of the Kron ellipse to set the fit region (for the final fit region, " "subject to the nFitRadiiMin and nFitRadiiMax constraints)." ;
afw::table::Key< afw::table::Array< MaskPixelT > > mask
afw::geom::ellipses::Quadrupole ellipse
double Scalar
Typedefs to be used for probability and parameter values.
Definition: common.h:44
#define PTR(...)
boost::shared_ptr< afw::detection::Footprint > footprint
#define LSST_CONTROL_FIELD(NAME, TYPE, DOC)
int maxArea
"Abort if the fit region grows beyond this many pixels." ;
double maxBadPixelFraction
"Maximum fraction of pixels that may be ignored due to masks; " "more than this and we don&#39;t even try...
T push_back(T... args)
double nFitRadiiMax
"Use this multiple of the initial fit ellipse then grow by the PSF width " "to determine the maximum ...
std::vector< std::string > badMaskPlanes
"Mask planes that indicate pixels that should be ignored in the fit." ;
double nPsfSigmaGrow
"Grow the initial fit ellipses by this factor before comparing with the Kron/Footprint region" ; ...
double nPsfSigmaMin
"If the Kron radius is less than this multiple of the PSF width, ignore it and fall back " "to a PSF-...
double nFitRadiiMin
"Use this multiple of the initial fit ellipse then grow by the PSF width " "to determine the minimum ...