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) :
48 m_missing_photometry_enabled(missing_photometry_enabled),
49 m_missing_photometry_flag(missing_photometry_flag),
50 m_upper_limit_enabled(upper_limit_enabled){
55 for (
auto filter_name_pair : filter_name_mapping) {
56 flux_column_index_ptr = column_info_ptr->
find(filter_name_pair.second.first);
57 error_column_index_ptr = column_info_ptr->
find(filter_name_pair.second.second);
59 if (flux_column_index_ptr ==
nullptr) {
61 << filter_name_pair.second.first;
63 if (error_column_index_ptr ==
nullptr) {
65 << filter_name_pair.second.second;
72 for(
auto a_filter_name_map: filter_name_mapping) {
94 bool missing_data =
false;
95 bool upper_limit =
false;
98 "Infinite flux encountered when parsing the Photometry",
112 "Zero error encountered when parsing the Photometry with 'missing data' and 'upper limit' enabled",
121 "Negative or Zero flux encountered when parsing the Photometry in the context of an 'upper limit'",
125 error=std::abs(error);
131 "Negative or Zero error encountered when parsing the Photometry with 'missing data' enabled and 'upper limit' disabled",
142 "NAN flux encountered when parsing the Photometry with 'missing data' disabled",
151 "Zero error encountered when parsing the Photometry with 'missing data' disabled and 'upper limit' enabled",
160 "Negative or Zero flux encountered when parsing the Photometry in the context of an 'upper limit'",
164 error=std::abs(error);
172 "Negative or Zero error encountered when parsing the Photometry with 'missing data' and 'upper limit' disabled",
182 photometry_vector.push_back(
FluxErrorPair{flux, error, missing_data, upper_limit});
187 return photometry_ptr;