31 #include "../../SourceCatalog/PhotometryParsingException.h"
40 namespace SourceCatalog {
42 PhotometryAttributeFromRow::PhotometryAttributeFromRow(
45 const bool missing_photometry_enabled,
46 const double missing_photometry_flag,
47 const bool upper_limit_enabled,
49 const double n_upper_limit_flag) :
50 m_missing_photometry_enabled(missing_photometry_enabled),
51 m_missing_photometry_flag(missing_photometry_flag),
52 m_upper_limit_enabled(upper_limit_enabled),
54 m_n_upper_limit_flag(n_upper_limit_flag) {
59 for (
auto filter_name_pair : filter_name_mapping) {
60 flux_column_index_ptr = column_info_ptr->
find(filter_name_pair.second.first);
61 error_column_index_ptr = column_info_ptr->
find(filter_name_pair.second.second);
63 if (flux_column_index_ptr ==
nullptr) {
65 << filter_name_pair.second.first;
67 if (error_column_index_ptr ==
nullptr) {
69 << filter_name_pair.second.second;
76 for(
auto a_filter_name_map: filter_name_mapping) {
99 bool missing_data =
false;
100 bool upper_limit =
false;
103 "Infinite flux encountered when parsing the Photometry",
117 "Zero error encountered when parsing the Photometry with 'missing data' and 'upper limit' enabled",
124 error = flux / n_threshod_iter->second;
129 "Negative or Zero flux encountered when parsing the Photometry in the context of an 'upper limit'",
134 error=std::abs(error);
140 "Negative or Zero error encountered when parsing the Photometry with 'missing data' enabled and 'upper limit' disabled",
151 "NAN flux encountered when parsing the Photometry with 'missing data' disabled",
160 "Zero error encountered when parsing the Photometry with 'missing data' disabled and 'upper limit' enabled",
168 error = flux / n_threshod_iter->second;
172 "Negative or Zero flux encountered when parsing the Photometry in the context of an 'upper limit'",
176 error=std::abs(error);
184 "Negative or Zero error encountered when parsing the Photometry with 'missing data' and 'upper limit' disabled",
194 photometry_vector.push_back(
FluxErrorPair{flux, error, missing_data, upper_limit});
200 return photometry_ptr;