SourceXtractorPlusPlus
0.16
Please provide a description of the project.
SEImplementation
src
lib
Configuration
SamplingConfig.cpp
Go to the documentation of this file.
1
18
#include <boost/algorithm/string.hpp>
19
20
#include "
SEImplementation/Configuration/SamplingConfig.h
"
21
22
using namespace
Euclid::Configuration
;
23
namespace
po = boost::program_options;
24
25
namespace
SourceXtractor
{
26
27
//static const std::string SAMPLING_ADAPTIVE_TARGET {"sampling-adaptive-target"};
28
static
const
std::string
SAMPLING_SCALE_FACTOR
{
"sampling-scale-factor"
};
29
static
const
std::string
SAMPLING_MAX_FIT_SIZE
{
"sampling-max-fit-size"
};
30
31
SamplingConfig::SamplingConfig(
long
manager_id) :
Configuration
(manager_id),
32
m_adaptive_target(0.001), m_scale_factor(1.0), m_max_fit_size(1000) {}
33
34
auto
SamplingConfig::getProgramOptions
() ->
std::map<std::string, OptionDescriptionList>
{
35
return
{{
"Model Fitting Sampling"
,
36
{
37
// {SAMPLING_ADAPTIVE_TARGET.c_str(), po::value<double>()->default_value(0.001),
38
// "Adaptive sampling will stop when difference is less than this"},
39
{
SAMPLING_SCALE_FACTOR
.
c_str
(), po::value<double>()->default_value(1.0),
40
"Scaling factor for the rendering of models (e.g. 2 = twice the resolution)"
},
41
{
SAMPLING_MAX_FIT_SIZE
.
c_str
(), po::value<size_t>()->default_value(1000),
42
"Size of maximum fit area before downsampling (in pixels, one side)"
}
43
}
44
}};
45
}
46
47
void
SamplingConfig::preInitialize
(
const
UserValues
& args) {
48
}
49
50
void
SamplingConfig::initialize
(
const
UserValues
& args) {
51
// m_adaptive_target = args.at(SAMPLING_ADAPTIVE_TARGET).as<double>();
52
m_scale_factor
= args.
at
(
SAMPLING_SCALE_FACTOR
).as<
double
>();
53
m_max_fit_size
= args.
at
(
SAMPLING_MAX_FIT_SIZE
).as<
size_t
>();
54
}
55
56
}
/* namespace SourceXtractor */
SamplingConfig.h
std::map::at
T at(T... args)
std::string
std::string::c_str
T c_str(T... args)
Euclid::Configuration::Configuration
SourceXtractor::SamplingConfig::preInitialize
void preInitialize(const UserValues &args) override
Definition:
SamplingConfig.cpp:47
SourceXtractor::SamplingConfig::getProgramOptions
std::map< std::string, OptionDescriptionList > getProgramOptions() override
Definition:
SamplingConfig.cpp:34
SourceXtractor::SamplingConfig::initialize
void initialize(const UserValues &args) override
Definition:
SamplingConfig.cpp:50
SourceXtractor::SamplingConfig::m_max_fit_size
size_t m_max_fit_size
Definition:
SamplingConfig.h:55
SourceXtractor::SamplingConfig::m_scale_factor
double m_scale_factor
Definition:
SamplingConfig.h:54
std::map
Euclid::Configuration
SourceXtractor
Definition:
Aperture.h:30
SourceXtractor::SAMPLING_MAX_FIT_SIZE
static const std::string SAMPLING_MAX_FIT_SIZE
Definition:
SamplingConfig.cpp:29
SourceXtractor::SAMPLING_SCALE_FACTOR
static const std::string SAMPLING_SCALE_FACTOR
Definition:
SamplingConfig.cpp:28
Generated by
1.9.1