lsst.meas.base
ga44f29b7aa+7c34ee3998
Toggle main menu visibility
Loading...
Searching...
No Matches
include
lsst
meas
base
PixelFlags.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_BASE_PixelFlags_h_INCLUDED
25
#define LSST_MEAS_BASE_PixelFlags_h_INCLUDED
26
31
#include <vector>
32
33
#include "lsst/pex/config.h"
34
#include "
lsst/afw/image/Exposure.h
"
35
#include "
lsst/meas/base/Algorithm.h
"
36
37
namespace
lsst
{
38
namespace
meas
{
39
namespace
base
{
40
44
class
PixelFlagsControl
{
45
public
:
46
LSST_CONTROL_FIELD(
masksFpCenter
,
std::vector<std::string>
,
47
"List of mask planes to be searched for which occur in the center of a footprint. "
48
"If any of the planes are found they will have a corresponding pixel flag set."
);
49
LSST_CONTROL_FIELD(
masksFpAnywhere
,
std::vector<std::string>
,
50
"List of mask planes to be searched for which occur anywhere within a footprint. "
51
"If any of the planes are found they will have a corresponding pixel flag set."
);
57
PixelFlagsControl
() :
masksFpCenter
(),
masksFpAnywhere
() {}
58
};
59
64
class
PixelFlagsAlgorithm
:
public
SimpleAlgorithm
{
65
public
:
68
typedef
PixelFlagsControl
Control
;
69
70
PixelFlagsAlgorithm
(
Control
const
& ctrl,
std::string
const
& name,
afw::table::Schema
& schema);
71
72
virtual
void
measure
(
afw::table::SourceRecord
& measRecord,
73
afw::image::Exposure<float>
const
& exposure)
const
;
74
75
virtual
void
fail
(
afw::table::SourceRecord
& measRecord,
MeasurementError
* error =
nullptr
)
const
;
76
77
typedef
std::map<std::string, afw::table::Key<afw::table::Flag>
>
KeyMap
;
78
79
private
:
80
Control
_ctrl;
81
// Maps of mask plane name->afw table Key for the various fields we add to the schema on construction.
82
KeyMap
_centerKeys;
// Keys for bits set anywhere within the 3x3 region around the centroid.
83
KeyMap
_centerAllKeys;
// Keys for bits set on the entire 3x3 region around the centroid.
84
KeyMap
_anyKeys;
// Keys for bits set anywhere in the footprint.
85
afw::table::Key<afw::table::Flag>
_generalFailureKey;
86
afw::table::Key<afw::table::Flag>
_offImageKey;
87
};
88
89
}
// namespace base
90
}
// namespace meas
91
}
// namespace lsst
92
93
#endif
// !LSST_MEAS_BASE_PixelFlags_h_INCLUDED
Algorithm.h
std::string
lsst::afw::image::Exposure
lsst::afw::table::Key
lsst::afw::table::Schema
lsst::afw::table::SourceRecord
lsst::meas::base::MeasurementError
Exception to be thrown when a measurement algorithm experiences a known failure mode.
Definition
exceptions.h:48
lsst::meas::base::PixelFlagsAlgorithm::KeyMap
std::map< std::string, afw::table::Key< afw::table::Flag > > KeyMap
Definition
PixelFlags.h:77
lsst::meas::base::PixelFlagsAlgorithm::fail
virtual void fail(afw::table::SourceRecord &measRecord, MeasurementError *error=nullptr) const
Handle an exception thrown by the current algorithm by setting flags in the given record.
Definition
PixelFlags.cc:262
lsst::meas::base::PixelFlagsAlgorithm::Control
PixelFlagsControl Control
A typedef to the Control object for this algorithm, defined above.
Definition
PixelFlags.h:68
lsst::meas::base::PixelFlagsAlgorithm::PixelFlagsAlgorithm
PixelFlagsAlgorithm(Control const &ctrl, std::string const &name, afw::table::Schema &schema)
Definition
PixelFlags.cc:99
lsst::meas::base::PixelFlagsAlgorithm::measure
virtual void measure(afw::table::SourceRecord &measRecord, afw::image::Exposure< float > const &exposure) const
Called to measure a single child source in an image.
Definition
PixelFlags.cc:183
lsst::meas::base::PixelFlagsControl
A C++ control class to handle PixelFlagsAlgorithm's configuration.
Definition
PixelFlags.h:44
lsst::meas::base::PixelFlagsControl::masksFpAnywhere
std::vector< std::string > masksFpAnywhere
"List of mask planes to be searched for which occur anywhere within a footprint. " "If any of the pla...
Definition
PixelFlags.h:51
lsst::meas::base::PixelFlagsControl::masksFpCenter
std::vector< std::string > masksFpCenter
"List of mask planes to be searched for which occur in the center of a footprint. " "If any of the pl...
Definition
PixelFlags.h:48
lsst::meas::base::PixelFlagsControl::PixelFlagsControl
PixelFlagsControl()
Default constructor.
Definition
PixelFlags.h:57
lsst::meas::base::SimpleAlgorithm
An abstract base classes for which the same implementation can be used for both SingleFrameAlgorithm ...
Definition
Algorithm.h:170
Exposure.h
std::map
lsst::meas::base.plugins.PixelFlagsAlgorithm
PixelFlagsAlgorithm
Definition
plugins.py:92
lsst::meas::base
Definition
Algorithm.h:37
lsst::meas
Definition
Algorithm.h:36
lsst
std::vector
Generated on
for lsst.meas.base by
1.17.0