From f5eb08386872b2ae16002efdd680c7c99ce598d8 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Sun, 20 Jul 2014 21:16:16 +0200 Subject: [PATCH] Observation container constructor now always takes a const reference as argument. --- pyext/ctbin.i | 2 +- pyext/ctexpcube.i | 2 +- pyext/ctlike.i | 4 ++-- pyext/ctmodel.i | 4 ++-- pyext/ctobssim.i | 4 ++-- pyext/ctselect.i | 4 ++-- pyext/ctskymap.i | 4 ++-- src/ctbin/ctbin.cpp | 5 ++++- src/ctbin/ctbin.hpp | 2 +- src/ctcubemask/ctcubemask.cpp | 2 ++ src/ctexpcube/ctexpcube.cpp | 5 ++++- src/ctexpcube/ctexpcube.hpp | 2 +- src/ctlike/ctlike.cpp | 5 ++++- src/ctlike/ctlike.hpp | 2 +- src/ctmodel/ctmodel.cpp | 5 ++++- src/ctmodel/ctmodel.hpp | 2 +- src/ctobssim/ctobssim.cpp | 2 +- src/ctobssim/ctobssim.hpp | 2 +- src/ctselect/ctselect.cpp | 5 ++++- src/ctselect/ctselect.hpp | 2 +- src/ctskymap/ctskymap.cpp | 5 ++++- src/ctskymap/ctskymap.hpp | 2 +- test/test_ctools.sh | 14 +++++++++----- 23 files changed, 55 insertions(+), 31 deletions(-) diff --git a/pyext/ctbin.i b/pyext/ctbin.i index e215496..8b7291a 100644 --- a/pyext/ctbin.i +++ b/pyext/ctbin.i @@ -39,7 +39,7 @@ class ctbin : public GApplication { public: // Constructors and destructors ctbin(void); - explicit ctbin(GObservations obs); + explicit ctbin(const GObservations& obs); ctbin(int argc, char *argv[]); ctbin(const ctbin& app); virtual ~ctbin(void); diff --git a/pyext/ctexpcube.i b/pyext/ctexpcube.i index 446ec5e..f378e8c 100644 --- a/pyext/ctexpcube.i +++ b/pyext/ctexpcube.i @@ -40,7 +40,7 @@ class ctexpcube : public GApplication { public: // Constructors and destructors ctexpcube(void); - explicit ctexpcube(GObservations obs); + explicit ctexpcube(const GObservations& obs); ctexpcube(int argc, char *argv[]); ctexpcube(const ctexpcube& app); virtual ~ctexpcube(void); diff --git a/pyext/ctlike.i b/pyext/ctlike.i index d2d19cb..791439b 100644 --- a/pyext/ctlike.i +++ b/pyext/ctlike.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctlike - CTA maximum likelihood tool * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Jurgen Knodlseder * + * copyright (C) 2010-2014 by Jurgen Knodlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -40,7 +40,7 @@ class ctlike : public GApplication { public: // Constructors and destructors ctlike(void); - explicit ctlike(GObservations obs); + explicit ctlike(const GObservations& obs); ctlike(int argc, char *argv[]); ctlike(const ctlike& app); virtual ~ctlike(void); diff --git a/pyext/ctmodel.i b/pyext/ctmodel.i index c530c29..3c41ccc 100644 --- a/pyext/ctmodel.i +++ b/pyext/ctmodel.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctmodel - CTA counts model tool * * ----------------------------------------------------------------------- * - * copyright (C) 2012 by Juergen Knoedlseder * + * copyright (C) 2012-2014 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -40,7 +40,7 @@ class ctmodel : public GApplication { public: // Constructors and destructors ctmodel(void); - explicit ctmodel(GObservations obs); + explicit ctmodel(const GObservations& obs); ctmodel(int argc, char *argv[]); ctmodel(const ctmodel& app); virtual ~ctmodel(void); diff --git a/pyext/ctobssim.i b/pyext/ctobssim.i index ab2ca83..25f0843 100644 --- a/pyext/ctobssim.i +++ b/pyext/ctobssim.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctobssim - CTA observation simulation tool * * ----------------------------------------------------------------------- * - * copyright (C) 2011 by Jurgen Knodlseder * + * copyright (C) 2011-2014 by Jurgen Knodlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -39,7 +39,7 @@ class ctobssim : public GApplication { public: // Constructors and destructors ctobssim(void); - explicit ctobssim(GObservations obs); + explicit ctobssim(const GObservations& obs); ctobssim(int argc, char *argv[]); ctobssim(const ctobssim& app); virtual ~ctobssim(void); diff --git a/pyext/ctselect.i b/pyext/ctselect.i index 61b8d06..0024bdf 100644 --- a/pyext/ctselect.i +++ b/pyext/ctselect.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctselect - CTA data selection tool * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2011 by Jurgen Knodlseder * + * copyright (C) 2010-2014 by Jurgen Knodlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -39,7 +39,7 @@ class ctselect : public GApplication { public: // Constructors and destructors ctselect(void); - explicit ctselect(GObservations obs); + explicit ctselect(const GObservations& obs); ctselect(int argc, char *argv[]); ctselect(const ctselect& app); virtual ~ctselect(void); diff --git a/pyext/ctskymap.i b/pyext/ctskymap.i index 1b7a77d..fd27f2b 100644 --- a/pyext/ctskymap.i +++ b/pyext/ctskymap.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctskymap - CTA sky mapping tool * * ----------------------------------------------------------------------- * - * copyright (C) 2012 by Juergen Knoedlseder * + * copyright (C) 2012-2014 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -39,7 +39,7 @@ class ctskymap : public GApplication { public: // Constructors and destructors ctskymap(void); - explicit ctskymap(GObservations obs); + explicit ctskymap(const GObservations& obs); ctskymap(int argc, char *argv[]); ctskymap(const ctskymap& app); virtual ~ctskymap(void); diff --git a/src/ctbin/ctbin.cpp b/src/ctbin/ctbin.cpp index e7eeeda..6b400e6 100644 --- a/src/ctbin/ctbin.cpp +++ b/src/ctbin/ctbin.cpp @@ -69,10 +69,13 @@ ctbin::ctbin(void) : GApplication(CTBIN_NAME, CTBIN_VERSION) /***********************************************************************//** * @brief Observations constructor * + * param[in] obs Observation container. + * * This method creates an instance of the class by copying an existing * observations container. ***************************************************************************/ -ctbin::ctbin(GObservations obs) : GApplication(CTBIN_NAME, CTBIN_VERSION) +ctbin::ctbin(const GObservations& obs) : + GApplication(CTBIN_NAME, CTBIN_VERSION) { // Initialise members init_members(); diff --git a/src/ctbin/ctbin.hpp b/src/ctbin/ctbin.hpp index 9e2729f..89bfbf4 100644 --- a/src/ctbin/ctbin.hpp +++ b/src/ctbin/ctbin.hpp @@ -64,7 +64,7 @@ class ctbin : public GApplication { public: // Constructors and destructors ctbin(void); - explicit ctbin(GObservations obs); + explicit ctbin(const GObservations& obs); ctbin(int argc, char *argv[]); ctbin(const ctbin& app); virtual ~ctbin(void); diff --git a/src/ctcubemask/ctcubemask.cpp b/src/ctcubemask/ctcubemask.cpp index 400cdb5..3638f57 100644 --- a/src/ctcubemask/ctcubemask.cpp +++ b/src/ctcubemask/ctcubemask.cpp @@ -67,6 +67,8 @@ ctcubemask::ctcubemask(void) : GApplication(CTCUBEMASK_NAME, CTCUBEMASK_VERSION) /***********************************************************************//** * @brief Observations constructor * + * param[in] obs Observation container. + * * This constructor creates an instance of the class that is initialised from * an observation container. ***************************************************************************/ diff --git a/src/ctexpcube/ctexpcube.cpp b/src/ctexpcube/ctexpcube.cpp index 89fd687..74c0948 100644 --- a/src/ctexpcube/ctexpcube.cpp +++ b/src/ctexpcube/ctexpcube.cpp @@ -68,10 +68,13 @@ ctexpcube::ctexpcube(void) : GApplication(CTEXPCUBE_NAME, CTEXPCUBE_VERSION) /***********************************************************************//** * @brief Observations constructor * + * param[in] obs Observation container. + * * This method creates an instance of the class by copying an existing * observations container. ***************************************************************************/ -ctexpcube::ctexpcube(GObservations obs) : GApplication(CTEXPCUBE_NAME, CTEXPCUBE_VERSION) +ctexpcube::ctexpcube(const GObservations& obs) : + GApplication(CTEXPCUBE_NAME, CTEXPCUBE_VERSION) { // Initialise members init_members(); diff --git a/src/ctexpcube/ctexpcube.hpp b/src/ctexpcube/ctexpcube.hpp index fcd270f..e2bfb5c 100644 --- a/src/ctexpcube/ctexpcube.hpp +++ b/src/ctexpcube/ctexpcube.hpp @@ -46,7 +46,7 @@ class ctexpcube : public GApplication { public: // Constructors and destructors ctexpcube(void); - explicit ctexpcube(GObservations obs); + explicit ctexpcube(const GObservations& obs); ctexpcube(int argc, char *argv[]); ctexpcube(const ctexpcube& app); virtual ~ctexpcube(void); diff --git a/src/ctlike/ctlike.cpp b/src/ctlike/ctlike.cpp index a302e06..400dcfd 100644 --- a/src/ctlike/ctlike.cpp +++ b/src/ctlike/ctlike.cpp @@ -65,10 +65,13 @@ ctlike::ctlike(void) : GApplication(CTLIKE_NAME, CTLIKE_VERSION) /***********************************************************************//** * @brief Observations constructor * + * param[in] obs Observation container. + * * This method creates an instance of the class by copying an existing * observations container. ***************************************************************************/ -ctlike::ctlike(GObservations obs) : GApplication(CTLIKE_NAME, CTLIKE_VERSION) +ctlike::ctlike(const GObservations& obs) : + GApplication(CTLIKE_NAME, CTLIKE_VERSION) { // Initialise members init_members(); diff --git a/src/ctlike/ctlike.hpp b/src/ctlike/ctlike.hpp index 4467bd0..77ab6a1 100644 --- a/src/ctlike/ctlike.hpp +++ b/src/ctlike/ctlike.hpp @@ -46,7 +46,7 @@ class ctlike : public GApplication { public: // Constructors and destructors ctlike(void); - explicit ctlike(GObservations obs); + explicit ctlike(const GObservations& obs); ctlike(int argc, char *argv[]); ctlike(const ctlike& app); virtual ~ctlike(void); diff --git a/src/ctmodel/ctmodel.cpp b/src/ctmodel/ctmodel.cpp index aa5e31d..2ae5d2b 100644 --- a/src/ctmodel/ctmodel.cpp +++ b/src/ctmodel/ctmodel.cpp @@ -66,10 +66,13 @@ ctmodel::ctmodel(void) : GApplication(CTMODEL_NAME, CTMODEL_VERSION) /***********************************************************************//** * @brief Observations constructor * + * param[in] obs Observation container. + * * This method creates an instance of the class by copying an existing * observations container. ***************************************************************************/ -ctmodel::ctmodel(GObservations obs) : GApplication(CTMODEL_NAME, CTMODEL_VERSION) +ctmodel::ctmodel(const GObservations& obs) : + GApplication(CTMODEL_NAME, CTMODEL_VERSION) { // Initialise members init_members(); diff --git a/src/ctmodel/ctmodel.hpp b/src/ctmodel/ctmodel.hpp index ed91be2..e7d0cc3 100644 --- a/src/ctmodel/ctmodel.hpp +++ b/src/ctmodel/ctmodel.hpp @@ -55,7 +55,7 @@ class ctmodel : public GApplication { public: // Constructors and destructors ctmodel(void); - explicit ctmodel(GObservations obs); + explicit ctmodel(const GObservations& obs); ctmodel(int argc, char *argv[]); ctmodel(const ctmodel& app); virtual ~ctmodel(void); diff --git a/src/ctobssim/ctobssim.cpp b/src/ctobssim/ctobssim.cpp index 762cbd4..cac0f25 100644 --- a/src/ctobssim/ctobssim.cpp +++ b/src/ctobssim/ctobssim.cpp @@ -73,7 +73,7 @@ ctobssim::ctobssim(void) : GApplication(CTOBSSIM_NAME, CTOBSSIM_VERSION) * * Constructs application by initialising from an observation container. ***************************************************************************/ -ctobssim::ctobssim(GObservations obs) : +ctobssim::ctobssim(const GObservations& obs) : GApplication(CTOBSSIM_NAME, CTOBSSIM_VERSION) { // Initialise members diff --git a/src/ctobssim/ctobssim.hpp b/src/ctobssim/ctobssim.hpp index 789e15b..1dee2f7 100644 --- a/src/ctobssim/ctobssim.hpp +++ b/src/ctobssim/ctobssim.hpp @@ -51,7 +51,7 @@ class ctobssim : public GApplication { public: // Constructors and destructors ctobssim(void); - explicit ctobssim(GObservations obs); + explicit ctobssim(const GObservations& obs); ctobssim(int argc, char *argv[]); ctobssim(const ctobssim& app); virtual ~ctobssim(void); diff --git a/src/ctselect/ctselect.cpp b/src/ctselect/ctselect.cpp index 598921f..f462b35 100644 --- a/src/ctselect/ctselect.cpp +++ b/src/ctselect/ctselect.cpp @@ -68,10 +68,13 @@ ctselect::ctselect(void) : GApplication(CTSELECT_NAME, CTSELECT_VERSION) /***********************************************************************//** * @brief Observations constructor * + * param[in] obs Observation container. + * * This constructor creates an instance of the class that is initialised from * an observation container. ***************************************************************************/ -ctselect::ctselect(GObservations obs) : GApplication(CTSELECT_NAME, CTSELECT_VERSION) +ctselect::ctselect(const GObservations& obs) : + GApplication(CTSELECT_NAME, CTSELECT_VERSION) { // Initialise members init_members(); diff --git a/src/ctselect/ctselect.hpp b/src/ctselect/ctselect.hpp index 4dfba2e..800b2e2 100644 --- a/src/ctselect/ctselect.hpp +++ b/src/ctselect/ctselect.hpp @@ -47,7 +47,7 @@ class ctselect : public GApplication { public: // Constructors and destructors ctselect(void); - explicit ctselect(GObservations obs); + explicit ctselect(const GObservations& obs); ctselect(int argc, char *argv[]); ctselect(const ctselect& app); virtual ~ctselect(void); diff --git a/src/ctskymap/ctskymap.cpp b/src/ctskymap/ctskymap.cpp index 5353093..184619b 100644 --- a/src/ctskymap/ctskymap.cpp +++ b/src/ctskymap/ctskymap.cpp @@ -66,10 +66,13 @@ ctskymap::ctskymap(void) : GApplication(CTSKYMAP_NAME, CTSKYMAP_VERSION) /***********************************************************************//** * @brief Observations constructor * + * param[in] obs Observation container. + * * This method creates an instance of the class by copying an existing * observations container. ***************************************************************************/ -ctskymap::ctskymap(GObservations obs) : GApplication(CTSKYMAP_NAME, CTSKYMAP_VERSION) +ctskymap::ctskymap(const GObservations& obs) : + GApplication(CTSKYMAP_NAME, CTSKYMAP_VERSION) { // Initialise members init_members(); diff --git a/src/ctskymap/ctskymap.hpp b/src/ctskymap/ctskymap.hpp index b5bcf13..198672c 100644 --- a/src/ctskymap/ctskymap.hpp +++ b/src/ctskymap/ctskymap.hpp @@ -47,7 +47,7 @@ class ctskymap : public GApplication { public: // Constructors and destructors ctskymap(void); - explicit ctskymap(GObservations obs); + explicit ctskymap(const GObservations& obs); ctskymap(int argc, char *argv[]); ctskymap(const ctskymap& app); virtual ~ctskymap(void); diff --git a/test/test_ctools.sh b/test/test_ctools.sh index 2cdc08f..3c31699 100755 --- a/test/test_ctools.sh +++ b/test/test_ctools.sh @@ -406,13 +406,15 @@ $ctpsfcube infile="data/crab_events.fits" \ emin=0.1 \ emax=100.0 \ enumbins=20 \ - nxpix=200 \ - nypix=200 \ - binsz=0.02 \ + nxpix=10 \ + nypix=10 \ + binsz=0.4 \ coordsys="CEL" \ xref=83.63 \ yref=22.01 \ - proj="CAR" + proj="CAR" \ + amax=0.3 \ + anumbins=10 $ECHO -n "." if [ -s "psfcube1.fits" ] then @@ -427,7 +429,9 @@ $ctpsfcube infile="data/crab_events.fits" \ cntmap="data/crab_cntmap.fits" \ outfile="psfcube2.fits" \ caldb="irf" \ - irf="cta_dummy_irf" + irf="cta_dummy_irf" \ + amax=0.3 \ + anumbins=10 $ECHO -n "." if [ -s "psfcube2.fits" ] then -- libgit2 0.21.4