SourceXtractorPlusPlus  0.13
Please provide a description of the project.
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 
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 
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 
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 
SourceXtractor::USE_CLEANING
static const std::string USE_CLEANING
Definition: CleaningConfig.cpp:36
std::string
STL class.
std::shared_ptr< SourceFactory >
Cleaning.h
SourceXtractor::CleaningConfig::initialize
void initialize(const UserValues &args) override
Definition: CleaningConfig.cpp:51
Deblending.h
Euclid::Configuration
SourceXtractor
Definition: Aperture.h:30
std::map::at
T at(T... args)
std::string::c_str
T c_str(T... args)
Elements::Exception
CleaningConfig.h
DeblendStepConfig.h
std::map
STL class.
SourceXtractor::CleaningConfig::getProgramOptions
std::map< std::string, OptionDescriptionList > getProgramOptions() override
Definition: CleaningConfig.cpp:43
Euclid::Configuration::Configuration
SourceXtractor::CLEANING_MINAREA
static const std::string CLEANING_MINAREA
Definition: CleaningConfig.cpp:37