SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
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
26
28
30
31using namespace Euclid::Configuration;
32namespace po = boost::program_options;
33
34namespace SourceXtractor {
35
36static const std::string USE_CLEANING {"use-cleaning"};
37static const std::string CLEANING_MINAREA {"cleaning-minimum-area"};
38
42
44 return { {"Cleaning", {
45 {USE_CLEANING.c_str(), po::value<bool>()->default_value(false),
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
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
T at(T... args)
std::map< std::string, boost::program_options::variable_value > UserValues
void initialize(const UserValues &args) override
std::map< std::string, OptionDescriptionList > getProgramOptions() override
T make_shared(T... args)
static const std::string CLEANING_MINAREA
static const std::string USE_CLEANING