SourceXtractorPlusPlus  0.11
Please provide a description of the project.
FluxRadiusConfig.cpp
Go to the documentation of this file.
1 
20 
21 using namespace Euclid::Configuration;
22 namespace po = boost::program_options;
23 
24 namespace SourceXtractor {
25 
26 static const std::string FLUX_FRACTION{"flux-fraction"};
27 
28 FluxRadiusConfig::FluxRadiusConfig(long managerId) : Configuration(managerId) {}
29 
31  return {{"Flux radius", {
32  {FLUX_FRACTION.c_str(), po::value<std::string>()->default_value("0.5"),
33  "Fraction of flux defining each element of the flux_radius vector"}
34  }}};
35 }
36 
38  auto flux_fraction_str = args.at(FLUX_FRACTION).as<std::string>();
39  m_flux_fraction = Euclid::stringToVector<SeFloat>(flux_fraction_str);
40  if (m_flux_fraction.empty()) {
41  throw Elements::Exception() << FLUX_FRACTION << " must contain at least one element";
42  }
43  for (auto frac : m_flux_fraction) {
44  if (frac <= 0 || frac >= 1) {
45  throw Elements::Exception() << FLUX_FRACTION << " only accepts values strictly between 0 and 1";
46  }
47  }
48 }
49 
51  return m_flux_fraction;
52 }
53 
54 } // end of namespace SourceXtractor
T empty(T... args)
std::map< std::string, OptionDescriptionList > getProgramOptions() override
void initialize(const UserValues &args) override
const std::vector< SeFloat > & getFluxFraction() const
STL class.
STL class.
T at(T... args)
std::vector< SeFloat > m_flux_fraction
static const std::string FLUX_FRACTION
T c_str(T... args)