Commit 4e47b21b0a09aeff94e1035a72979fadef537f92
1 parent
d4811766
Change parameter access methods.
Filenames are now always accessed using the filename() method so that environment variables get correctly expanded. The prefix is now accessed using the string() method instead of the generic value() method, so that string checkings can be performed.
Showing
5 changed files
with
17 additions
and
17 deletions
src/ctbin/ctbin.cpp
| @@ -441,8 +441,8 @@ void ctbin::get_parameters(void) | @@ -441,8 +441,8 @@ void ctbin::get_parameters(void) | ||
| 441 | // Optionally read ahead parameters so that they get correctly | 441 | // Optionally read ahead parameters so that they get correctly |
| 442 | // dumped into the log file | 442 | // dumped into the log file |
| 443 | if (m_read_ahead) { | 443 | if (m_read_ahead) { |
| 444 | - m_outfile = (*this)["outfile"].value(); | ||
| 445 | - m_prefix = (*this)["prefix"].value(); | 444 | + m_outfile = (*this)["outfile"].filename(); |
| 445 | + m_prefix = (*this)["prefix"].string(); | ||
| 446 | } | 446 | } |
| 447 | 447 | ||
| 448 | // Return | 448 | // Return |
| @@ -710,7 +710,7 @@ std::string ctbin::set_outfile_name(const std::string& filename) const | @@ -710,7 +710,7 @@ std::string ctbin::set_outfile_name(const std::string& filename) const | ||
| 710 | void ctbin::save_fits(void) | 710 | void ctbin::save_fits(void) |
| 711 | { | 711 | { |
| 712 | // Get output filename | 712 | // Get output filename |
| 713 | - m_outfile = (*this)["outfile"].value(); | 713 | + m_outfile = (*this)["outfile"].filename(); |
| 714 | 714 | ||
| 715 | // Get CTA observation from observation container | 715 | // Get CTA observation from observation container |
| 716 | GCTAObservation* obs = dynamic_cast<GCTAObservation*>(&m_obs[0]); | 716 | GCTAObservation* obs = dynamic_cast<GCTAObservation*>(&m_obs[0]); |
| @@ -737,8 +737,8 @@ void ctbin::save_fits(void) | @@ -737,8 +737,8 @@ void ctbin::save_fits(void) | ||
| 737 | void ctbin::save_xml(void) | 737 | void ctbin::save_xml(void) |
| 738 | { | 738 | { |
| 739 | // Get output filename and prefix | 739 | // Get output filename and prefix |
| 740 | - m_outfile = (*this)["outfile"].value(); | ||
| 741 | - m_prefix = (*this)["prefix"].value(); | 740 | + m_outfile = (*this)["outfile"].filename(); |
| 741 | + m_prefix = (*this)["prefix"].string(); | ||
| 742 | 742 | ||
| 743 | // Loop over all observation in the container | 743 | // Loop over all observation in the container |
| 744 | for (int i = 0; i < m_obs.size(); ++i) { | 744 | for (int i = 0; i < m_obs.size(); ++i) { |
src/ctbin/ctbin.hpp
| @@ -33,7 +33,7 @@ | @@ -33,7 +33,7 @@ | ||
| 33 | 33 | ||
| 34 | /* __Definitions _________________________________________________________ */ | 34 | /* __Definitions _________________________________________________________ */ |
| 35 | #define CTBIN_NAME "ctbin" | 35 | #define CTBIN_NAME "ctbin" |
| 36 | -#define CTBIN_VERSION "00-03-00" | 36 | +#define CTBIN_VERSION "00-03-01" |
| 37 | 37 | ||
| 38 | 38 | ||
| 39 | /***********************************************************************//** | 39 | /***********************************************************************//** |
src/ctobssim/ctobssim.cpp
| @@ -414,8 +414,8 @@ void ctobssim::get_parameters(void) | @@ -414,8 +414,8 @@ void ctobssim::get_parameters(void) | ||
| 414 | // Optionally read ahead parameters so that they get correctly | 414 | // Optionally read ahead parameters so that they get correctly |
| 415 | // dumped into the log file | 415 | // dumped into the log file |
| 416 | if (m_read_ahead) { | 416 | if (m_read_ahead) { |
| 417 | - m_outfile = (*this)["outfile"].value(); | ||
| 418 | - m_prefix = (*this)["prefix"].value(); | 417 | + m_outfile = (*this)["outfile"].filename(); |
| 418 | + m_prefix = (*this)["prefix"].string(); | ||
| 419 | } | 419 | } |
| 420 | 420 | ||
| 421 | // Initialise random number generator | 421 | // Initialise random number generator |
| @@ -909,7 +909,7 @@ void ctobssim::free_members(void) | @@ -909,7 +909,7 @@ void ctobssim::free_members(void) | ||
| 909 | void ctobssim::save_fits(void) | 909 | void ctobssim::save_fits(void) |
| 910 | { | 910 | { |
| 911 | // Get output filename | 911 | // Get output filename |
| 912 | - m_outfile = (*this)["outfile"].value(); | 912 | + m_outfile = (*this)["outfile"].filename(); |
| 913 | 913 | ||
| 914 | // Get CTA observation from observation container | 914 | // Get CTA observation from observation container |
| 915 | GCTAObservation* obs = dynamic_cast<GCTAObservation*>(&m_obs[0]); | 915 | GCTAObservation* obs = dynamic_cast<GCTAObservation*>(&m_obs[0]); |
| @@ -935,8 +935,8 @@ void ctobssim::save_fits(void) | @@ -935,8 +935,8 @@ void ctobssim::save_fits(void) | ||
| 935 | void ctobssim::save_xml(void) | 935 | void ctobssim::save_xml(void) |
| 936 | { | 936 | { |
| 937 | // Get output filename and prefix | 937 | // Get output filename and prefix |
| 938 | - m_outfile = (*this)["outfile"].value(); | ||
| 939 | - m_prefix = (*this)["prefix"].value(); | 938 | + m_outfile = (*this)["outfile"].filename(); |
| 939 | + m_prefix = (*this)["prefix"].string(); | ||
| 940 | 940 | ||
| 941 | // Initialise file number | 941 | // Initialise file number |
| 942 | int file_num = 0; | 942 | int file_num = 0; |
src/ctselect/ctselect.cpp
| @@ -439,8 +439,8 @@ void ctselect::get_parameters(void) | @@ -439,8 +439,8 @@ void ctselect::get_parameters(void) | ||
| 439 | // Optionally read ahead parameters so that they get correctly | 439 | // Optionally read ahead parameters so that they get correctly |
| 440 | // dumped into the log file | 440 | // dumped into the log file |
| 441 | if (m_read_ahead) { | 441 | if (m_read_ahead) { |
| 442 | - m_outfile = (*this)["outfile"].value(); | ||
| 443 | - m_prefix = (*this)["prefix"].value(); | 442 | + m_outfile = (*this)["outfile"].filename(); |
| 443 | + m_prefix = (*this)["prefix"].string(); | ||
| 444 | } | 444 | } |
| 445 | 445 | ||
| 446 | // Derive time interval | 446 | // Derive time interval |
| @@ -835,7 +835,7 @@ std::string ctselect::set_outfile_name(const std::string& filename) const | @@ -835,7 +835,7 @@ std::string ctselect::set_outfile_name(const std::string& filename) const | ||
| 835 | void ctselect::save_fits(void) | 835 | void ctselect::save_fits(void) |
| 836 | { | 836 | { |
| 837 | // Get output filename | 837 | // Get output filename |
| 838 | - m_outfile = (*this)["outfile"].value(); | 838 | + m_outfile = (*this)["outfile"].filename(); |
| 839 | 839 | ||
| 840 | // Get CTA observation from observation container | 840 | // Get CTA observation from observation container |
| 841 | GCTAObservation* obs = dynamic_cast<GCTAObservation*>(&m_obs[0]); | 841 | GCTAObservation* obs = dynamic_cast<GCTAObservation*>(&m_obs[0]); |
| @@ -861,8 +861,8 @@ void ctselect::save_fits(void) | @@ -861,8 +861,8 @@ void ctselect::save_fits(void) | ||
| 861 | void ctselect::save_xml(void) | 861 | void ctselect::save_xml(void) |
| 862 | { | 862 | { |
| 863 | // Get output filename and prefix | 863 | // Get output filename and prefix |
| 864 | - m_outfile = (*this)["outfile"].value(); | ||
| 865 | - m_prefix = (*this)["prefix"].value(); | 864 | + m_outfile = (*this)["outfile"].filename(); |
| 865 | + m_prefix = (*this)["prefix"].string(); | ||
| 866 | 866 | ||
| 867 | // Loop over all observation in the container | 867 | // Loop over all observation in the container |
| 868 | for (int i = 0; i < m_obs.size(); ++i) { | 868 | for (int i = 0; i < m_obs.size(); ++i) { |
src/ctselect/ctselect.hpp
| @@ -35,7 +35,7 @@ | @@ -35,7 +35,7 @@ | ||
| 35 | 35 | ||
| 36 | /* __Definitions _________________________________________________________ */ | 36 | /* __Definitions _________________________________________________________ */ |
| 37 | #define CTSELECT_NAME "ctselect" | 37 | #define CTSELECT_NAME "ctselect" |
| 38 | -#define CTSELECT_VERSION "00-03-00" | 38 | +#define CTSELECT_VERSION "00-03-01" |
| 39 | 39 | ||
| 40 | 40 | ||
| 41 | /***********************************************************************//** | 41 | /***********************************************************************//** |