33 namespace po = boost::program_options;
44 DetectionImageConfig::DetectionImageConfig(
long manager_id) :
Configuration(manager_id),
45 m_gain(0), m_saturation(0), m_flux_scale(1.0), m_interpolation_gap(0) {
49 return { {
"Detection image", {
51 "Path to a fits format image to be used as detection image."},
53 "Detection image gain in e-/ADU (0 = infinite gain)"},
55 "Detection image flux scale"},
57 "Detection image saturation level (0 = no saturation)"},
59 "Interpolate bad pixels in detection image"},
61 "Maximum number if pixels to interpolate over"}
79 double detection_image_gain = 0, detection_image_saturate = 0;
82 if (img_metadata.count(
"GAIN")){
84 if (
double* double_gain = boost::get<double>(&img_metadata.at(
"GAIN").m_value)){
85 detection_image_gain = *double_gain;
86 }
else if (
int64_t *int64_gain = boost::get<int64_t>(&img_metadata.at(
"GAIN").m_value)){
87 detection_image_gain = (double) *int64_gain;
94 if (img_metadata.count(
"SATURATE")){
96 if (
double* double_saturate = boost::get<double>(&img_metadata.at(
"SATURATE").m_value)){
97 detection_image_saturate = *double_saturate;
98 }
else if (
int64_t *int64_saturate = boost::get<int64_t>(&img_metadata.at(
"SATURATE").m_value)){
99 detection_image_saturate = (double) *int64_saturate;
109 else if (img_metadata.count(
"FLXSCALE")) {
111 if (
double* f_scale = boost::get<double>(&img_metadata.at(
"FLXSCALE").m_value)){
113 }
else if (
int64_t *int64_f_scale = boost::get<int64_t>(&img_metadata.at(
"FLXSCALE").m_value)){
125 m_gain = detection_image_gain;
152 throw Elements::Exception() <<
"getDetectionImage() call on not initialized DetectionImageConfig";
159 throw Elements::Exception() <<
"getCoordinateSystem() call on not initialized DetectionImageConfig";
State & getCurrentState()