Alexandria 2.31.0
SDC-CH common library for the Euclid project
|
Configuration class which provides the information of the mapping between photometric bands and column names. More...
#include <PhotometricBandMappingConfig.h>
Public Types | |
using | MappingMap = std::vector< std::pair< std::string, std::pair< std::string, std::string > > > |
using | UpperLimitThresholdMap = std::vector< std::pair< std::string, float > > |
using | ConvertFromMagMap = std::vector< std::pair< std::string, bool > > |
![]() | |
enum class | State { CONSTRUCTED , PRE_INITIALIZED , INITIALIZED , FINAL } |
Defines the different states the configuration object can be in. More... | |
using | OptionDescriptionList = std::vector< boost::program_options::option_description > |
using | UserValues = std::map< std::string, boost::program_options::variable_value > |
Public Member Functions | |
PhotometricBandMappingConfig (long manager_id) | |
Constructs a new PhotometricBandMappingConfig object. | |
virtual | ~PhotometricBandMappingConfig ()=default |
Destructor. | |
std::map< std::string, OptionDescriptionList > | getProgramOptions () override |
Returns the program options defined by the PhotometryCatalogConfig. | |
void | initialize (const UserValues &args) override |
It initializes the photometric bands list. | |
void | setBaseDir (const boost::filesystem::path &base_dir) |
Sets the directory used when resolving relative paths. | |
const MappingMap & | getPhotometricBandMapping () |
Returns the list of the photometric band mapping which will be red from the catalog. | |
const UpperLimitThresholdMap & | getUpperLimitThresholdMapping () |
Returns the mapping of threshold used in the upper limit computation which will be red from the catalog. | |
const ConvertFromMagMap & | getConvertFromMagMapping () |
Returns the mapping of the flag indicating if the photometry has to be computed from a MAG_AB. | |
const boost::filesystem::path | getMappingFile () |
Returns the mapping file to be used by other configuration class. | |
![]() | |
Configuration (long manager_id) | |
Constructs a new Configuration instance. | |
virtual | ~Configuration ()=default |
Destructor. | |
virtual void | preInitialize (const UserValues &args) |
Method which is called before the initialization phase. | |
virtual void | postInitialize (const UserValues &args) |
Method which is called after the initialization phase. | |
const std::set< std::type_index > & | getDependencies () |
Returns the dependencies of the configuration. | |
State & | getCurrentState () |
Returns the current state of the configuration. | |
State | getCurrentState () const |
Returns the current state of the configuration. | |
Private Attributes | |
boost::filesystem::path | m_base_dir |
boost::filesystem::path | m_mapping_file |
MappingMap | m_mapping_map |
UpperLimitThresholdMap | m_threshold_map |
ConvertFromMagMap | m_convert_from_mag_map |
Additional Inherited Members | |
![]() | |
template<typename T > | |
void | declareDependency () |
Declares a Configuration as dependency. | |
template<typename T > | |
T & | getDependency () |
Returns a dependency. | |
template<typename T > | |
const T & | getDependency () const |
Configuration class which provides the information of the mapping between photometric bands and column names.
Definition at line 45 of file PhotometricBandMappingConfig.h.
using Euclid::Configuration::PhotometricBandMappingConfig::ConvertFromMagMap = std::vector<std::pair<std::string, bool> > |
Definition at line 50 of file PhotometricBandMappingConfig.h.
using Euclid::Configuration::PhotometricBandMappingConfig::MappingMap = std::vector<std::pair<std::string, std::pair<std::string, std::string> >> |
Definition at line 48 of file PhotometricBandMappingConfig.h.
using Euclid::Configuration::PhotometricBandMappingConfig::UpperLimitThresholdMap = std::vector<std::pair<std::string, float> > |
Definition at line 49 of file PhotometricBandMappingConfig.h.
|
explicit |
Constructs a new PhotometricBandMappingConfig object.
Definition at line 46 of file PhotometricBandMappingConfig.cpp.
|
virtualdefault |
Destructor.
const PhotometricBandMappingConfig::ConvertFromMagMap & Euclid::Configuration::PhotometricBandMappingConfig::getConvertFromMagMapping | ( | ) |
Returns the mapping of the flag indicating if the photometry has to be computed from a MAG_AB.
Elements::Exception | If the instance is not yet initialized |
Definition at line 229 of file PhotometricBandMappingConfig.cpp.
References Euclid::Configuration::Configuration::getCurrentState(), Euclid::Configuration::Configuration::INITIALIZED, and m_convert_from_mag_map.
const fs::path Euclid::Configuration::PhotometricBandMappingConfig::getMappingFile | ( | ) |
Returns the mapping file to be used by other configuration class.
Elements::Exception | If the instance is not yet initialized |
Definition at line 237 of file PhotometricBandMappingConfig.cpp.
References Euclid::Configuration::Configuration::getCurrentState(), Euclid::Configuration::Configuration::INITIALIZED, and m_mapping_file.
const PhotometricBandMappingConfig::MappingMap & Euclid::Configuration::PhotometricBandMappingConfig::getPhotometricBandMapping | ( | ) |
Returns the list of the photometric band mapping which will be red from the catalog.
Elements::Exception | If the instance is not yet initialized |
Definition at line 212 of file PhotometricBandMappingConfig.cpp.
References Euclid::Configuration::Configuration::getCurrentState(), Euclid::Configuration::Configuration::INITIALIZED, and m_mapping_map.
|
overridevirtual |
Returns the program options defined by the PhotometryCatalogConfig.
These options are:
All options are in a group called "Input catalog options". They are all optional. The filter-mapping-file to the file filter_mapping.txt. If it is is a relative path, it is relative to the directory set via the setBaseDir() method, during the pre-initialize phase.
Reimplemented from Euclid::Configuration::Configuration.
Definition at line 48 of file PhotometricBandMappingConfig.cpp.
References std::string::c_str(), Euclid::Configuration::EXCLUDE_FILTER, and Euclid::Configuration::FILTER_MAPPING_FILE.
const PhotometricBandMappingConfig::UpperLimitThresholdMap & Euclid::Configuration::PhotometricBandMappingConfig::getUpperLimitThresholdMapping | ( | ) |
Returns the mapping of threshold used in the upper limit computation which will be red from the catalog.
Elements::Exception | If the instance is not yet initialized |
Definition at line 221 of file PhotometricBandMappingConfig.cpp.
References Euclid::Configuration::Configuration::getCurrentState(), Euclid::Configuration::Configuration::INITIALIZED, and m_threshold_map.
|
overridevirtual |
It initializes the photometric bands list.
args | The user parameters |
Elements::Exception | If the filter mapping file does not exist |
Elements::Exception | If there are syntax errors in the filter mapping file (all non comment lines must be like "FILTER_NAME FLUX_COLUMN_NAME ERROR_COLUMN_NAME") |
Elements::Exception | If any filter in the exclude-filter list does not exist in the file |
Reimplemented from Euclid::Configuration::Configuration.
Definition at line 163 of file PhotometricBandMappingConfig.cpp.
References std::map< K, T >::at(), std::set< K >::begin(), Euclid::Configuration::EXCLUDE_FILTER, Euclid::Configuration::getMappingFileFromOptions(), m_base_dir, m_convert_from_mag_map, m_mapping_file, m_mapping_map, m_threshold_map, Euclid::Configuration::parseFile(), and std::vector< T >::push_back().
void Euclid::Configuration::PhotometricBandMappingConfig::setBaseDir | ( | const boost::filesystem::path & | base_dir | ) |
Sets the directory used when resolving relative paths.
This method can be called by other Configuration classes during the pre- initialization phase. By default the current working directory is used.
base_dir | The directory to use for resolving relative paths |
Elements::Exception | If the instance has already been initialized |
Definition at line 205 of file PhotometricBandMappingConfig.cpp.
References Euclid::Configuration::Configuration::getCurrentState(), Euclid::Configuration::Configuration::INITIALIZED, and m_base_dir.
|
private |
Definition at line 154 of file PhotometricBandMappingConfig.h.
Referenced by initialize(), and setBaseDir().
|
private |
Definition at line 158 of file PhotometricBandMappingConfig.h.
Referenced by getConvertFromMagMapping(), and initialize().
|
private |
Definition at line 155 of file PhotometricBandMappingConfig.h.
Referenced by getMappingFile(), and initialize().
|
private |
Definition at line 156 of file PhotometricBandMappingConfig.h.
Referenced by getPhotometricBandMapping(), and initialize().
|
private |
Definition at line 157 of file PhotometricBandMappingConfig.h.
Referenced by getUpperLimitThresholdMapping(), and initialize().