diff --git a/doc/source/reference_manual/ctulimit.rst b/doc/source/reference_manual/ctulimit.rst index 170dc03..55d0d62 100644 --- a/doc/source/reference_manual/ctulimit.rst +++ b/doc/source/reference_manual/ctulimit.rst @@ -9,8 +9,7 @@ Computes upper limit for a specific sky model component. Synopsis -------- -Computes the upper limit flux of a given source and stores the value -in an ASCII file. +Computes the upper limit flux of a given source. General parameters @@ -37,9 +36,6 @@ General parameters ``irf [string]`` Instrumental response function. -``outfile [file]`` - Output ASCII file name. - ``(confidence = 0.95) [real]`` Confidence Level of upper limit. diff --git a/src/ctulimit/ctulimit.cpp b/src/ctulimit/ctulimit.cpp index 44e3d50..30abc35 100644 --- a/src/ctulimit/ctulimit.cpp +++ b/src/ctulimit/ctulimit.cpp @@ -337,7 +337,10 @@ void ctulimit::run(void) /***********************************************************************//** * @brief Save maps * - * This method saves the upper limit to an ascii file + * This method saves the upper limit to an ascii file. + * + * @todo No yet implemented as we have no clear use case yet for saving + * the result. ***************************************************************************/ void ctulimit::save(void) { @@ -347,6 +350,7 @@ void ctulimit::save(void) log.header1("Save upper limit"); } + /* // Get output filename m_outfile = (*this)["outfile"].filename(); @@ -359,7 +363,8 @@ void ctulimit::save(void) // Save CSV table table.save(m_outfile, " ", clobber()); - + */ + // Return return; } @@ -377,7 +382,6 @@ void ctulimit::save(void) void ctulimit::init_members(void) { // Initialise user parameters - m_outfile.clear(); m_srcname.clear(); m_confidence = 0.95; m_sigma_min = 0.0; @@ -411,7 +415,6 @@ void ctulimit::init_members(void) void ctulimit::copy_members(const ctulimit& app) { // Copy user parameters - m_outfile = app.m_outfile; m_srcname = app.m_srcname; m_confidence = app.m_confidence; m_sigma_min = app.m_sigma_min; @@ -515,12 +518,6 @@ void ctulimit::get_parameters(void) m_tol = (*this)["tol"].real(); m_max_iter = (*this)["max_iter"].integer(); - // Optionally read ahead parameters so that they get correctly - // dumped into the log file - if (read_ahead()) { - m_outfile = (*this)["outfile"].filename(); - } - // Return return; } @@ -558,11 +555,14 @@ void ctulimit::get_model_parameter(void) else if (m_skymodel->spectral()->has_par("Integral")) { m_model_par = &(m_skymodel->spectral()->operator[]("Integral")); } + else if (m_skymodel->spectral()->has_par("Value")) { + m_model_par = &(m_skymodel->spectral()->operator[]("Value")); + } else { std::string msg = "Require spectral parameter \"Normalization\", " - "\"Prefactor\" or \"Integral\" for upper limit " - "computation. The specified source \""+m_srcname+ - "\" does not have such a parameter."; + "\"Prefactor\", \"Integral\" or \"Value\" for " + "upper limit computation. The specified source " + "\""+m_srcname+"\" does not have such a parameter."; throw GException::invalid_value(G_GET_MODEL_PARAMETER, msg); } diff --git a/src/ctulimit/ctulimit.hpp b/src/ctulimit/ctulimit.hpp index 9de3b30..8eb6727 100644 --- a/src/ctulimit/ctulimit.hpp +++ b/src/ctulimit/ctulimit.hpp @@ -84,7 +84,6 @@ protected: // User parameters std::string m_srcname; //!< Name of source which is moved around - std::string m_outfile; //!< Output ascii file double m_confidence; //!< Confidence level double m_sigma_min; //!< Starting value minimum (multiple fit errors above fit values) double m_sigma_max; //!< Starting value maximum (multiple fit errors above fit values) diff --git a/src/ctulimit/ctulimit.par b/src/ctulimit/ctulimit.par index 0489eeb..d3cf453 100644 --- a/src/ctulimit/ctulimit.par +++ b/src/ctulimit/ctulimit.par @@ -24,7 +24,6 @@ expcube, f, a, "NONE",,, "Exposure cube file (only needed for stacked analysis) psfcube, f, a, "NONE",,, "PSF cube file (only needed for stacked analysis)" caldb, s, a, "dummy",,, "Calibration database" irf, s, a, "cta_dummy_irf",,, "Instrument response function" -outfile, f, a, "upperlimit.txt",,, "Output ASCII file" # # Upper limit calculation parameters diff --git a/test/test_ctools.sh b/test/test_ctools.sh index 0984d7c..aa51ca1 100755 --- a/test/test_ctools.sh +++ b/test/test_ctools.sh @@ -608,15 +608,14 @@ $ECHO -n "Test ctulimit: " $ctulimit inobs="data/crab_events.fits.gz" \ inmodel="data/crab.xml" \ srcname="Crab" \ - outfile="ulimit.dat" \ caldb="irf" \ irf="cta_dummy_irf" $ECHO -n "." -if [ -s "ulimit.dat" ] +if [ -s "ctulimit.log" ] then $ECHO -n "." else - $ECHO " ulimit.dat file is not found" + $ECHO " ctulimit.log file is not found" exit 1 fi $ECHO " ok" diff --git a/test/test_ctulimit.py b/test/test_ctulimit.py index 49685f0..4e0a36d 100755 --- a/test/test_ctulimit.py +++ b/test/test_ctulimit.py @@ -72,7 +72,6 @@ class Test(gammalib.GPythonTestSuite): ulimit["srcname"].string("Crab") ulimit["caldb"].string(self.caldb) ulimit["irf"].string(self.irf) - ulimit["outfile"].filename("ulimit.dat") # Run tool self.test_try("Run ctulimit")