Commit 4e47b21b0a09aeff94e1035a72979fadef537f92

Authored by Jürgen Knödlseder
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.
src/ctbin/ctbin.cpp
... ... @@ -441,8 +441,8 @@ void ctbin::get_parameters(void)
441 441 // Optionally read ahead parameters so that they get correctly
442 442 // dumped into the log file
443 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 448 // Return
... ... @@ -710,7 +710,7 @@ std::string ctbin::set_outfile_name(const std::string& filename) const
710 710 void ctbin::save_fits(void)
711 711 {
712 712 // Get output filename
713   - m_outfile = (*this)["outfile"].value();
  713 + m_outfile = (*this)["outfile"].filename();
714 714  
715 715 // Get CTA observation from observation container
716 716 GCTAObservation* obs = dynamic_cast<GCTAObservation*>(&m_obs[0]);
... ... @@ -737,8 +737,8 @@ void ctbin::save_fits(void)
737 737 void ctbin::save_xml(void)
738 738 {
739 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 743 // Loop over all observation in the container
744 744 for (int i = 0; i < m_obs.size(); ++i) {
... ...
src/ctbin/ctbin.hpp
... ... @@ -33,7 +33,7 @@
33 33  
34 34 /* __Definitions _________________________________________________________ */
35 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 414 // Optionally read ahead parameters so that they get correctly
415 415 // dumped into the log file
416 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 421 // Initialise random number generator
... ... @@ -909,7 +909,7 @@ void ctobssim::free_members(void)
909 909 void ctobssim::save_fits(void)
910 910 {
911 911 // Get output filename
912   - m_outfile = (*this)["outfile"].value();
  912 + m_outfile = (*this)["outfile"].filename();
913 913  
914 914 // Get CTA observation from observation container
915 915 GCTAObservation* obs = dynamic_cast<GCTAObservation*>(&m_obs[0]);
... ... @@ -935,8 +935,8 @@ void ctobssim::save_fits(void)
935 935 void ctobssim::save_xml(void)
936 936 {
937 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 941 // Initialise file number
942 942 int file_num = 0;
... ...
src/ctselect/ctselect.cpp
... ... @@ -439,8 +439,8 @@ void ctselect::get_parameters(void)
439 439 // Optionally read ahead parameters so that they get correctly
440 440 // dumped into the log file
441 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 446 // Derive time interval
... ... @@ -835,7 +835,7 @@ std::string ctselect::set_outfile_name(const std::string&amp; filename) const
835 835 void ctselect::save_fits(void)
836 836 {
837 837 // Get output filename
838   - m_outfile = (*this)["outfile"].value();
  838 + m_outfile = (*this)["outfile"].filename();
839 839  
840 840 // Get CTA observation from observation container
841 841 GCTAObservation* obs = dynamic_cast<GCTAObservation*>(&m_obs[0]);
... ... @@ -861,8 +861,8 @@ void ctselect::save_fits(void)
861 861 void ctselect::save_xml(void)
862 862 {
863 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 867 // Loop over all observation in the container
868 868 for (int i = 0; i < m_obs.size(); ++i) {
... ...
src/ctselect/ctselect.hpp
... ... @@ -35,7 +35,7 @@
35 35  
36 36 /* __Definitions _________________________________________________________ */
37 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 /***********************************************************************//**
... ...