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;
boost::variant< bool, int32_t, int64_t, float, double, std::string, std::vector< bool >, std::vector< int32_t >, std::vector< int64_t >, std::vector< float >, std::vector< double >, NdArray::NdArray< bool >, NdArray::NdArray< int32_t >, NdArray::NdArray< int64_t >, NdArray::NdArray< float >, NdArray::NdArray< double > > cell_type
The possible cell types.
std::unique_ptr< Attribute > createAttribute(const Euclid::Table::Row &row) override
Create a photometricAttribute from a Table row.
bool m_missing_photometry_enabled
std::vector< std::pair< size_t, size_t > > m_table_index_vector
Represents one row of a Table.
double m_missing_photometry_flag
std::shared_ptr< std::vector< std::string > > m_filter_name_vector_ptr
virtual ~PhotometryAttributeFromRow()
bool isEqual(const RawType &left, const RawType &right)
bool m_upper_limit_enabled