SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
FluxRadiusConfig.cpp
Go to the documentation of this file.
1
17
19#include <AlexandriaKernel/StringUtils.h>
20
21using namespace Euclid::Configuration;
22namespace po = boost::program_options;
23
24namespace SourceXtractor {
25
26static const std::string FLUX_FRACTION{"flux-fraction"};
27
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>();
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
53
54} // end of namespace SourceXtractor
T at(T... args)
std::map< std::string, boost::program_options::variable_value > UserValues
const std::vector< SeFloat > & getFluxFraction() const
std::vector< SeFloat > m_flux_fraction
void initialize(const UserValues &args) override
std::map< std::string, OptionDescriptionList > getProgramOptions() override
std::vector< T > stringToVector(std::string str, const std::string &separators=std::string(", "))
static const std::string FLUX_FRACTION