SourceXtractorPlusPlus
0.15
Please provide a description of the project.
SEImplementation
src
lib
Plugin
SourceFlags
SourceFlagsSourceTask.cpp
Go to the documentation of this file.
1
17
/*
18
* Copyright (C) 2012-2020 Euclid Science Ground Segment
19
*
20
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
21
* Public License as published by the Free Software Foundation; either version 3.0 of the License, or (at your option)
22
* any later version.
23
*
24
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
25
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
26
* details.
27
*
28
* You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to
29
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
30
*/
31
39
#include "
SEImplementation/Plugin/BlendedFlag/BlendedFlag.h
"
40
#include "
SEImplementation/Plugin/SourceFlags/SourceFlagsSourceTask.h
"
41
#include "
SEImplementation/Plugin/SourceFlags/SourceFlags.h
"
42
43
namespace
SourceXtractor
{
44
45
void
SourceFlagsSourceTask::computeProperties
(
SourceInterface
&source)
const
{
46
std::vector<Flags>
source_flags
;
47
48
for
(
auto
group :
m_instances_per_group
) {
49
Flags
source_flag = Flags::NONE;
50
51
for
(
auto
instance : group.second) {
52
source_flag |= Flags::SATURATED * source.
getProperty
<
SaturateFlag
>(instance).getSaturateFlag();
53
source_flag |= Flags::BOUNDARY * source.
getProperty
<
BoundaryFlag
>(instance).getBoundaryFlag();
54
source_flag |= Flags::BLENDED * source.
getProperty
<
BlendedFlag
>().getBlendedFlag();
55
}
56
57
source_flags
.emplace_back(source_flag);
58
}
59
60
// set the combined source flag
61
source.
setProperty
<
SourceFlags
>(
source_flags
);
62
}
63
64
}
// end SourceXtractor
SourceXtractor::BoundaryFlag
Definition:
BoundaryFlag.h:46
SourceXtractor::BlendedFlag
Definition:
BlendedFlag.h:31
std::vector< Flags >
SourceFlags.h
SourceXtractor::Flags
Flags
Flagging of bad sources.
Definition:
SourceFlags.h:37
SourceXtractor::SourceFlags
Definition:
SourceFlags.h:48
SourceXtractor::source_flags
static StaticPlugin< SourceFlagsPlugin > source_flags
Definition:
SourceFlagsPlugin.cpp:43
SourceXtractor
Definition:
Aperture.h:30
SourceXtractor::SourceFlagsSourceTask::computeProperties
virtual void computeProperties(SourceInterface &source) const
Computes one or more properties for the Source.
Definition:
SourceFlagsSourceTask.cpp:45
SourceXtractor::SaturateFlag
Definition:
SaturateFlag.h:46
SourceFlagsSourceTask.h
SourceXtractor::SourceFlagsSourceTask::m_instances_per_group
std::map< std::string, std::vector< unsigned int > > m_instances_per_group
Definition:
SourceFlagsSourceTask.h:58
SourceXtractor::SourceInterface::getProperty
const PropertyType & getProperty(unsigned int index=0) const
Convenience template method to call getProperty() with a more user-friendly syntax.
Definition:
SourceInterface.h:57
BlendedFlag.h
SourceXtractor::SourceInterface
The SourceInterface is an abstract "source" that has properties attached to it.
Definition:
SourceInterface.h:46
SourceXtractor::SourceInterface::setProperty
void setProperty(Args... args)
Definition:
SourceInterface.h:72
Generated by
1.8.20