lsst.meas.base  15.0-2-g2010ef9+6
LocalBackground.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 /*
3  * LSST Data Management System
4  * Copyright 2008-2018 AURA/LSST.
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_BASE_LocalBackground_h_INCLUDED
25 #define LSST_MEAS_BASE_LocalBackground_h_INCLUDED
26 
27 #include "lsst/pex/config.h"
34 
35 namespace lsst { namespace meas { namespace base {
36 
39 public:
40 
42  "Mask planes that indicate pixels that should be excluded from the measurement");
44  "Inner radius for background annulus as a multiple of the PSF sigma");
46  "Outer radius for background annulus as a multiple of the PSF sigma");
48  "Rejection threshold (in standard deviations) for background measurement");
50  "Number of sigma-clipping iterations for background measurement");
51 
53  // deliberately omitting DETECTED: objects shouldn't be present if we're deblending, and by
54  // including DETECTED we wouldn't get any pixels for the background if we're on something
55  // extended and over threshold which is exactly the case when we do want to measure the background.
56  badMaskPlanes({"BAD", "SAT", "NO_DATA"}),
57  annulusInner(7.0),
58  annulusOuter(15.0),
59  bgRej(3.0),
60  bgIter(3)
61  {}
62 };
63 
66 public:
67 
68  static FlagDefinitionList const & getFlagDefinitions();
69  static FlagDefinition const FAILURE;
71  static FlagDefinition const NO_PSF;
72 
74 
75  LocalBackgroundAlgorithm(Control const & ctrl, std::string const & name, afw::table::Schema & schema,
76  std::string const & logName="");
77 
78  virtual void measure(
79  afw::table::SourceRecord & measRecord,
80  afw::image::Exposure<float> const & exposure
81  ) const;
82 
83  virtual void fail(
84  afw::table::SourceRecord & measRecord,
85  MeasurementError * error=nullptr
86  ) const;
87 
88 private:
89  Control _ctrl;
90  FluxResultKey _resultKey;
91  FlagHandler _flagHandler;
92  SafeCentroidExtractor _centroidExtractor;
94 };
95 
96 
98 public:
100  LocalBackgroundTransform(Control const & ctrl, std::string const & name,
101  afw::table::SchemaMapper & mapper);
102 };
103 
104 
105 }}} // namespace lsst::meas::base
106 
107 #endif // !LSST_MEAS_BASE_LocalBackground_h_INCLUDED
Configuration of LocalBackgroundAlgorithm.
Simple class used to define and document flags The name and doc constitute the identity of the FlagDe...
Definition: FlagHandler.h:38
This defines the base of measurement transformations.
float annulusInner
"Inner radius for background annulus as a multiple of the PSF sigma" ;
std::vector< std::string > badMaskPlanes
"Mask planes that indicate pixels that should be excluded from the measurement" ; ...
Utility class for measurement algorithms that extracts a position from the Centroid slot and handles ...
Exception to be thrown when a measurement algorithm experiences a known failure mode.
Definition: exceptions.h:48
#define LSST_CONTROL_FIELD(NAME, TYPE, DOC)
Base for flux measurement transformations.
A measurement algorithm that estimates the local background value per pixel.
STL class.
Utility class for handling flag fields that indicate the failure modes of an algorithm.
Definition: FlagHandler.h:156
float annulusOuter
"Outer radius for background annulus as a multiple of the PSF sigma" ;
static FlagDefinition const NO_GOOD_PIXELS
float bgRej
"Rejection threshold (in standard deviations) for background measurement" ;
A FunctorKey for FluxResult.
Definition: FluxUtilities.h:58
An abstract base classes for which the same implementation can be used for both SingleFrameAlgorithm ...
Definition: Algorithm.h:185
int bgIter
"Number of sigma-clipping iterations for background measurement" ;
vector-type utility class to build a collection of FlagDefinitions
Definition: FlagHandler.h:63