Alexandria 2.28.2
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
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:
Inheritance graph
[legend]
Collaboration diagram for Euclid::Configuration::PhotometricBandMappingConfig:
Collaboration graph
[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 > >
 
using ConvertFromMagMap = std::vector< std::pair< std::string, bool > >
 
- Public Types inherited from Euclid::Configuration::Configuration
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.
 
- Public Member Functions inherited from Euclid::Configuration::Configuration
 Configuration (long manager_id)
 Constructs a new Configuration instance.
 
virtual ~Configuration ()=default
 Destructor.
 
virtual std::map< std::string, OptionDescriptionList > getProgramOptions ()
 Returns the program options defined by a specific configuration.
 
virtual void preInitialize (const UserValues &args)
 Method which is called before the initialization phase.
 
virtual void initialize (const UserValues &args)
 Method which is called during 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

- Protected Member Functions inherited from Euclid::Configuration::Configuration
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
 

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

◆ ConvertFromMagMap

Definition at line 50 of file PhotometricBandMappingConfig.h.

◆ MappingMap

Definition at line 48 of file PhotometricBandMappingConfig.h.

◆ UpperLimitThresholdMap

Definition at line 49 of file PhotometricBandMappingConfig.h.

Constructor & Destructor Documentation

◆ PhotometricBandMappingConfig()

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

Constructs a new PhotometricBandMappingConfig object.

Definition at line 46 of file PhotometricBandMappingConfig.cpp.

◆ ~PhotometricBandMappingConfig()

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

Destructor.

Member Function Documentation

◆ getConvertFromMagMapping()

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.

Returns
The mapping of flag for MAG_AB conversion
Exceptions
Elements::ExceptionIf 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.

Here is the call graph for this function:

◆ getMappingFile()

const fs::path Euclid::Configuration::PhotometricBandMappingConfig::getMappingFile ( )

Returns the mapping file to be used by other configuration class.

Returns
The mapping file
Exceptions
Elements::ExceptionIf 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.

Here is the call graph for this function:

◆ 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 212 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 48 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 221 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 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().

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 205 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 154 of file PhotometricBandMappingConfig.h.

Referenced by initialize(), and setBaseDir().

◆ m_convert_from_mag_map

ConvertFromMagMap Euclid::Configuration::PhotometricBandMappingConfig::m_convert_from_mag_map
private

Definition at line 158 of file PhotometricBandMappingConfig.h.

Referenced by getConvertFromMagMapping(), and initialize().

◆ m_mapping_file

boost::filesystem::path Euclid::Configuration::PhotometricBandMappingConfig::m_mapping_file
private

Definition at line 155 of file PhotometricBandMappingConfig.h.

Referenced by getMappingFile(), and initialize().

◆ m_mapping_map

MappingMap Euclid::Configuration::PhotometricBandMappingConfig::m_mapping_map
private

Definition at line 156 of file PhotometricBandMappingConfig.h.

Referenced by getPhotometricBandMapping(), and initialize().

◆ m_threshold_map

UpperLimitThresholdMap Euclid::Configuration::PhotometricBandMappingConfig::m_threshold_map
private

Definition at line 157 of file PhotometricBandMappingConfig.h.

Referenced by getUpperLimitThresholdMapping(), and initialize().


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