From c81a8bdbffbafeb24345eb19c1b7746893a93736 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Sun, 22 Feb 2015 15:41:07 +0100 Subject: [PATCH] Use XML element to set the response function. This will then lead to writing of response information in the XML observation definition file (when needed). --- src/support/ctool.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/support/ctool.cpp b/src/support/ctool.cpp index f987989..b702e2c 100644 --- a/src/support/ctool.cpp +++ b/src/support/ctool.cpp @@ -762,9 +762,26 @@ void ctool::set_obs_response(GCTAObservation* obs) std::string database = (*this)["caldb"].string(); std::string irf = (*this)["irf"].string(); + // Create an XML element containing the database and IRF name. This + // kluge will make sure that the information is later written + // to the observation definition XML file, in case an observation + // definition XML file is written. + std::string parameter = "parameter name=\"Calibration\"" + " database=\""+database+"\"" + " response=\""+irf+"\""; + GXmlElement xml; + xml.append(parameter); + + // Create CTA response + GCTAResponseIrf response(xml); + + // Attach response to observation + obs->response(response); + // Set calibration database. If "database" is a valid directory then use // this as the pathname to the calibration database. Otherwise, interpret // "database" as the instrument name, the mission being "cta" + /* GCaldb caldb; if (gammalib::dir_exists(database)) { caldb.rootdir(database); @@ -772,9 +789,10 @@ void ctool::set_obs_response(GCTAObservation* obs) else { caldb.open("cta", database); } + */ // Set reponse - obs->response(irf, caldb); + //obs->response(irf, caldb); // Signal response availability has_response = true; -- libgit2 0.21.4