SourceXtractorPlusPlus  0.12
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BackgroundConfig.cpp
Go to the documentation of this file.
1 
17 /*
18  * @file BackgroundConfig.cpp
19  * @author nikoapos
20  */
21 
24 
25 using namespace Euclid::Configuration;
26 namespace po = boost::program_options;
27 
28 namespace SourceXtractor {
29 
30 static const std::string BACKGROUND_VALUE {"background-value" };
31 static const std::string THRESHOLD_VALUE {"detection-threshold" };
32 
33 BackgroundConfig::BackgroundConfig(long manager_id) :
34  Configuration(manager_id),
35  m_background_level_absolute(false),
36  m_background_level(0),
37  m_detection_threshold_absolute(false),
38  m_detection_threshold(0) {
39 }
40 
42  return { {"Detection image", {
43  {BACKGROUND_VALUE.c_str(), po::value<double>(),
44  "Background value to be subtracted from the detection image."},
45  {THRESHOLD_VALUE.c_str(), po::value<double>()->default_value((1.5)),
46  "Detection threshold above the background."},
47  }}};
48 }
49 
50 void BackgroundConfig::initialize(const UserValues& args) {
51  if (args.find(BACKGROUND_VALUE) != args.end()) {
53  m_background_level = args.find(BACKGROUND_VALUE)->second.as<double>();
54  }
55  if (args.find(THRESHOLD_VALUE) != args.end()) {
57  m_detection_threshold = args.find(THRESHOLD_VALUE)->second.as<double>();
58  }
59 }
60 
61 } // SourceXtractor namespace
static const std::string THRESHOLD_VALUE
STL class.
STL class.
static const std::string BACKGROUND_VALUE
void initialize(const UserValues &args) override
T c_str(T...args)
std::map< std::string, Configuration::OptionDescriptionList > getProgramOptions() override