26 #ifndef SPECTROSCOPICATTRIBUTEFROMROW_H_ 27 #define SPECTROSCOPICATTRIBUTEFROMROW_H_ 43 namespace SourceCatalog {
82 if (specz_value_column_index_ptr ==
nullptr) {
83 throw Elements::Exception() <<
"Column info does not have the spectroscopic redshift value column!";
87 if (specz_error_column_index_ptr ==
nullptr) {
88 throw Elements::Exception() <<
"Column info does not have the spectroscopic redshift error column!";
91 m_has_error_column=
true;
92 m_error_column_index = *(specz_error_column_index_ptr);
93 m_value_column_index = *(specz_value_column_index_ptr);
118 if (specz_value_column_index_ptr ==
nullptr) {
119 throw Elements::Exception() <<
"Column info does not have the spectroscopic redshift value column!";
122 m_has_error_column=
false;
123 m_error_column_index = 0;
124 m_value_column_index = *(specz_value_column_index_ptr);
127 logger.
warn() <<
"specz error values are set to zero by default! ";
143 if (m_has_error_column) {
163 #endif // SPECTROSCOPICATTRIBUTEFROMROW_H_
SpectroscopicRedshiftAttributeFromRow(std::shared_ptr< Euclid::Table::ColumnInfo > column_info_ptr, const std::string &specz_value_column_name)
Create a SpectroscopicRedshiftAttributeFromRow object.
std::unique_ptr< std::size_t > find(const std::string &name) const
Returns the index of a column, given the name of it, or nullptr if there is no column with this name.
std::unique_ptr< Attribute > createAttribute(const Euclid::Table::Row &row) override
Create a photometricAttribute from a Table row.
Implementation of the AttributeFromRow for a SpectroscopicRedshift attribute. This class implements t...
static Elements::Logging logger
SpectroscopicRedshiftAttributeFromRow(std::shared_ptr< Euclid::Table::ColumnInfo > column_info_ptr, const std::string &specz_value_column_name, const std::string &specz_error_column_name)
Create a SpectroscopicRedshiftAttributeFromRow object.
void warn(const std::string &logMessage)
size_t m_error_column_index
virtual ~SpectroscopicRedshiftAttributeFromRow()
Interface for building a source Attribute from a table Row.
Represents one row of a Table.
static Logging getLogger(const std::string &name="")
size_t m_value_column_index
Store the spectroscopic redshift of a source.