From 6265eb80c7457657e24d99525c834793bf4bc4e4 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Wed, 30 Aug 2017 10:36:42 +0200 Subject: [PATCH] Invert caldb and response name argument in COMPTEL classes. --- NEWS | 3 ++- inst/com/include/GCOMD1Response.hpp | 2 +- inst/com/include/GCOMD2Response.hpp | 2 +- inst/com/include/GCOMInstChars.hpp | 2 +- inst/com/include/GCOMObservation.hpp | 4 ++-- inst/com/include/GCOMResponse.hpp | 7 +++++-- inst/com/pyext/GCOMD1Response.i | 2 +- inst/com/pyext/GCOMD2Response.i | 2 +- inst/com/pyext/GCOMInstChar.i | 4 ++-- inst/com/pyext/GCOMObservation.i | 4 ++-- inst/com/pyext/GCOMResponse.i | 4 ++-- inst/com/src/GCOMD1Response.cpp | 4 ++-- inst/com/src/GCOMD2Response.cpp | 4 ++-- inst/com/src/GCOMInstChars.cpp | 4 ++-- inst/com/src/GCOMObservation.cpp | 8 ++++---- inst/com/src/GCOMResponse.cpp | 8 ++++---- inst/com/test/test_COM.cpp | 6 +++--- 17 files changed, 37 insertions(+), 33 deletions(-) diff --git a/NEWS b/NEWS index 776be55..b60da57 100644 --- a/NEWS +++ b/NEWS @@ -38,7 +38,8 @@ The following methods have been renamed: - n.a. The arguments for the following methods have been changed: -- n.a. +- GCOMResponse(GCaldb&, std::string&) +- GCOMObservation::response(GCaldb&, std::string&) The return value of the following methods has been changed: - n.a. diff --git a/inst/com/include/GCOMD1Response.hpp b/inst/com/include/GCOMD1Response.hpp index a5f97f9..e6f3ee4 100644 --- a/inst/com/include/GCOMD1Response.hpp +++ b/inst/com/include/GCOMD1Response.hpp @@ -51,7 +51,7 @@ public: // Constructors and destructors GCOMD1Response(void); GCOMD1Response(const GCOMD1Response& rsp); - GCOMD1Response(const std::string& sdaname, const GCaldb& caldb); + GCOMD1Response(const GCaldb& caldb, const std::string& sdaname); ~GCOMD1Response(void); // Operators diff --git a/inst/com/include/GCOMD2Response.hpp b/inst/com/include/GCOMD2Response.hpp index bc6e0ca..bc5a6b2 100644 --- a/inst/com/include/GCOMD2Response.hpp +++ b/inst/com/include/GCOMD2Response.hpp @@ -51,7 +51,7 @@ public: // Constructors and destructors GCOMD2Response(void); GCOMD2Response(const GCOMD2Response& rsp); - GCOMD2Response(const std::string& sdbname, const GCaldb& caldb); + GCOMD2Response(const GCaldb& caldb, const std::string& sdbname); ~GCOMD2Response(void); // Operators diff --git a/inst/com/include/GCOMInstChars.hpp b/inst/com/include/GCOMInstChars.hpp index 8e003fe..04f352b 100644 --- a/inst/com/include/GCOMInstChars.hpp +++ b/inst/com/include/GCOMInstChars.hpp @@ -51,7 +51,7 @@ public: // Constructors and destructors GCOMInstChars(void); GCOMInstChars(const GCOMInstChars& ict); - GCOMInstChars(const std::string& ictname, const GCaldb& caldb); + GCOMInstChars(const GCaldb& caldb, const std::string& ictname); ~GCOMInstChars(void); // Operators diff --git a/inst/com/include/GCOMObservation.hpp b/inst/com/include/GCOMObservation.hpp index edccd82..e3da713 100644 --- a/inst/com/include/GCOMObservation.hpp +++ b/inst/com/include/GCOMObservation.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GCOMObservation.hpp - COMPTEL observation class * * ----------------------------------------------------------------------- * - * copyright (C) 2012-2016 by Juergen Knoedlseder * + * copyright (C) 2012-2017 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -89,7 +89,7 @@ public: const GFilename& drbname, const GFilename& drgname, const GFilename& drxname); - void response(const std::string& rspname, const GCaldb& caldb); + void response(const GCaldb& caldb, const std::string& rspname); void obs_id(const double& id); void ontime(const double& ontime); void livetime(const double& livetime); diff --git a/inst/com/include/GCOMResponse.hpp b/inst/com/include/GCOMResponse.hpp index 221b480..34c3ce9 100644 --- a/inst/com/include/GCOMResponse.hpp +++ b/inst/com/include/GCOMResponse.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GCOMResponse.hpp - COMPTEL Response class * * ----------------------------------------------------------------------- * - * copyright (C) 2012-2015 by Juergen Knoedlseder * + * copyright (C) 2012-2017 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -55,7 +55,10 @@ public: // Constructors and destructors GCOMResponse(void); GCOMResponse(const GCOMResponse& rsp); - GCOMResponse(const std::string& rspname, const GCaldb& caldb); + GCOMResponse(const GCaldb& caldb, const std::string& rspname); + //GCOMResponse(const int& phigeo_num, const int& phibar_num, + // const double& phigeo_max, const double& phibar_max, + // const double& phigeo_bin, const double& phibar_bin); virtual ~GCOMResponse(void); // Operators diff --git a/inst/com/pyext/GCOMD1Response.i b/inst/com/pyext/GCOMD1Response.i index f2b9e32..5f2da4e 100644 --- a/inst/com/pyext/GCOMD1Response.i +++ b/inst/com/pyext/GCOMD1Response.i @@ -40,7 +40,7 @@ public: // Constructors and destructors GCOMD1Response(void); GCOMD1Response(const GCOMD1Response& rsp); - GCOMD1Response(const std::string& sdaname, const GCaldb& caldb); + GCOMD1Response(const GCaldb& caldb, const std::string& sdaname); ~GCOMD1Response(void); // Operators diff --git a/inst/com/pyext/GCOMD2Response.i b/inst/com/pyext/GCOMD2Response.i index ce59049..9728b9a 100644 --- a/inst/com/pyext/GCOMD2Response.i +++ b/inst/com/pyext/GCOMD2Response.i @@ -40,7 +40,7 @@ public: // Constructors and destructors GCOMD2Response(void); GCOMD2Response(const GCOMD2Response& rsp); - GCOMD2Response(const std::string& sdaname, const GCaldb& caldb); + GCOMD2Response(const GCaldb& caldb, const std::string& sdbname); ~GCOMD2Response(void); // Operators diff --git a/inst/com/pyext/GCOMInstChar.i b/inst/com/pyext/GCOMInstChar.i index c4a5370..f88eaad 100644 --- a/inst/com/pyext/GCOMInstChar.i +++ b/inst/com/pyext/GCOMInstChar.i @@ -40,7 +40,7 @@ public: // Constructors and destructors GCOMInstChars(void); GCOMInstChars(const GCOMInstChars& ict); - GCOMInstChars(const std::string& ictname, const GCaldb& caldb); + GCOMInstChars(const GCaldb& caldb, const std::string& ictname); ~GCOMInstChars(void); // Methods @@ -50,7 +50,7 @@ public: void caldb(const GCaldb& caldb); const GCaldb& caldb(void) const; void load(const std::string& ictname); - double prob_D1inter(const GEnergy& energy, const double& zenith) const; + double prob_D1inter(const GEnergy& energy) const; double prob_D2inter(const GEnergy& energy, const double& phigeo) const; double prob_multihit(const GEnergy& energy) const; double atten_D1(const GEnergy& energy) const; diff --git a/inst/com/pyext/GCOMObservation.i b/inst/com/pyext/GCOMObservation.i index 0065bc7..21f2a69 100644 --- a/inst/com/pyext/GCOMObservation.i +++ b/inst/com/pyext/GCOMObservation.i @@ -1,7 +1,7 @@ /*************************************************************************** * GCOMObservation.i - COMPTEL observation class * * ----------------------------------------------------------------------- * - * copyright (C) 2012-2016 by Juergen Knoedlseder * + * copyright (C) 2012-2017 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -63,7 +63,7 @@ public: const GFilename& drbname, const GFilename& drgname, const GFilename& drxname); - void response(const std::string& rspname, const GCaldb& caldb); + void response(const GCaldb& caldb, const std::string& rspname); void obs_id(const double& id); void ontime(const double& ontime); void livetime(const double& livetime); diff --git a/inst/com/pyext/GCOMResponse.i b/inst/com/pyext/GCOMResponse.i index 7d249d0..2dafc9c 100644 --- a/inst/com/pyext/GCOMResponse.i +++ b/inst/com/pyext/GCOMResponse.i @@ -1,7 +1,7 @@ /*************************************************************************** * GCOMResponse.i - COMPTEL Response class * * ----------------------------------------------------------------------- * - * copyright (C) 2012-2015 by Juergen Knoedlseder * + * copyright (C) 2012-2017 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -39,7 +39,7 @@ public: // Constructors and destructors GCOMResponse(void); GCOMResponse(const GCOMResponse& rsp); - GCOMResponse(const std::string& rspname, const GCaldb& caldb); + GCOMResponse(const GCaldb& caldb, const std::string& rspname); virtual ~GCOMResponse(void); // Implement pure virtual base class methods diff --git a/inst/com/src/GCOMD1Response.cpp b/inst/com/src/GCOMD1Response.cpp index a98610b..15c5715 100644 --- a/inst/com/src/GCOMD1Response.cpp +++ b/inst/com/src/GCOMD1Response.cpp @@ -84,13 +84,13 @@ GCOMD1Response::GCOMD1Response(const GCOMD1Response& rsp) /***********************************************************************//** * @brief Response constructor * - * @param[in] sdaname SDA response name. * @param[in] caldb Calibration database. + * @param[in] sdaname SDA response name. * * Create COMPTEL D1 module response by loading an SDA file from a * calibration database. ***************************************************************************/ -GCOMD1Response::GCOMD1Response(const std::string& sdaname, const GCaldb& caldb) +GCOMD1Response::GCOMD1Response(const GCaldb& caldb, const std::string& sdaname) { // Initialise members init_members(); diff --git a/inst/com/src/GCOMD2Response.cpp b/inst/com/src/GCOMD2Response.cpp index ab66239..2685086 100644 --- a/inst/com/src/GCOMD2Response.cpp +++ b/inst/com/src/GCOMD2Response.cpp @@ -84,13 +84,13 @@ GCOMD2Response::GCOMD2Response(const GCOMD2Response& rsp) /***********************************************************************//** * @brief Response constructor * - * @param[in] sdbname SDA response name. * @param[in] caldb Calibration database. + * @param[in] sdbname SDA response name. * * Create COMPTEL D2 module response by loading an SDB file from a * calibration database. ***************************************************************************/ -GCOMD2Response::GCOMD2Response(const std::string& sdbname, const GCaldb& caldb) +GCOMD2Response::GCOMD2Response(const GCaldb& caldb, const std::string& sdbname) { // Initialise members init_members(); diff --git a/inst/com/src/GCOMInstChars.cpp b/inst/com/src/GCOMInstChars.cpp index 451cb58..d55f24e 100644 --- a/inst/com/src/GCOMInstChars.cpp +++ b/inst/com/src/GCOMInstChars.cpp @@ -88,13 +88,13 @@ GCOMInstChars::GCOMInstChars(const GCOMInstChars& ict) /***********************************************************************//** * @brief Response constructor * - * @param[in] ictname ICT response name. * @param[in] caldb Calibration database. + * @param[in] ictname ICT response name. * * Create COMPTEL instrument characteristics by loading an SDA file from a * calibration database. ***************************************************************************/ -GCOMInstChars::GCOMInstChars(const std::string& ictname, const GCaldb& caldb) +GCOMInstChars::GCOMInstChars(const GCaldb& caldb, const std::string& ictname) { // Initialise members init_members(); diff --git a/inst/com/src/GCOMObservation.cpp b/inst/com/src/GCOMObservation.cpp index f7bf12e..293b46a 100644 --- a/inst/com/src/GCOMObservation.cpp +++ b/inst/com/src/GCOMObservation.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GCOMObservation.cpp - COMPTEL Observation class * * ----------------------------------------------------------------------- * - * copyright (C) 2012-2016 by Juergen Knoedlseder * + * copyright (C) 2012-2017 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -249,13 +249,13 @@ void GCOMObservation::response(const GResponse& rsp) /***********************************************************************//** * @brief Set response function * - * @param[in] rspname Name of COMPTEL response. * @param[in] caldb Calibration database. + * @param[in] rspname Name of COMPTEL response. * * Sets the response function by loading the response information from the * calibration database. ***************************************************************************/ -void GCOMObservation::response(const std::string& rspname, const GCaldb& caldb) +void GCOMObservation::response(const GCaldb& caldb, const std::string& rspname) { // Clear COM response function m_response.clear(); @@ -323,7 +323,7 @@ void GCOMObservation::read(const GXmlElement& xml) load(drename, drbname, drgname, drxname); // Load IAQ - response(iaqname, GCaldb("cgro", "comptel")); + response(GCaldb("cgro", "comptel"), iaqname); // Return return; diff --git a/inst/com/src/GCOMResponse.cpp b/inst/com/src/GCOMResponse.cpp index 2d96ee3..e60c7a3 100644 --- a/inst/com/src/GCOMResponse.cpp +++ b/inst/com/src/GCOMResponse.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GCOMResponse.cpp - COMPTEL Response class * * ----------------------------------------------------------------------- * - * copyright (C) 2012-2016 by Juergen Knoedlseder * + * copyright (C) 2012-2017 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -105,14 +105,14 @@ GCOMResponse::GCOMResponse(const GCOMResponse& rsp) : GResponse(rsp) /***********************************************************************//** * @brief Response constructor * - * @param[in] iaqname IAQ file name. * @param[in] caldb Calibration database. + * @param[in] iaqname IAQ file name. * * Create COMPTEL response by loading an IAQ file from a calibration * database. ***************************************************************************/ -GCOMResponse::GCOMResponse(const std::string& iaqname, - const GCaldb& caldb) : GResponse() +GCOMResponse::GCOMResponse(const GCaldb& caldb, + const std::string& iaqname) : GResponse() { // Initialise members init_members(); diff --git a/inst/com/test/test_COM.cpp b/inst/com/test/test_COM.cpp index 4343988..fbe5074 100644 --- a/inst/com/test/test_COM.cpp +++ b/inst/com/test/test_COM.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * test_COM.cpp - test COM classes * * ----------------------------------------------------------------------- * - * copyright (C) 2012-2016 by Juergen Knoedlseder * + * copyright (C) 2012-2017 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -238,7 +238,7 @@ void TestGCOMResponse::test_response(void) test_try("Test response loading"); try { // Construct response from datasets - GCOMResponse rsp(com_iaq, GCaldb("cgro", "comptel")); + GCOMResponse rsp(GCaldb("cgro", "comptel"), com_iaq); // If we arrived here, signal success test_try_success(); @@ -585,7 +585,7 @@ void TestGCOMOptimize::test_binned_optimizer(void) test_try("Load binned COMPTEL observation"); try { run.load(com_dre, com_drb, com_drg, com_drx); - run.response(com_iaq, GCaldb("cgro", "comptel")); + run.response(GCaldb("cgro", "comptel"), com_iaq); obs.append(run); test_try_success(); } -- libgit2 0.21.4