SourceXtractorPlusPlus
0.10
Please provide a description of the project.
SEImplementation
src
lib
Configuration
CleaningConfig.cpp
Go to the documentation of this file.
1
17
/*
18
* CleaningConfig.cpp
19
*
20
* Created on: 2019 M02 6
21
* Author: mschefer
22
*/
23
24
#include <
SEImplementation/Configuration/DeblendStepConfig.h
>
25
#include "
SEFramework/Pipeline/Deblending.h
"
26
27
#include "
SEImplementation/Deblending/Cleaning.h
"
28
29
#include "
SEImplementation/Configuration/CleaningConfig.h
"
30
31
using namespace
Euclid::Configuration;
32
namespace
po = boost::program_options;
33
34
namespace
SourceXtractor
{
35
36
static
const
std::string
USE_CLEANING
{
"use-cleaning"
};
37
static
const
std::string
CLEANING_MINAREA
{
"cleaning-minimum-area"
};
38
39
CleaningConfig::CleaningConfig(
long
manager_id) :
Configuration
(manager_id) {
40
declareDependency<DeblendStepConfig>();
41
}
42
43
std::map<std::string, Configuration::OptionDescriptionList>
CleaningConfig::getProgramOptions
() {
44
return
{ {
"Cleaning"
, {
45
{
USE_CLEANING
.
c_str
(), po::bool_switch(),
46
"Enables the cleaning of sources (removes false detections near bright objects)"
},
47
{
CLEANING_MINAREA
.
c_str
(), po::value<int>()->default_value(3),
"min. # of pixels above threshold"
}
48
}}};
49
}
50
51
void
CleaningConfig::initialize
(
const
UserValues
& args) {
52
auto
min_area = args.
at
(
CLEANING_MINAREA
).as<
int
>();
53
if
(args.
at
(
USE_CLEANING
).as<
bool
>()) {
54
if
(min_area <= 0) {
55
throw
Elements::Exception
() <<
"Invalid "
<<
CLEANING_MINAREA
<<
" value: "
<< min_area;
56
}
57
getDependency<DeblendStepConfig>().addDeblendStepCreator(
58
[min_area](
std::shared_ptr<SourceFactory>
source_factory) {
59
return
std::make_shared<Cleaning>(source_factory, min_area);
60
}
61
);
62
}
63
}
64
65
}
// SourceXtractor namespace
66
67
68
std::shared_ptr< SourceFactory >
SourceXtractor::CLEANING_MINAREA
static const std::string CLEANING_MINAREA
Definition:
CleaningConfig.cpp:37
Euclid::Configuration::Configuration
std::map
STL class.
SourceXtractor::CleaningConfig::getProgramOptions
std::map< std::string, OptionDescriptionList > getProgramOptions() override
Definition:
CleaningConfig.cpp:43
std::string
STL class.
std::map::at
T at(T... args)
SourceXtractor::CleaningConfig::initialize
void initialize(const UserValues &args) override
Definition:
CleaningConfig.cpp:51
SourceXtractor::USE_CLEANING
static const std::string USE_CLEANING
Definition:
CleaningConfig.cpp:36
SourceXtractor
Definition:
Aperture.h:30
DeblendStepConfig.h
Deblending.h
Cleaning.h
Elements::Exception
std::string::c_str
T c_str(T... args)
CleaningConfig.h
Generated by
1.8.15