diff --git a/ChangeLog b/ChangeLog index 0b5c890..52f75b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2013-02-21 Juergen Knoedlseder + + * Version 0.7.0 released + ======================== + + Adapt to GammaLib-00-08-00 interface + 2012-12-21 Juergen Knoedlseder * Version 0.6.0 released diff --git a/NEWS b/NEWS index ca32b34..28fa2d2 100644 --- a/NEWS +++ b/NEWS @@ -1,8 +1,8 @@ -New Features and Important Changes in ctools 00-06-00 +New Features and Important Changes in ctools 00-07-00 Author(s) : Juergen Knoedlseder -December 21th, 2012 +February 21th, 2013 1. Introduction @@ -10,6 +10,10 @@ December 21th, 2012 This document briefly summarizes executable by executable the most important changes made since the last release of ctools. +With version 00-08-00, GammaLib has undergone a major interface +change. The adaption of ctools to this interface changed will not be +detailed below as they do not impact the functionalities. + 2. Configuration ----------------- @@ -23,20 +27,12 @@ None 4. ctobssim - CTA observation simulation ---------------------------------------- -Adapt to new GTime interface. The time parameters are now given in the CTA -time reference. - -A bug was corrected that prevented correct usage of the seed value. The -introduction of OpenMP support in version 0.5.0 led to an internal seed -value of 0 event if different seed parameters were specified. The bug -was corrected and the internal seed values that are used are now dumped -into the log file. +None 5. ctselect - CTA event selection --------------------------------- -Adapt to new GTime interface. The time parameters are now given in the CTA -time reference. +None 6. ctbin - CTA event binning @@ -56,11 +52,7 @@ None 9. ctmodel - CTA counts map modelling ------------------------------------- -The executable ctmodel has been added. ctmodel takes a model XML file -and computes the corresponding model map. The definiton of the model -map is either taken from an input counts map or an observation -definiton file, or from the task parameters with an interface that -is similiar to that of ctbin. +None 10. Examples diff --git a/configure.ac b/configure.ac index 3e82b4a..ca9697b 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Configuration for ctools - a set of tools for science analysis of CTA # # data # # ------------------------------------------------------------------------- # -# Copyright (C) 2011-2012 Juergen Knoedlseder # +# Copyright (C) 2011-2013 Juergen Knoedlseder # # ------------------------------------------------------------------------- # # # # This program is free software: you can redistribute it and/or modify # @@ -29,7 +29,7 @@ ############################################################################# # Initialisation # ############################################################################# -AC_INIT([ctools], [0.6.0], [jurgen.knodlseder@irap.omp.eu], [ctools]) +AC_INIT([ctools], [0.7.0], [jurgen.knodlseder@irap.omp.eu], [ctools]) AC_CONFIG_SRCDIR([src/ctselect/ctselect.cpp]) AC_CONFIG_MACRO_DIR([m4]) #AM_INIT_AUTOMAKE([gnu no-dependencies]) diff --git a/ctools.pc.in b/ctools.pc.in index 1fbd3c3..1cfaa30 100644 --- a/ctools.pc.in +++ b/ctools.pc.in @@ -6,9 +6,9 @@ includedir=${prefix}/include Name: ctools Description: CTA science analysis tools URL: http://cta.irap.omp.eu/ctools -Version: 0.6.0 +Version: 0.7.0 Requires: -Requires.private: GammaLib >= 0.7.0 +Requires.private: GammaLib >= 0.8.0 Conflicts: Cflags: -I${includedir}/ctools Libs: -L${libdir} -lctools diff --git a/scripts/cssens.py b/scripts/cssens.py index f1c776a..f2078aa 100755 --- a/scripts/cssens.py +++ b/scripts/cssens.py @@ -347,53 +347,50 @@ class cssens(GApplication): # Set source if type == "point": - spatial = GModelSpatialPtsrc(location) + spatial = GModelSpatialPointSource(location) if fitpos: spatial["RA"].free() spatial["DEC"].free() else: spatial["RA"].fix() spatial["DEC"].fix() - source = GModelPointSource(spatial, spectrum) elif type == "gauss": - radial = GModelRadialGauss(location, self.m_radius) + spatial = GModelSpatialRadialGauss(location, self.m_radius) if fitpos: - radial["RA"].free() - radial["DEC"].free() - radial["Sigma"].free() + spatial["RA"].free() + spatial["DEC"].free() + spatial["Sigma"].free() else: - radial["RA"].fix() - radial["DEC"].fix() - radial["Sigma"].fix() - source = GModelExtendedSource(radial, spectrum) + spatial["RA"].fix() + spatial["DEC"].fix() + spatial["Sigma"].fix() elif type == "disk": - radial = GModelRadialDisk(location, self.m_radius) + spatial = GModelSpatialRadialDisk(location, self.m_radius) if fitpos: - radial["RA"].free() - radial["DEC"].free() - radial["Radius"].free() + spatial["RA"].free() + spatial["DEC"].free() + spatial["Radius"].free() else: - radial["RA"].fix() - radial["DEC"].fix() - radial["Radius"].fix() - source = GModelExtendedSource(radial, spectrum) + spatial["RA"].fix() + spatial["DEC"].fix() + spatial["Radius"].fix() elif type == "shell": - radial = GModelRadialShell(location, self.m_radius, self.m_width) + spatial = GModelSpatialRadialShell(location, self.m_radius, self.m_width) if fitpos: - radial["RA"].free() - radial["DEC"].free() - radial["Radius"].free() - radial["Width"].free() + spatial["RA"].free() + spatial["DEC"].free() + spatial["Radius"].free() + spatial["Width"].free() else: - radial["RA"].fix() - radial["DEC"].fix() - radial["Radius"].fix() - radial["Width"].fix() - source = GModelExtendedSource(radial, spectrum) + spatial["RA"].fix() + spatial["DEC"].fix() + spatial["Radius"].fix() + spatial["Width"].fix() else: self.log("ERROR: Unknown source type '"+type+"'.\n") return None - + source = GModelSky(spatial, spectrum) + # Set source name source.name("Test") diff --git a/scripts/cstsdist.py b/scripts/cstsdist.py index cd89c5f..074182e 100755 --- a/scripts/cstsdist.py +++ b/scripts/cstsdist.py @@ -324,32 +324,29 @@ class cstsdist(GApplication): # Set source if type == "point": - spatial = GModelSpatialPtsrc(location) + spatial = GModelSpatialPointSource(location) if fitpos: spatial[0].free() spatial[1].free() - source = GModelPointSource(spatial, spectrum) elif type == "gauss": - radial = GModelRadialGauss(location, sigma) + spatial = GModelSpatialRadialGauss(location, sigma) if fitpos: - radial[0].free() - radial[1].free() - source = GModelExtendedSource(radial, spectrum) + spatial[0].free() + spatial[1].free() elif type == "disk": - radial = GModelRadialDisk(location, radius) + spatial = GModelSpatialRadialDisk(location, radius) if fitpos: - radial[0].free() - radial[1].free() - source = GModelExtendedSource(radial, spectrum) + spatial[0].free() + spatial[1].free() elif type == "shell": - radial = GModelRadialShell(location, radius, width) + spatial = GModelSpatialRadialShell(location, radius, width) if fitpos: - radial[0].free() - radial[1].free() - source = GModelExtendedSource(radial, spectrum) + spatial[0].free() + spatial[1].free() else: self.log("ERROR: Unknown source type '"+type+"'.\n") return None + source = GModelSky(spatial, spectrum) # Set source name source.name("Test") diff --git a/src/ctbin/ctbin.cpp b/src/ctbin/ctbin.cpp index cb431d1..a880f57 100644 --- a/src/ctbin/ctbin.cpp +++ b/src/ctbin/ctbin.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctbin - CTA data binning tool * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -21,7 +21,7 @@ /** * @file ctbin.cpp * @brief CTA data binning tool implementation - * @author J. Knoedlseder + * @author Juergen Knoedlseder */ /* __ Includes ___________________________________________________________ */ @@ -277,7 +277,7 @@ void ctbin::run(void) m_infiles.push_back(""); // Get CTA observation - GCTAObservation* obs = dynamic_cast(&m_obs[i]); + GCTAObservation* obs = dynamic_cast(m_obs[i]); // Continue only if observation is a CTA observation if (obs != NULL) { @@ -481,12 +481,9 @@ void ctbin::bin_events(GCTAObservation* obs) } // Setup energy range covered by data - GEnergy emin; - GEnergy emax; - GEbounds ebds; - emin.TeV(m_emin); - emax.TeV(m_emax); - ebds.setlog(emin, emax, m_enumbins); + GEnergy emin(m_emin, "TeV"); + GEnergy emax(m_emax, "TeV"); + GEbounds ebds(m_enumbins, emin, emax); // Get Good Time intervals GGti gti = obs->events()->gti(); @@ -713,7 +710,7 @@ void ctbin::save_fits(void) m_outfile = (*this)["outfile"].filename(); // Get CTA observation from observation container - GCTAObservation* obs = dynamic_cast(&m_obs[0]); + GCTAObservation* obs = dynamic_cast(m_obs[0]); // Save event list save_counts_map(obs, m_outfile); @@ -744,7 +741,7 @@ void ctbin::save_xml(void) for (int i = 0; i < m_obs.size(); ++i) { // Get CTA observation - GCTAObservation* obs = dynamic_cast(&m_obs[i]); + GCTAObservation* obs = dynamic_cast(m_obs[i]); // Handle only CTA observations if (obs != NULL) { diff --git a/src/ctbin/ctbin.hpp b/src/ctbin/ctbin.hpp index d0016b6..97cea1a 100644 --- a/src/ctbin/ctbin.hpp +++ b/src/ctbin/ctbin.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctbin - CTA data binning tool * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -21,7 +21,7 @@ /** * @file ctbin.hpp * @brief CTA data binning tool definition - * @author J. Knoedlseder + * @author Juergen Knoedlseder */ #ifndef CTBIN_HPP @@ -33,7 +33,7 @@ /* __Definitions _________________________________________________________ */ #define CTBIN_NAME "ctbin" -#define CTBIN_VERSION "00-03-01" +#define CTBIN_VERSION "00-04-00" /***********************************************************************//** diff --git a/src/ctlike/ctlike.cpp b/src/ctlike/ctlike.cpp index 82d0274..040a08f 100644 --- a/src/ctlike/ctlike.cpp +++ b/src/ctlike/ctlike.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctlike - CTA maximum likelihood tool * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -21,7 +21,7 @@ /** * @file ctlike.cpp * @brief CTA maximum likelihood tool implementation - * @author J. Knoedlseder + * @author Juergen Knoedlseder */ /* __ Includes ___________________________________________________________ */ @@ -259,7 +259,7 @@ void ctlike::run(void) // Compute number of observed events in all observations double num_events = 0.0; for (int i = 0; i < m_obs.size(); ++i) { - num_events += m_obs[i].events()->number(); + num_events += m_obs[i]->events()->number(); } // Write results into logger diff --git a/src/ctlike/ctlike.hpp b/src/ctlike/ctlike.hpp index 4f09676..2cfe6f6 100644 --- a/src/ctlike/ctlike.hpp +++ b/src/ctlike/ctlike.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctlike - CTA maximum likelihood tool * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -21,7 +21,7 @@ /** * @file ctlike.hpp * @brief CTA maximum likelihood tool interface definition - * @author J. Knoedlseder + * @author Juergen Knoedlseder */ #ifndef CTLIKE_HPP @@ -34,7 +34,7 @@ /* __Definitions _________________________________________________________ */ #define CTLIKE_NAME "ctlike" -#define CTLIKE_VERSION "00-04-00" +#define CTLIKE_VERSION "00-05-00" /***********************************************************************//** diff --git a/src/ctmodel/ctmodel.cpp b/src/ctmodel/ctmodel.cpp index d9accca..216807e 100644 --- a/src/ctmodel/ctmodel.cpp +++ b/src/ctmodel/ctmodel.cpp @@ -279,7 +279,7 @@ void ctmodel::run(void) m_infiles.push_back(""); // Get CTA observation - GCTAObservation* obs = dynamic_cast(&m_obs[i]); + GCTAObservation* obs = dynamic_cast(m_obs[i]); // Continue only if observation is a CTA observation if (obs != NULL) { @@ -483,12 +483,9 @@ void ctmodel::setup_obs(void) pnt.dir(skydir); // Setup energy range covered by model - GEnergy emin; - GEnergy emax; - GEbounds ebds; - emin.TeV(m_emin); - emax.TeV(m_emax); - ebds.setlog(emin, emax, m_enumbins); + GEnergy emin(m_emin, "TeV"); + GEnergy emax(m_emax, "TeV"); + GEbounds ebds(m_enumbins, emin, emax); // Setup time interval covered by model GGti gti; @@ -571,7 +568,7 @@ void ctmodel::setup_obs(void) for (int i = 0; i < m_obs.size(); ++i) { // Is this observation a CTA observation? - GCTAObservation* obs = dynamic_cast(&m_obs[i]); + GCTAObservation* obs = dynamic_cast(m_obs[i]); // Yes ... if (obs != NULL) { @@ -792,7 +789,7 @@ void ctmodel::save_fits(void) m_outfile = (*this)["outfile"].filename(); // Get CTA observation from observation container - GCTAObservation* obs = dynamic_cast(&m_obs[0]); + GCTAObservation* obs = dynamic_cast(m_obs[0]); // Save model map save_model_map(obs, m_outfile); @@ -823,7 +820,7 @@ void ctmodel::save_xml(void) for (int i = 0; i < m_obs.size(); ++i) { // Get CTA observation - GCTAObservation* obs = dynamic_cast(&m_obs[i]); + GCTAObservation* obs = dynamic_cast(m_obs[i]); // Handle only CTA observations if (obs != NULL) { diff --git a/src/ctmodel/ctmodel.hpp b/src/ctmodel/ctmodel.hpp index 8a0cd00..e70d7be 100644 --- a/src/ctmodel/ctmodel.hpp +++ b/src/ctmodel/ctmodel.hpp @@ -33,7 +33,7 @@ /* __Definitions _________________________________________________________ */ #define CTMODEL_NAME "ctmodel" -#define CTMODEL_VERSION "00-01-01" +#define CTMODEL_VERSION "00-02-00" /***********************************************************************//** diff --git a/src/ctobssim/ctobssim.cpp b/src/ctobssim/ctobssim.cpp index 747c2fc..e04c7e9 100644 --- a/src/ctobssim/ctobssim.cpp +++ b/src/ctobssim/ctobssim.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctobssim - CTA observation simulator tool * * ----------------------------------------------------------------------- * - * copyright (C) 2011-2012 by Juergen Knoedlseder * + * copyright (C) 2011-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -295,7 +295,7 @@ void ctobssim::run(void) for (int i = 0; i < m_obs.size(); ++i) { // Get CTA observation - GCTAObservation* obs = dynamic_cast(&m_obs[i]); + GCTAObservation* obs = dynamic_cast(m_obs[i]); // Continue only if observation is a CTA observation if (obs != NULL) { @@ -1036,7 +1036,7 @@ void ctobssim::save_fits(void) m_outfile = (*this)["outfile"].filename(); // Get CTA observation from observation container - GCTAObservation* obs = dynamic_cast(&m_obs[0]); + GCTAObservation* obs = dynamic_cast(m_obs[0]); // Save observation into FITS file obs->save(m_outfile, clobber()); @@ -1069,7 +1069,7 @@ void ctobssim::save_xml(void) for (int i = 0; i < m_obs.size(); ++i) { // Get CTA observation - GCTAObservation* obs = dynamic_cast(&m_obs[i]); + GCTAObservation* obs = dynamic_cast(m_obs[i]); // Handle only CTA observations if (obs != NULL) { diff --git a/src/ctobssim/ctobssim.hpp b/src/ctobssim/ctobssim.hpp index 7b60214..368e54f 100644 --- a/src/ctobssim/ctobssim.hpp +++ b/src/ctobssim/ctobssim.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctobssim - CTA observation simulator tool * * ----------------------------------------------------------------------- * - * copyright (C) 2011-2012 by Juergen Knoedlseder * + * copyright (C) 2011-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -33,7 +33,7 @@ /* __Definitions _________________________________________________________ */ #define CTOBSSIM_NAME "ctobssim" -#define CTOBSSIM_VERSION "00-07-00" +#define CTOBSSIM_VERSION "00-08-00" /***********************************************************************//** diff --git a/src/ctselect/ctselect.cpp b/src/ctselect/ctselect.cpp index cefee5d..2ec8a65 100644 --- a/src/ctselect/ctselect.cpp +++ b/src/ctselect/ctselect.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctselect - CTA data selection tool * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -269,7 +269,7 @@ void ctselect::run(void) m_infiles.push_back(""); // Get CTA observation - GCTAObservation* obs = dynamic_cast(&m_obs[i]); + GCTAObservation* obs = dynamic_cast(m_obs[i]); // Continue only if observation is a CTA observation if (obs != NULL) { @@ -872,7 +872,7 @@ void ctselect::save_fits(void) m_outfile = (*this)["outfile"].filename(); // Get CTA observation from observation container - GCTAObservation* obs = dynamic_cast(&m_obs[0]); + GCTAObservation* obs = dynamic_cast(m_obs[0]); // Save event list save_event_list(obs, m_infiles[0], m_outfile); @@ -902,7 +902,7 @@ void ctselect::save_xml(void) for (int i = 0; i < m_obs.size(); ++i) { // Get CTA observation - GCTAObservation* obs = dynamic_cast(&m_obs[i]); + GCTAObservation* obs = dynamic_cast(m_obs[i]); // Handle only CTA observations if (obs != NULL) { diff --git a/src/ctselect/ctselect.hpp b/src/ctselect/ctselect.hpp index 9877498..129c425 100644 --- a/src/ctselect/ctselect.hpp +++ b/src/ctselect/ctselect.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctselect - CTA data selection tool * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -35,7 +35,7 @@ /* __Definitions _________________________________________________________ */ #define CTSELECT_NAME "ctselect" -#define CTSELECT_VERSION "00-04-00" +#define CTSELECT_VERSION "00-05-00" /***********************************************************************//** diff --git a/src/ctskymap/ctskymap.cpp b/src/ctskymap/ctskymap.cpp index 51bf608..fe146f6 100644 --- a/src/ctskymap/ctskymap.cpp +++ b/src/ctskymap/ctskymap.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctskymap - CTA sky mapping tool * * ----------------------------------------------------------------------- * - * copyright (C) 2011 by Juergen Knoedlseder * + * copyright (C) 2011-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -21,7 +21,7 @@ /** * @file ctskymap.cpp * @brief CTA sky mapping tool implementation - * @author J. Knoedlseder + * @author Juergen Knoedlseder */ /* __ Includes ___________________________________________________________ */ @@ -272,7 +272,7 @@ void ctskymap::run(void) for (int i = 0; i < m_obs.size(); ++i) { // Get CTA observation - GCTAObservation* obs = dynamic_cast(&m_obs[i]); + GCTAObservation* obs = dynamic_cast(m_obs[i]); // Continue only if observation is a CTA observation if (obs != NULL) { diff --git a/src/ctskymap/ctskymap.hpp b/src/ctskymap/ctskymap.hpp index 0011c89..230c290 100644 --- a/src/ctskymap/ctskymap.hpp +++ b/src/ctskymap/ctskymap.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctskymap - CTA sky mapping tool * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2011 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -21,7 +21,7 @@ /** * @file ctskymap.hpp * @brief CTA sky mapping tool definition - * @author J. Knoedlseder + * @author Juergen Knoedlseder */ #ifndef CTSKYMAP_HPP @@ -33,7 +33,7 @@ /* __Definitions _________________________________________________________ */ #define CTSKYMAP_NAME "ctskymap" -#define CTSKYMAP_VERSION "00-01-00" +#define CTSKYMAP_VERSION "00-02-00" /***********************************************************************//**