Alexandria  2.16
Please provide a description of the project.
Public Types | Public Member Functions | Private Attributes | List of all members
Euclid::Configuration::PhotometricBandMappingConfig Class Reference

Configuration class which provides the information of the mapping between photometric bands and column names. More...

#include <PhotometricBandMappingConfig.h>

Inheritance diagram for Euclid::Configuration::PhotometricBandMappingConfig:
[legend]
Collaboration diagram for Euclid::Configuration::PhotometricBandMappingConfig:
[legend]

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 > >
 
- Public Types inherited from Euclid::Configuration::Configuration
enum  State { State::CONSTRUCTED, State::PRE_INITIALIZED, State::INITIALIZED, State::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. More...
 
virtual ~PhotometricBandMappingConfig ()=default
 Destructor. More...
 
std::map< std::string, OptionDescriptionList > getProgramOptions () override
 Returns the program options defined by the PhotometryCatalogConfig. More...
 
void initialize (const UserValues &args) override
 It initializes the photometric bands list. More...
 
void setBaseDir (const boost::filesystem::path &base_dir)
 Sets the directory used when resolving relative paths. More...
 
const MappingMap & getPhotometricBandMapping ()
 Returns the list of the photometric band mapping which will be red from the catalog. More...
 
const UpperLimitThresholdMap & getUpperLimitThresholdMapping ()
 Returns the mapping of threshold used in the upper limit computation which will be red from the catalog. More...
 
- Public Member Functions inherited from Euclid::Configuration::Configuration
 Configuration (long manager_id)
 Constructs a new Configuration instance. More...
 
virtual ~Configuration ()=default
 Destructor. More...
 
virtual void preInitialize (const UserValues &args)
 Method which is called before the initialization phase. More...
 
virtual void postInitialize (const UserValues &args)
 Method which is called after the initialization phase. More...
 
const std::set< std::type_index > & getDependencies ()
 Returns the dependencies of the configuration. More...
 
State & getCurrentState ()
 Returns the current state of the configuration. More...
 
State getCurrentState () const
 Returns the current state of the configuration. More...
 

Private Attributes

boost::filesystem::path m_base_dir {}
 
MappingMap m_mapping_map {}
 
UpperLimitThresholdMap m_threshold_map {}
 

Additional Inherited Members

- Protected Member Functions inherited from Euclid::Configuration::Configuration
template<typename T >
void declareDependency ()
 Declares a Configuration as dependency. More...
 
template<typename T >
T & getDependency ()
 Returns a dependency. More...
 
template<typename T >
const T & getDependency () const
 

Detailed Description

Configuration class which provides the information of the mapping between photometric bands and column names.

Definition at line 45 of file PhotometricBandMappingConfig.h.

Member Typedef Documentation

◆ MappingMap

Definition at line 49 of file PhotometricBandMappingConfig.h.

◆ UpperLimitThresholdMap

Definition at line 50 of file PhotometricBandMappingConfig.h.

Constructor & Destructor Documentation

◆ PhotometricBandMappingConfig()

Euclid::Configuration::PhotometricBandMappingConfig::PhotometricBandMappingConfig ( long  manager_id)
explicit

Constructs a new PhotometricBandMappingConfig object.

Definition at line 49 of file PhotometricBandMappingConfig.cpp.

◆ ~PhotometricBandMappingConfig()

virtual Euclid::Configuration::PhotometricBandMappingConfig::~PhotometricBandMappingConfig ( )
virtualdefault

Destructor.

Member Function Documentation

◆ getPhotometricBandMapping()

const PhotometricBandMappingConfig::MappingMap & Euclid::Configuration::PhotometricBandMappingConfig::getPhotometricBandMapping ( )

Returns the list of the photometric band mapping which will be red from the catalog.

Returns
The list of the photometric band mapping
Exceptions
Elements::ExceptionIf the instance is not yet initialized

Definition at line 149 of file PhotometricBandMappingConfig.cpp.

References Euclid::Configuration::Configuration::getCurrentState(), Euclid::Configuration::Configuration::INITIALIZED, and m_mapping_map.

Here is the call graph for this function:

◆ getProgramOptions()

auto Euclid::Configuration::PhotometricBandMappingConfig::getProgramOptions ( )
overridevirtual

Returns the program options defined by the PhotometryCatalogConfig.

These options are:

  • filter-mapping-file : The file containing the catalog columns mapping
  • exclude-filter : The photometries to ignore

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.

Returns
The map with the option descriptions

Reimplemented from Euclid::Configuration::Configuration.

Definition at line 52 of file PhotometricBandMappingConfig.cpp.

References std::string::c_str(), Euclid::Configuration::EXCLUDE_FILTER, and Euclid::Configuration::FILTER_MAPPING_FILE.

Here is the call graph for this function:

◆ getUpperLimitThresholdMapping()

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.

Returns
The mapping of upper limit threshold
Exceptions
Elements::ExceptionIf the instance is not yet initialized

Definition at line 158 of file PhotometricBandMappingConfig.cpp.

References Euclid::Configuration::Configuration::getCurrentState(), Euclid::Configuration::Configuration::INITIALIZED, and m_threshold_map.

Here is the call graph for this function:

◆ initialize()

void Euclid::Configuration::PhotometricBandMappingConfig::initialize ( const UserValues &  args)
overridevirtual

It initializes the photometric bands list.

Parameters
argsThe user parameters
Exceptions
Elements::ExceptionIf the filter mapping file does not exist
Elements::ExceptionIf 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::ExceptionIf any filter in the exclude-filter list does not exist in the file

Reimplemented from Euclid::Configuration::Configuration.

Definition at line 104 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_mapping_map, m_threshold_map, Euclid::Configuration::parseFile(), and std::vector< T >::push_back().

Here is the call graph for this function:

◆ setBaseDir()

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.

Parameters
base_dirThe directory to use for resolving relative paths
Exceptions
Elements::ExceptionIf the instance has already been initialized

Definition at line 142 of file PhotometricBandMappingConfig.cpp.

References Euclid::Configuration::Configuration::getCurrentState(), Euclid::Configuration::Configuration::INITIALIZED, and m_base_dir.

Here is the call graph for this function:

Member Data Documentation

◆ m_base_dir

boost::filesystem::path Euclid::Configuration::PhotometricBandMappingConfig::m_base_dir {}
private

Definition at line 133 of file PhotometricBandMappingConfig.h.

Referenced by initialize(), and setBaseDir().

◆ m_mapping_map

MappingMap Euclid::Configuration::PhotometricBandMappingConfig::m_mapping_map {}
private

Definition at line 134 of file PhotometricBandMappingConfig.h.

Referenced by getPhotometricBandMapping(), and initialize().

◆ m_threshold_map

UpperLimitThresholdMap Euclid::Configuration::PhotometricBandMappingConfig::m_threshold_map {}
private

Definition at line 135 of file PhotometricBandMappingConfig.h.

Referenced by getUpperLimitThresholdMapping(), and initialize().


The documentation for this class was generated from the following files: