Commit f5eb08386872b2ae16002efdd680c7c99ce598d8

Authored by Jürgen Knödlseder
1 parent a4075c60

Observation container constructor now always takes a const reference as argument.

pyext/ctbin.i
@@ -39,7 +39,7 @@ class ctbin : public GApplication { @@ -39,7 +39,7 @@ class ctbin : public GApplication {
39 public: 39 public:
40 // Constructors and destructors 40 // Constructors and destructors
41 ctbin(void); 41 ctbin(void);
42 - explicit ctbin(GObservations obs); 42 + explicit ctbin(const GObservations& obs);
43 ctbin(int argc, char *argv[]); 43 ctbin(int argc, char *argv[]);
44 ctbin(const ctbin& app); 44 ctbin(const ctbin& app);
45 virtual ~ctbin(void); 45 virtual ~ctbin(void);
pyext/ctexpcube.i
@@ -40,7 +40,7 @@ class ctexpcube : public GApplication { @@ -40,7 +40,7 @@ class ctexpcube : public GApplication {
40 public: 40 public:
41 // Constructors and destructors 41 // Constructors and destructors
42 ctexpcube(void); 42 ctexpcube(void);
43 - explicit ctexpcube(GObservations obs); 43 + explicit ctexpcube(const GObservations& obs);
44 ctexpcube(int argc, char *argv[]); 44 ctexpcube(int argc, char *argv[]);
45 ctexpcube(const ctexpcube& app); 45 ctexpcube(const ctexpcube& app);
46 virtual ~ctexpcube(void); 46 virtual ~ctexpcube(void);
pyext/ctlike.i
1 /*************************************************************************** 1 /***************************************************************************
2 * ctlike - CTA maximum likelihood tool * 2 * ctlike - CTA maximum likelihood tool *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright (C) 2010-2012 by Jurgen Knodlseder * 4 + * copyright (C) 2010-2014 by Jurgen Knodlseder *
5 * ----------------------------------------------------------------------- * 5 * ----------------------------------------------------------------------- *
6 * * 6 * *
7 * This program is free software: you can redistribute it and/or modify * 7 * This program is free software: you can redistribute it and/or modify *
@@ -40,7 +40,7 @@ class ctlike : public GApplication { @@ -40,7 +40,7 @@ class ctlike : public GApplication {
40 public: 40 public:
41 // Constructors and destructors 41 // Constructors and destructors
42 ctlike(void); 42 ctlike(void);
43 - explicit ctlike(GObservations obs); 43 + explicit ctlike(const GObservations& obs);
44 ctlike(int argc, char *argv[]); 44 ctlike(int argc, char *argv[]);
45 ctlike(const ctlike& app); 45 ctlike(const ctlike& app);
46 virtual ~ctlike(void); 46 virtual ~ctlike(void);
pyext/ctmodel.i
1 /*************************************************************************** 1 /***************************************************************************
2 * ctmodel - CTA counts model tool * 2 * ctmodel - CTA counts model tool *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright (C) 2012 by Juergen Knoedlseder * 4 + * copyright (C) 2012-2014 by Juergen Knoedlseder *
5 * ----------------------------------------------------------------------- * 5 * ----------------------------------------------------------------------- *
6 * * 6 * *
7 * This program is free software: you can redistribute it and/or modify * 7 * This program is free software: you can redistribute it and/or modify *
@@ -40,7 +40,7 @@ class ctmodel : public GApplication { @@ -40,7 +40,7 @@ class ctmodel : public GApplication {
40 public: 40 public:
41 // Constructors and destructors 41 // Constructors and destructors
42 ctmodel(void); 42 ctmodel(void);
43 - explicit ctmodel(GObservations obs); 43 + explicit ctmodel(const GObservations& obs);
44 ctmodel(int argc, char *argv[]); 44 ctmodel(int argc, char *argv[]);
45 ctmodel(const ctmodel& app); 45 ctmodel(const ctmodel& app);
46 virtual ~ctmodel(void); 46 virtual ~ctmodel(void);
pyext/ctobssim.i
1 /*************************************************************************** 1 /***************************************************************************
2 * ctobssim - CTA observation simulation tool * 2 * ctobssim - CTA observation simulation tool *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright (C) 2011 by Jurgen Knodlseder * 4 + * copyright (C) 2011-2014 by Jurgen Knodlseder *
5 * ----------------------------------------------------------------------- * 5 * ----------------------------------------------------------------------- *
6 * * 6 * *
7 * This program is free software: you can redistribute it and/or modify * 7 * This program is free software: you can redistribute it and/or modify *
@@ -39,7 +39,7 @@ class ctobssim : public GApplication { @@ -39,7 +39,7 @@ class ctobssim : public GApplication {
39 public: 39 public:
40 // Constructors and destructors 40 // Constructors and destructors
41 ctobssim(void); 41 ctobssim(void);
42 - explicit ctobssim(GObservations obs); 42 + explicit ctobssim(const GObservations& obs);
43 ctobssim(int argc, char *argv[]); 43 ctobssim(int argc, char *argv[]);
44 ctobssim(const ctobssim& app); 44 ctobssim(const ctobssim& app);
45 virtual ~ctobssim(void); 45 virtual ~ctobssim(void);
pyext/ctselect.i
1 /*************************************************************************** 1 /***************************************************************************
2 * ctselect - CTA data selection tool * 2 * ctselect - CTA data selection tool *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright (C) 2010-2011 by Jurgen Knodlseder * 4 + * copyright (C) 2010-2014 by Jurgen Knodlseder *
5 * ----------------------------------------------------------------------- * 5 * ----------------------------------------------------------------------- *
6 * * 6 * *
7 * This program is free software: you can redistribute it and/or modify * 7 * This program is free software: you can redistribute it and/or modify *
@@ -39,7 +39,7 @@ class ctselect : public GApplication { @@ -39,7 +39,7 @@ class ctselect : public GApplication {
39 public: 39 public:
40 // Constructors and destructors 40 // Constructors and destructors
41 ctselect(void); 41 ctselect(void);
42 - explicit ctselect(GObservations obs); 42 + explicit ctselect(const GObservations& obs);
43 ctselect(int argc, char *argv[]); 43 ctselect(int argc, char *argv[]);
44 ctselect(const ctselect& app); 44 ctselect(const ctselect& app);
45 virtual ~ctselect(void); 45 virtual ~ctselect(void);
pyext/ctskymap.i
1 /*************************************************************************** 1 /***************************************************************************
2 * ctskymap - CTA sky mapping tool * 2 * ctskymap - CTA sky mapping tool *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright (C) 2012 by Juergen Knoedlseder * 4 + * copyright (C) 2012-2014 by Juergen Knoedlseder *
5 * ----------------------------------------------------------------------- * 5 * ----------------------------------------------------------------------- *
6 * * 6 * *
7 * This program is free software: you can redistribute it and/or modify * 7 * This program is free software: you can redistribute it and/or modify *
@@ -39,7 +39,7 @@ class ctskymap : public GApplication { @@ -39,7 +39,7 @@ class ctskymap : public GApplication {
39 public: 39 public:
40 // Constructors and destructors 40 // Constructors and destructors
41 ctskymap(void); 41 ctskymap(void);
42 - explicit ctskymap(GObservations obs); 42 + explicit ctskymap(const GObservations& obs);
43 ctskymap(int argc, char *argv[]); 43 ctskymap(int argc, char *argv[]);
44 ctskymap(const ctskymap& app); 44 ctskymap(const ctskymap& app);
45 virtual ~ctskymap(void); 45 virtual ~ctskymap(void);
src/ctbin/ctbin.cpp
@@ -69,10 +69,13 @@ ctbin::ctbin(void) : GApplication(CTBIN_NAME, CTBIN_VERSION) @@ -69,10 +69,13 @@ ctbin::ctbin(void) : GApplication(CTBIN_NAME, CTBIN_VERSION)
69 /***********************************************************************//** 69 /***********************************************************************//**
70 * @brief Observations constructor 70 * @brief Observations constructor
71 * 71 *
  72 + * param[in] obs Observation container.
  73 + *
72 * This method creates an instance of the class by copying an existing 74 * This method creates an instance of the class by copying an existing
73 * observations container. 75 * observations container.
74 ***************************************************************************/ 76 ***************************************************************************/
75 -ctbin::ctbin(GObservations obs) : GApplication(CTBIN_NAME, CTBIN_VERSION) 77 +ctbin::ctbin(const GObservations& obs) :
  78 + GApplication(CTBIN_NAME, CTBIN_VERSION)
76 { 79 {
77 // Initialise members 80 // Initialise members
78 init_members(); 81 init_members();
src/ctbin/ctbin.hpp
@@ -64,7 +64,7 @@ class ctbin : public GApplication { @@ -64,7 +64,7 @@ class ctbin : public GApplication {
64 public: 64 public:
65 // Constructors and destructors 65 // Constructors and destructors
66 ctbin(void); 66 ctbin(void);
67 - explicit ctbin(GObservations obs); 67 + explicit ctbin(const GObservations& obs);
68 ctbin(int argc, char *argv[]); 68 ctbin(int argc, char *argv[]);
69 ctbin(const ctbin& app); 69 ctbin(const ctbin& app);
70 virtual ~ctbin(void); 70 virtual ~ctbin(void);
src/ctcubemask/ctcubemask.cpp
@@ -67,6 +67,8 @@ ctcubemask::ctcubemask(void) : GApplication(CTCUBEMASK_NAME, CTCUBEMASK_VERSION) @@ -67,6 +67,8 @@ ctcubemask::ctcubemask(void) : GApplication(CTCUBEMASK_NAME, CTCUBEMASK_VERSION)
67 /***********************************************************************//** 67 /***********************************************************************//**
68 * @brief Observations constructor 68 * @brief Observations constructor
69 * 69 *
  70 + * param[in] obs Observation container.
  71 + *
70 * This constructor creates an instance of the class that is initialised from 72 * This constructor creates an instance of the class that is initialised from
71 * an observation container. 73 * an observation container.
72 ***************************************************************************/ 74 ***************************************************************************/
src/ctexpcube/ctexpcube.cpp
@@ -68,10 +68,13 @@ ctexpcube::ctexpcube(void) : GApplication(CTEXPCUBE_NAME, CTEXPCUBE_VERSION) @@ -68,10 +68,13 @@ ctexpcube::ctexpcube(void) : GApplication(CTEXPCUBE_NAME, CTEXPCUBE_VERSION)
68 /***********************************************************************//** 68 /***********************************************************************//**
69 * @brief Observations constructor 69 * @brief Observations constructor
70 * 70 *
  71 + * param[in] obs Observation container.
  72 + *
71 * This method creates an instance of the class by copying an existing 73 * This method creates an instance of the class by copying an existing
72 * observations container. 74 * observations container.
73 ***************************************************************************/ 75 ***************************************************************************/
74 -ctexpcube::ctexpcube(GObservations obs) : GApplication(CTEXPCUBE_NAME, CTEXPCUBE_VERSION) 76 +ctexpcube::ctexpcube(const GObservations& obs) :
  77 + GApplication(CTEXPCUBE_NAME, CTEXPCUBE_VERSION)
75 { 78 {
76 // Initialise members 79 // Initialise members
77 init_members(); 80 init_members();
src/ctexpcube/ctexpcube.hpp
@@ -46,7 +46,7 @@ class ctexpcube : public GApplication { @@ -46,7 +46,7 @@ class ctexpcube : public GApplication {
46 public: 46 public:
47 // Constructors and destructors 47 // Constructors and destructors
48 ctexpcube(void); 48 ctexpcube(void);
49 - explicit ctexpcube(GObservations obs); 49 + explicit ctexpcube(const GObservations& obs);
50 ctexpcube(int argc, char *argv[]); 50 ctexpcube(int argc, char *argv[]);
51 ctexpcube(const ctexpcube& app); 51 ctexpcube(const ctexpcube& app);
52 virtual ~ctexpcube(void); 52 virtual ~ctexpcube(void);
src/ctlike/ctlike.cpp
@@ -65,10 +65,13 @@ ctlike::ctlike(void) : GApplication(CTLIKE_NAME, CTLIKE_VERSION) @@ -65,10 +65,13 @@ ctlike::ctlike(void) : GApplication(CTLIKE_NAME, CTLIKE_VERSION)
65 /***********************************************************************//** 65 /***********************************************************************//**
66 * @brief Observations constructor 66 * @brief Observations constructor
67 * 67 *
  68 + * param[in] obs Observation container.
  69 + *
68 * This method creates an instance of the class by copying an existing 70 * This method creates an instance of the class by copying an existing
69 * observations container. 71 * observations container.
70 ***************************************************************************/ 72 ***************************************************************************/
71 -ctlike::ctlike(GObservations obs) : GApplication(CTLIKE_NAME, CTLIKE_VERSION) 73 +ctlike::ctlike(const GObservations& obs) :
  74 + GApplication(CTLIKE_NAME, CTLIKE_VERSION)
72 { 75 {
73 // Initialise members 76 // Initialise members
74 init_members(); 77 init_members();
src/ctlike/ctlike.hpp
@@ -46,7 +46,7 @@ class ctlike : public GApplication { @@ -46,7 +46,7 @@ class ctlike : public GApplication {
46 public: 46 public:
47 // Constructors and destructors 47 // Constructors and destructors
48 ctlike(void); 48 ctlike(void);
49 - explicit ctlike(GObservations obs); 49 + explicit ctlike(const GObservations& obs);
50 ctlike(int argc, char *argv[]); 50 ctlike(int argc, char *argv[]);
51 ctlike(const ctlike& app); 51 ctlike(const ctlike& app);
52 virtual ~ctlike(void); 52 virtual ~ctlike(void);
src/ctmodel/ctmodel.cpp
@@ -66,10 +66,13 @@ ctmodel::ctmodel(void) : GApplication(CTMODEL_NAME, CTMODEL_VERSION) @@ -66,10 +66,13 @@ ctmodel::ctmodel(void) : GApplication(CTMODEL_NAME, CTMODEL_VERSION)
66 /***********************************************************************//** 66 /***********************************************************************//**
67 * @brief Observations constructor 67 * @brief Observations constructor
68 * 68 *
  69 + * param[in] obs Observation container.
  70 + *
69 * This method creates an instance of the class by copying an existing 71 * This method creates an instance of the class by copying an existing
70 * observations container. 72 * observations container.
71 ***************************************************************************/ 73 ***************************************************************************/
72 -ctmodel::ctmodel(GObservations obs) : GApplication(CTMODEL_NAME, CTMODEL_VERSION) 74 +ctmodel::ctmodel(const GObservations& obs) :
  75 + GApplication(CTMODEL_NAME, CTMODEL_VERSION)
73 { 76 {
74 // Initialise members 77 // Initialise members
75 init_members(); 78 init_members();
src/ctmodel/ctmodel.hpp
@@ -55,7 +55,7 @@ class ctmodel : public GApplication { @@ -55,7 +55,7 @@ class ctmodel : public GApplication {
55 public: 55 public:
56 // Constructors and destructors 56 // Constructors and destructors
57 ctmodel(void); 57 ctmodel(void);
58 - explicit ctmodel(GObservations obs); 58 + explicit ctmodel(const GObservations& obs);
59 ctmodel(int argc, char *argv[]); 59 ctmodel(int argc, char *argv[]);
60 ctmodel(const ctmodel& app); 60 ctmodel(const ctmodel& app);
61 virtual ~ctmodel(void); 61 virtual ~ctmodel(void);
src/ctobssim/ctobssim.cpp
@@ -73,7 +73,7 @@ ctobssim::ctobssim(void) : GApplication(CTOBSSIM_NAME, CTOBSSIM_VERSION) @@ -73,7 +73,7 @@ ctobssim::ctobssim(void) : GApplication(CTOBSSIM_NAME, CTOBSSIM_VERSION)
73 * 73 *
74 * Constructs application by initialising from an observation container. 74 * Constructs application by initialising from an observation container.
75 ***************************************************************************/ 75 ***************************************************************************/
76 -ctobssim::ctobssim(GObservations obs) : 76 +ctobssim::ctobssim(const GObservations& obs) :
77 GApplication(CTOBSSIM_NAME, CTOBSSIM_VERSION) 77 GApplication(CTOBSSIM_NAME, CTOBSSIM_VERSION)
78 { 78 {
79 // Initialise members 79 // Initialise members
src/ctobssim/ctobssim.hpp
@@ -51,7 +51,7 @@ class ctobssim : public GApplication { @@ -51,7 +51,7 @@ class ctobssim : public GApplication {
51 public: 51 public:
52 // Constructors and destructors 52 // Constructors and destructors
53 ctobssim(void); 53 ctobssim(void);
54 - explicit ctobssim(GObservations obs); 54 + explicit ctobssim(const GObservations& obs);
55 ctobssim(int argc, char *argv[]); 55 ctobssim(int argc, char *argv[]);
56 ctobssim(const ctobssim& app); 56 ctobssim(const ctobssim& app);
57 virtual ~ctobssim(void); 57 virtual ~ctobssim(void);
src/ctselect/ctselect.cpp
@@ -68,10 +68,13 @@ ctselect::ctselect(void) : GApplication(CTSELECT_NAME, CTSELECT_VERSION) @@ -68,10 +68,13 @@ ctselect::ctselect(void) : GApplication(CTSELECT_NAME, CTSELECT_VERSION)
68 /***********************************************************************//** 68 /***********************************************************************//**
69 * @brief Observations constructor 69 * @brief Observations constructor
70 * 70 *
  71 + * param[in] obs Observation container.
  72 + *
71 * This constructor creates an instance of the class that is initialised from 73 * This constructor creates an instance of the class that is initialised from
72 * an observation container. 74 * an observation container.
73 ***************************************************************************/ 75 ***************************************************************************/
74 -ctselect::ctselect(GObservations obs) : GApplication(CTSELECT_NAME, CTSELECT_VERSION) 76 +ctselect::ctselect(const GObservations& obs) :
  77 + GApplication(CTSELECT_NAME, CTSELECT_VERSION)
75 { 78 {
76 // Initialise members 79 // Initialise members
77 init_members(); 80 init_members();
src/ctselect/ctselect.hpp
@@ -47,7 +47,7 @@ class ctselect : public GApplication { @@ -47,7 +47,7 @@ class ctselect : public GApplication {
47 public: 47 public:
48 // Constructors and destructors 48 // Constructors and destructors
49 ctselect(void); 49 ctselect(void);
50 - explicit ctselect(GObservations obs); 50 + explicit ctselect(const GObservations& obs);
51 ctselect(int argc, char *argv[]); 51 ctselect(int argc, char *argv[]);
52 ctselect(const ctselect& app); 52 ctselect(const ctselect& app);
53 virtual ~ctselect(void); 53 virtual ~ctselect(void);
src/ctskymap/ctskymap.cpp
@@ -66,10 +66,13 @@ ctskymap::ctskymap(void) : GApplication(CTSKYMAP_NAME, CTSKYMAP_VERSION) @@ -66,10 +66,13 @@ ctskymap::ctskymap(void) : GApplication(CTSKYMAP_NAME, CTSKYMAP_VERSION)
66 /***********************************************************************//** 66 /***********************************************************************//**
67 * @brief Observations constructor 67 * @brief Observations constructor
68 * 68 *
  69 + * param[in] obs Observation container.
  70 + *
69 * This method creates an instance of the class by copying an existing 71 * This method creates an instance of the class by copying an existing
70 * observations container. 72 * observations container.
71 ***************************************************************************/ 73 ***************************************************************************/
72 -ctskymap::ctskymap(GObservations obs) : GApplication(CTSKYMAP_NAME, CTSKYMAP_VERSION) 74 +ctskymap::ctskymap(const GObservations& obs) :
  75 + GApplication(CTSKYMAP_NAME, CTSKYMAP_VERSION)
73 { 76 {
74 // Initialise members 77 // Initialise members
75 init_members(); 78 init_members();
src/ctskymap/ctskymap.hpp
@@ -47,7 +47,7 @@ class ctskymap : public GApplication { @@ -47,7 +47,7 @@ class ctskymap : public GApplication {
47 public: 47 public:
48 // Constructors and destructors 48 // Constructors and destructors
49 ctskymap(void); 49 ctskymap(void);
50 - explicit ctskymap(GObservations obs); 50 + explicit ctskymap(const GObservations& obs);
51 ctskymap(int argc, char *argv[]); 51 ctskymap(int argc, char *argv[]);
52 ctskymap(const ctskymap& app); 52 ctskymap(const ctskymap& app);
53 virtual ~ctskymap(void); 53 virtual ~ctskymap(void);
test/test_ctools.sh
@@ -406,13 +406,15 @@ $ctpsfcube infile="data/crab_events.fits" \ @@ -406,13 +406,15 @@ $ctpsfcube infile="data/crab_events.fits" \
406 emin=0.1 \ 406 emin=0.1 \
407 emax=100.0 \ 407 emax=100.0 \
408 enumbins=20 \ 408 enumbins=20 \
409 - nxpix=200 \  
410 - nypix=200 \  
411 - binsz=0.02 \ 409 + nxpix=10 \
  410 + nypix=10 \
  411 + binsz=0.4 \
412 coordsys="CEL" \ 412 coordsys="CEL" \
413 xref=83.63 \ 413 xref=83.63 \
414 yref=22.01 \ 414 yref=22.01 \
415 - proj="CAR" 415 + proj="CAR" \
  416 + amax=0.3 \
  417 + anumbins=10
416 $ECHO -n "." 418 $ECHO -n "."
417 if [ -s "psfcube1.fits" ] 419 if [ -s "psfcube1.fits" ]
418 then 420 then
@@ -427,7 +429,9 @@ $ctpsfcube infile="data/crab_events.fits" \ @@ -427,7 +429,9 @@ $ctpsfcube infile="data/crab_events.fits" \
427 cntmap="data/crab_cntmap.fits" \ 429 cntmap="data/crab_cntmap.fits" \
428 outfile="psfcube2.fits" \ 430 outfile="psfcube2.fits" \
429 caldb="irf" \ 431 caldb="irf" \
430 - irf="cta_dummy_irf" 432 + irf="cta_dummy_irf" \
  433 + amax=0.3 \
  434 + anumbins=10
431 $ECHO -n "." 435 $ECHO -n "."
432 if [ -s "psfcube2.fits" ] 436 if [ -s "psfcube2.fits" ]
433 then 437 then