diff --git a/NEWS b/NEWS index f7238c9..b46d251 100644 --- a/NEWS +++ b/NEWS @@ -24,13 +24,15 @@ The following methods have been renamed: - GCTAResponseTable::tables(), was formerly GCTAResponseTable::size() - GCTAResponseTable::axis_bins(), was formerly GCTAResponseTable::axis() -The following methods now take a GFilename argument instead of std::string: -- GEbounds(const GFilename&) -- GEbounds::load() -- GEbounds::save() -- GGti(const GFilename&) -- GGti::load() -- GGti::save() +The following classes now use for filenames a GFilename argument instead +of std::string: +- GEbounds +- GGti +- GEnergies +- GEvents +- GEventCube, GCOMEventCube, GCTAEventCube, GLATEventCube, GMWLSpectrum +- GEventList, GCTAEventList, GLATEventList + The return value has been changed for the following methods: - GFits::filename() returns now GFilename instead of std::string diff --git a/include/GEnergies.hpp b/include/GEnergies.hpp index b245938..8221c65 100644 --- a/include/GEnergies.hpp +++ b/include/GEnergies.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GEnergies.hpp - Energy container class * * ----------------------------------------------------------------------- * - * copyright (C) 2013-2015 by Juergen Knoedlseder * + * copyright (C) 2013-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -35,6 +35,9 @@ #include "GFits.hpp" #include "GFitsTable.hpp" +/* __ Forward declarations _______________________________________________ */ +class GFilename; + /***********************************************************************//** * @class GEnergies @@ -43,13 +46,17 @@ * * This class is a container for energies. Energies are implemented by the * GEnergy class which stores energies in a unit independent way. + * + * An energy container can be constructed from a FITS file or by defining + * a number of energies within a given interval, spaced either linearly or + * logarithmically. ***************************************************************************/ class GEnergies : public GContainer { public: // Constructors and destructors GEnergies(void); - explicit GEnergies(const std::string& filename); + explicit GEnergies(const GFilename& filename); GEnergies(const GEnergies& energies); GEnergies(const int& num, const GEnergy& emin, const GEnergy& emax, const bool& log = true); @@ -77,9 +84,9 @@ public: const GEnergy& emax); void set_log(const int& num, const GEnergy& emin, const GEnergy& emax); - void load(const std::string& filename); - void save(const std::string& filename, - const bool& clobber = false) const; + void load(const GFilename& filename); + void save(const GFilename& filename, + const bool& clobber = false) const; void read(const GFitsTable& table); void write(GFits& file, const std::string& extname = "ENERGIES") const; diff --git a/include/GEventCube.hpp b/include/GEventCube.hpp index 63550d8..9e35b25 100644 --- a/include/GEventCube.hpp +++ b/include/GEventCube.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GEventCube.hpp - Abstract event bin container class * * ----------------------------------------------------------------------- * - * copyright (C) 2009-2014 by Juergen Knoedlseder * + * copyright (C) 2009-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -32,6 +32,9 @@ #include "GEvents.hpp" #include "GEventBin.hpp" +/* __ Forward declarations _______________________________________________ */ +class GFilename; + /***********************************************************************//** * @class GEventCube @@ -60,9 +63,9 @@ public: virtual int size(void) const = 0; virtual int dim(void) const = 0; virtual int naxis(const int& axis) const = 0; - virtual void load(const std::string& filename) = 0; - virtual void save(const std::string& filename, - const bool& clobber = false) const = 0; + virtual void load(const GFilename& filename) = 0; + virtual void save(const GFilename& filename, + const bool& clobber = false) const = 0; virtual void read(const GFits& file) = 0; virtual void write(GFits& file) const = 0; virtual int number(void) const = 0; diff --git a/include/GEventList.hpp b/include/GEventList.hpp index a1d94c4..7688efc 100644 --- a/include/GEventList.hpp +++ b/include/GEventList.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GEventList.hpp - Abstract event atom container class * * ----------------------------------------------------------------------- * - * copyright (C) 2009-2014 by Juergen Knoedlseder * + * copyright (C) 2009-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -31,6 +31,9 @@ #include "GEvents.hpp" #include "GEventAtom.hpp" +/* __ Forward declarations _______________________________________________ */ +class GFilename; + /***********************************************************************//** * @class GEventList @@ -61,9 +64,9 @@ public: virtual GEventList* clone(void) const = 0; virtual std::string classname(void) const = 0; virtual int size(void) const = 0; - virtual void load(const std::string& filename) = 0; - virtual void save(const std::string& filename, - const bool& clobber = false) const = 0; + virtual void load(const GFilename& filename) = 0; + virtual void save(const GFilename& filename, + const bool& clobber = false) const = 0; virtual void read(const GFits& file) = 0; virtual void write(GFits& file) const = 0; virtual int number(void) const = 0; diff --git a/include/GEvents.hpp b/include/GEvents.hpp index 0c3b9fb..8349b24 100644 --- a/include/GEvents.hpp +++ b/include/GEvents.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GEvents.hpp - Abstract event container class * * ----------------------------------------------------------------------- * - * copyright (C) 2009-2014 by Juergen Knoedlseder * + * copyright (C) 2009-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -36,6 +36,9 @@ #include "GGti.hpp" #include "GRoi.hpp" +/* __ Forward declarations _______________________________________________ */ +class GFilename; + /***********************************************************************//** * @class GEvents @@ -78,9 +81,9 @@ public: virtual GEvents* clone(void) const = 0; virtual std::string classname(void) const = 0; virtual int size(void) const = 0; - virtual void load(const std::string& filename) = 0; - virtual void save(const std::string& filename, - const bool& clobber = false) const = 0; + virtual void load(const GFilename& filename) = 0; + virtual void save(const GFilename& filename, + const bool& clobber = false) const = 0; virtual void read(const GFits& file) = 0; virtual void write(GFits& file) const = 0; virtual int number(void) const = 0; @@ -107,7 +110,6 @@ protected: // Protected members GEbounds m_ebounds; //!< Energy boundaries covered by events GGti m_gti; //!< Good time intervals covered by events - }; diff --git a/inst/com/include/GCOMEventCube.hpp b/inst/com/include/GCOMEventCube.hpp index d770fb8..bf2adfc 100644 --- a/inst/com/include/GCOMEventCube.hpp +++ b/inst/com/include/GCOMEventCube.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GCOMEventCube.hpp - COMPTEL event bin container class * * ----------------------------------------------------------------------- * - * copyright (C) 2012-2015 by Juergen Knoedlseder * + * copyright (C) 2012-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -35,11 +35,14 @@ #include "GCOMInstDir.hpp" #include "GSkyDir.hpp" #include "GSkyMap.hpp" -#include "GEbounds.hpp" -#include "GGti.hpp" #include "GEnergy.hpp" #include "GTime.hpp" +/* __ Forward declarations _______________________________________________ */ +class GFilename; +class GEbounds; +class GGti; + /***********************************************************************//** * @class GCOMEventCube @@ -53,7 +56,7 @@ class GCOMEventCube : public GEventCube { public: // Constructors and destructors GCOMEventCube(void); - explicit GCOMEventCube(const std::string& filename); + explicit GCOMEventCube(const GFilename& filename); explicit GCOMEventCube(const GSkyMap& map, const GEbounds& ebds, const GGti& gti, const double& phimin, const double& dphi); @@ -72,9 +75,9 @@ public: virtual int size(void) const; virtual int dim(void) const; virtual int naxis(const int& axis) const; - virtual void load(const std::string& filename); - virtual void save(const std::string& filename, - const bool& clobber = false) const; + virtual void load(const GFilename& filename); + virtual void save(const GFilename& filename, + const bool& clobber = false) const; virtual void read(const GFits& file); virtual void write(GFits& file) const; virtual int number(void) const; @@ -83,11 +86,11 @@ public: // Other methods void map(const GSkyMap& map, const double& phimin, const double& dphi); - const GSkyMap& map(void) const { return m_map; } - int nchi(void) const { return m_map.nx(); } - int npsi(void) const { return m_map.ny(); } - int nphi(void) const { return m_map.nmaps(); } - int npix(void) const { return m_map.npix(); } + const GSkyMap& map(void) const; + int nchi(void) const; + int npsi(void) const; + int nphi(void) const; + int npix(void) const; protected: // Protected methods @@ -127,4 +130,64 @@ std::string GCOMEventCube::classname(void) const return ("GCOMEventCube"); } + +/***********************************************************************//** + * @brief Return event cube sky map + * + * @return Sky map containing event cube. + ***************************************************************************/ +inline +const GSkyMap& GCOMEventCube::map(void) const +{ + return (m_map); +} + + +/***********************************************************************//** + * @brief Return number of Chi bins + * + * @return Number of Chi bins. + ***************************************************************************/ +inline +int GCOMEventCube::nchi(void) const +{ + return (m_map.nx()); +} + + +/***********************************************************************//** + * @brief Return number of Psi bins + * + * @return Number of Psi bins. + ***************************************************************************/ +inline +int GCOMEventCube::npsi(void) const +{ + return (m_map.ny()); +} + + +/***********************************************************************//** + * @brief Return number of Phibar bins + * + * @return Number of Phibar bins. + ***************************************************************************/ +inline +int GCOMEventCube::nphi(void) const +{ + return (m_map.nmaps()); +} + + +/***********************************************************************//** + * @brief Return number of pixels + * + * @return Number of pixels. + ***************************************************************************/ +inline +int GCOMEventCube::npix(void) const +{ + return (m_map.npix()); +} + #endif /* GCOMEVENTCUBE_HPP */ diff --git a/inst/com/pyext/GCOMEventCube.i b/inst/com/pyext/GCOMEventCube.i index 183dd49..a8ea20f 100644 --- a/inst/com/pyext/GCOMEventCube.i +++ b/inst/com/pyext/GCOMEventCube.i @@ -1,7 +1,7 @@ /*************************************************************************** * GCOMEventCube.i - COMPTEL event bin container class * * ----------------------------------------------------------------------- * - * copyright (C) 2012-2015 by Juergen Knoedlseder * + * copyright (C) 2012-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -21,7 +21,7 @@ /** * @file GCOMEventCube.hpp * @brief COMPTEL event bin container class interface definition - * @author J. Knoedlseder + * @author Juergen Knoedlseder */ %{ /* Put headers and other declarations here that are needed for compilation */ @@ -38,7 +38,7 @@ class GCOMEventCube : public GEventCube { public: // Constructors and destructors GCOMEventCube(void); - explicit GCOMEventCube(const std::string& filename); + explicit GCOMEventCube(const GFilename& filename); explicit GCOMEventCube(const GSkyMap& map, const GEbounds& ebds, const GGti& gti, const double& phimin, const double& dphi); @@ -52,9 +52,9 @@ public: virtual int size(void) const; virtual int dim(void) const; virtual int naxis(const int& axis) const; - virtual void load(const std::string& filename); - virtual void save(const std::string& filename, - const bool& clobber = false) const; + virtual void load(const GFilename& filename); + virtual void save(const GFilename& filename, + const bool& clobber = false) const; virtual void read(const GFits& file); virtual void write(GFits& file) const; virtual int number(void) const; diff --git a/inst/com/src/GCOMEventCube.cpp b/inst/com/src/GCOMEventCube.cpp index 414cd95..2dfb356 100644 --- a/inst/com/src/GCOMEventCube.cpp +++ b/inst/com/src/GCOMEventCube.cpp @@ -31,6 +31,7 @@ #include "GException.hpp" #include "GTools.hpp" #include "GFits.hpp" +#include "GFilename.hpp" #include "GCOMSupport.hpp" #include "GCOMEventCube.hpp" @@ -77,7 +78,7 @@ GCOMEventCube::GCOMEventCube(void) : GEventCube() * * Construct an event cube by loading information from a FITS file. ***************************************************************************/ -GCOMEventCube::GCOMEventCube(const std::string& filename) : GEventCube() +GCOMEventCube::GCOMEventCube(const GFilename& filename) : GEventCube() { // Initialise members init_members(); @@ -362,13 +363,13 @@ int GCOMEventCube::naxis(const int& axis) const * The method clears the object before loading, thus any events residing in * the object before loading will be lost. ***************************************************************************/ -void GCOMEventCube::load(const std::string& filename) +void GCOMEventCube::load(const GFilename& filename) { // Clear object clear(); // Open DRE FITS file - GFits file(filename); + GFits file(filename.filename()); // Load DRE cube read(file); @@ -389,7 +390,7 @@ void GCOMEventCube::load(const std::string& filename) * * Save the COMPTEL event cube into FITS file. ***************************************************************************/ -void GCOMEventCube::save(const std::string& filename, const bool& clobber) const +void GCOMEventCube::save(const GFilename& filename, const bool& clobber) const { // Create empty FITS file GFits fits; @@ -398,7 +399,7 @@ void GCOMEventCube::save(const std::string& filename, const bool& clobber) const write(fits); // Save FITS file - fits.saveto(filename, clobber); + fits.saveto(filename.filename(), clobber); // Return return; diff --git a/inst/cta/include/GCTAEventCube.hpp b/inst/cta/include/GCTAEventCube.hpp index b8eacc1..80f7922 100644 --- a/inst/cta/include/GCTAEventCube.hpp +++ b/inst/cta/include/GCTAEventCube.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GCTAEventCube.hpp - CTA event bin container class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2015 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -41,6 +41,9 @@ #include "GFitsTable.hpp" #include "GFitsImage.hpp" +/* __ Forward declarations _______________________________________________ */ +class GFilename; + /***********************************************************************//** * @class GCTAEventCube @@ -54,7 +57,7 @@ class GCTAEventCube : public GEventCube { public: // Constructors and destructors GCTAEventCube(void); - explicit GCTAEventCube(const std::string& filename); + explicit GCTAEventCube(const GFilename& filename); GCTAEventCube(const GSkyMap& map, const GEbounds& ebds, const GGti& gti); GCTAEventCube(const GCTAEventCube& cube); virtual ~GCTAEventCube(void); @@ -71,9 +74,9 @@ public: virtual int size(void) const; virtual int dim(void) const; virtual int naxis(const int& axis) const; - virtual void load(const std::string& filename); - virtual void save(const std::string& filename, - const bool& clobber = false) const; + virtual void load(const GFilename& filename); + virtual void save(const GFilename& filename, + const bool& clobber = false) const; virtual void read(const GFits& file); virtual void write(GFits& file) const; virtual int number(void) const; diff --git a/inst/cta/include/GCTAEventList.hpp b/inst/cta/include/GCTAEventList.hpp index ada4613..4e28911 100644 --- a/inst/cta/include/GCTAEventList.hpp +++ b/inst/cta/include/GCTAEventList.hpp @@ -36,6 +36,7 @@ #include "GCTARoi.hpp" /* __ Forward declarations _______________________________________________ */ +class GFilename; class GFitsHDU; class GFitsTable; class GFitsBinTable; @@ -53,7 +54,7 @@ class GCTAEventList : public GEventList { public: // Constructors and destructors GCTAEventList(void); - explicit GCTAEventList(const std::string& filename); + explicit GCTAEventList(const GFilename& filename); GCTAEventList(const GCTAEventList& list); virtual ~GCTAEventList(void); @@ -67,9 +68,9 @@ public: virtual GCTAEventList* clone(void) const; virtual std::string classname(void) const; virtual int size(void) const; - virtual void load(const std::string& filename); - virtual void save(const std::string& filename, - const bool& clobber = false) const; + virtual void load(const GFilename& filename); + virtual void save(const GFilename& filename, + const bool& clobber = false) const; virtual void read(const GFits& fits); virtual void write(GFits& fits) const; virtual int number(void) const; diff --git a/inst/cta/pyext/GCTAEventCube.i b/inst/cta/pyext/GCTAEventCube.i index c8f8065..536b590 100644 --- a/inst/cta/pyext/GCTAEventCube.i +++ b/inst/cta/pyext/GCTAEventCube.i @@ -1,7 +1,7 @@ /*************************************************************************** * GCTAEventCube.i - CTA event bin container class * * ----------------------------------------------------------------------- * - * copyright (C) 2011-2015 by Juergen Knoedlseder * + * copyright (C) 2011-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -38,7 +38,7 @@ class GCTAEventCube : public GEventCube { public: // Constructors and destructors GCTAEventCube(void); - explicit GCTAEventCube(const std::string& filename); + explicit GCTAEventCube(const GFilename& filename); GCTAEventCube(const GSkyMap& map, const GEbounds& ebds, const GGti& gti); GCTAEventCube(const GCTAEventCube& cube); virtual ~GCTAEventCube(void); @@ -50,9 +50,9 @@ public: virtual int size(void) const; virtual int dim(void) const; virtual int naxis(const int& axis) const; - virtual void load(const std::string& filename); - virtual void save(const std::string& filename, - const bool& clobber = false) const; + virtual void load(const GFilename& filename); + virtual void save(const GFilename& filename, + const bool& clobber = false) const; virtual void read(const GFits& file); virtual void write(GFits& file) const; virtual int number(void) const; diff --git a/inst/cta/pyext/GCTAEventList.i b/inst/cta/pyext/GCTAEventList.i index cf650dc..007249d 100644 --- a/inst/cta/pyext/GCTAEventList.i +++ b/inst/cta/pyext/GCTAEventList.i @@ -39,7 +39,7 @@ class GCTAEventList : public GEventList { public: // Constructors and destructors GCTAEventList(void); - explicit GCTAEventList(const std::string& filename); + explicit GCTAEventList(const GFilename& filename); GCTAEventList(const GCTAEventList& list); virtual ~GCTAEventList(void); @@ -48,9 +48,9 @@ public: virtual GCTAEventList* clone(void) const; virtual std::string classname(void) const; virtual int size(void) const; - virtual void load(const std::string& filename); - virtual void save(const std::string& filename, - const bool& clobber = false) const; + virtual void load(const GFilename& filename); + virtual void save(const GFilename& filename, + const bool& clobber = false) const; virtual void read(const GFits& fits); virtual void write(GFits& fits) const; virtual int number(void) const; diff --git a/inst/cta/src/GCTAEventCube.cpp b/inst/cta/src/GCTAEventCube.cpp index 1b3c7c4..901db08 100644 --- a/inst/cta/src/GCTAEventCube.cpp +++ b/inst/cta/src/GCTAEventCube.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GCTAEventCube.cpp - CTA event bin container class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2015 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -75,7 +75,7 @@ GCTAEventCube::GCTAEventCube(void) : GEventCube() * * Construct instance of events cube a counts cube file. ***************************************************************************/ -GCTAEventCube::GCTAEventCube(const std::string& filename) : GEventCube() +GCTAEventCube::GCTAEventCube(const GFilename& filename) : GEventCube() { // Initialise members init_members(); @@ -321,13 +321,13 @@ int GCTAEventCube::naxis(const int& axis) const * The method clears the object before loading, thus any events residing in * the object before loading will be lost. ***************************************************************************/ -void GCTAEventCube::load(const std::string& filename) +void GCTAEventCube::load(const GFilename& filename) { // Clear object clear(); // Open counts map FITS file - GFits fits(filename); + GFits fits(filename.filename()); // Load counts map read(fits); @@ -348,8 +348,8 @@ void GCTAEventCube::load(const std::string& filename) * * Save the CTA event cube into FITS file. ***************************************************************************/ -void GCTAEventCube::save(const std::string& filename, - const bool& clobber) const +void GCTAEventCube::save(const GFilename& filename, + const bool& clobber) const { // Create empty FITS file GFits fits; @@ -358,7 +358,7 @@ void GCTAEventCube::save(const std::string& filename, write(fits); // Save FITS file - fits.saveto(filename, clobber); + fits.saveto(filename.filename(), clobber); // Return return; diff --git a/inst/cta/src/GCTAEventList.cpp b/inst/cta/src/GCTAEventList.cpp index acf1d50..f64afe4 100644 --- a/inst/cta/src/GCTAEventList.cpp +++ b/inst/cta/src/GCTAEventList.cpp @@ -83,7 +83,7 @@ GCTAEventList::GCTAEventList(void) : GEventList() * * Constructs event list by loading the events from a FITS file. ***************************************************************************/ -GCTAEventList::GCTAEventList(const std::string& filename) : GEventList() +GCTAEventList::GCTAEventList(const GFilename& filename) : GEventList() { // Initialise members init_members(); @@ -276,10 +276,10 @@ GCTAEventList* GCTAEventList::clone(void) const * * Loads the event list from a FITS file. See the read() method for details. ***************************************************************************/ -void GCTAEventList::load(const std::string& filename) +void GCTAEventList::load(const GFilename& filename) { // Open FITS file - GFits fits(filename); + GFits fits(filename.filename()); // Read event list read(fits); @@ -300,11 +300,11 @@ void GCTAEventList::load(const std::string& filename) * * Saves the event list into a FITS file. See the write() method for details. ***************************************************************************/ -void GCTAEventList::save(const std::string& filename, - const bool& clobber) const +void GCTAEventList::save(const GFilename& filename, + const bool& clobber) const { // Open or create FITS file - GFits fits(filename, true); + GFits fits(filename.filename(), true); // Write event list write(fits); diff --git a/inst/lat/include/GLATEventCube.hpp b/inst/lat/include/GLATEventCube.hpp index ffe3389..feecfe1 100644 --- a/inst/lat/include/GLATEventCube.hpp +++ b/inst/lat/include/GLATEventCube.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GLATEventCube.hpp - Fermi/LAT event cube class * * ----------------------------------------------------------------------- * - * copyright (C) 2009-2015 by Juergen Knoedlseder * + * copyright (C) 2009-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -41,6 +41,9 @@ #include "GSkyMap.hpp" #include "GNodeArray.hpp" +/* __ Forward declarations _______________________________________________ */ +class GFilename; + /***********************************************************************//** * @class GLATEventCube @@ -52,7 +55,7 @@ class GLATEventCube : public GEventCube { public: // Constructors and destructors GLATEventCube(void); - explicit GLATEventCube(const std::string& filename); + explicit GLATEventCube(const GFilename& filename); GLATEventCube(const GLATEventCube& cube); virtual ~GLATEventCube(void); @@ -68,9 +71,9 @@ public: virtual int size(void) const; virtual int dim(void) const; virtual int naxis(const int& axis) const; - virtual void load(const std::string& filename); - virtual void save(const std::string& filename, - const bool& clobber = false) const; + virtual void load(const GFilename& filename); + virtual void save(const GFilename& filename, + const bool& clobber = false) const; virtual void read(const GFits& file); virtual void write(GFits& file) const; virtual int number(void) const; diff --git a/inst/lat/include/GLATEventList.hpp b/inst/lat/include/GLATEventList.hpp index 9e2611a..bdc0af4 100644 --- a/inst/lat/include/GLATEventList.hpp +++ b/inst/lat/include/GLATEventList.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GLATEventList.hpp - Fermi/LAT event list class * * ----------------------------------------------------------------------- * - * copyright (C) 2009-2015 by Juergen Knoedlseder * + * copyright (C) 2009-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -37,6 +37,9 @@ #include "GFitsHDU.hpp" #include "GFitsTable.hpp" +/* __ Forward declarations _______________________________________________ */ +class GFilename; + /***********************************************************************//** * @class GLATEventList @@ -48,7 +51,7 @@ class GLATEventList : public GEventList { public: // Constructors and destructors GLATEventList(void); - explicit GLATEventList(const std::string& filename); + explicit GLATEventList(const GFilename& filename); GLATEventList(const GLATEventList& list); virtual ~GLATEventList(void); @@ -62,9 +65,9 @@ public: virtual GLATEventList* clone(void) const; virtual std::string classname(void) const; virtual int size(void) const; - virtual void load(const std::string& filename); - virtual void save(const std::string& filename, - const bool& clobber = false) const; + virtual void load(const GFilename& filename); + virtual void save(const GFilename& filename, + const bool& clobber = false) const; virtual void read(const GFits& file); virtual void write(GFits& file) const; virtual int number(void) const; diff --git a/inst/lat/pyext/GLATEventCube.i b/inst/lat/pyext/GLATEventCube.i index b8f60db..2eb3de9 100644 --- a/inst/lat/pyext/GLATEventCube.i +++ b/inst/lat/pyext/GLATEventCube.i @@ -1,7 +1,7 @@ /*************************************************************************** * GLATEventCube.i - Fermi/LAT event cube class * * ----------------------------------------------------------------------- * - * copyright (C) 2008-2015 by Juergen Knoedlseder * + * copyright (C) 2008-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -39,7 +39,7 @@ class GLATEventCube : public GEventCube { public: // Constructors and destructors GLATEventCube(void); - explicit GLATEventCube(const std::string& filename); + explicit GLATEventCube(const GFilename& filename); GLATEventCube(const GLATEventCube& cube); virtual ~GLATEventCube(void); @@ -50,9 +50,9 @@ public: virtual int size(void) const; virtual int dim(void) const; virtual int naxis(const int& axis) const; - virtual void load(const std::string& filename); - virtual void save(const std::string& filename, - const bool& clobber = false) const; + virtual void load(const GFilename& filename); + virtual void save(const GFilename& filename, + const bool& clobber = false) const; virtual void read(const GFits& file); virtual void write(GFits& file) const; virtual int number(void) const; diff --git a/inst/lat/pyext/GLATEventList.i b/inst/lat/pyext/GLATEventList.i index 69f262f..2769026 100644 --- a/inst/lat/pyext/GLATEventList.i +++ b/inst/lat/pyext/GLATEventList.i @@ -1,7 +1,7 @@ /*************************************************************************** * GLATEventList.i - Fermi/LAT event list class * * ----------------------------------------------------------------------- * - * copyright (C) 2012-2015 by Juergen Knoedlseder * + * copyright (C) 2012-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -39,7 +39,7 @@ class GLATEventList : public GEventList { public: // Constructors and destructors GLATEventList(void); - explicit GLATEventList(const std::string& filename); + explicit GLATEventList(const GFilename& filename); GLATEventList(const GLATEventList& list); virtual ~GLATEventList(void); @@ -48,9 +48,9 @@ public: virtual GLATEventList* clone(void) const; virtual std::string classname(void) const; virtual int size(void) const; - virtual void load(const std::string& filename); - virtual void save(const std::string& filename, - const bool& clobber = false) const; + virtual void load(const GFilename& filename); + virtual void save(const GFilename& filename, + const bool& clobber = false) const; virtual void read(const GFits& file); virtual void write(GFits& file) const; virtual int number(void) const; diff --git a/inst/lat/src/GLATEventCube.cpp b/inst/lat/src/GLATEventCube.cpp index 3c06d2d..6114dd3 100644 --- a/inst/lat/src/GLATEventCube.cpp +++ b/inst/lat/src/GLATEventCube.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GLATEventCube.cpp - Fermi/LAT event cube class * * ----------------------------------------------------------------------- * - * copyright (C) 2009-2015 by Juergen Knoedlseder * + * copyright (C) 2009-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -28,11 +28,12 @@ #ifdef HAVE_CONFIG_H #include #endif -#include "GLATEventCube.hpp" -#include "GLATException.hpp" #include "GTools.hpp" +#include "GFilename.hpp" #include "GFitsImage.hpp" #include "GFitsTable.hpp" +#include "GLATEventCube.hpp" +#include "GLATException.hpp" /* __ Method name definitions ____________________________________________ */ #define G_NAXIS "GLATEventCube::naxis(int)" @@ -77,7 +78,7 @@ GLATEventCube::GLATEventCube(void) : GEventCube() * * Construct event cube object by loading the events from a FITS file. ***************************************************************************/ -GLATEventCube::GLATEventCube(const std::string& filename) : GEventCube() +GLATEventCube::GLATEventCube(const GFilename& filename) : GEventCube() { // Initialise members init_members(); @@ -306,13 +307,13 @@ int GLATEventCube::naxis(const int& axis) const * * @param[in] filename FITS file name. ***************************************************************************/ -void GLATEventCube::load(const std::string& filename) +void GLATEventCube::load(const GFilename& filename) { // Clear object clear(); // Open FITS file - GFits file(filename); + GFits file(filename.filename()); // Read counts map read(file); @@ -329,12 +330,12 @@ void GLATEventCube::load(const std::string& filename) * @brief Save LAT event cube into FITS file * * @param[in] filename FITS file name. - * @param[in] clobber Overwrite existing FITS file? (default=false) + * @param[in] clobber Overwrite existing FITS file? (default: false) * * Save the LAT event cube into FITS file. ***************************************************************************/ -void GLATEventCube::save(const std::string& filename, - const bool& clobber) const +void GLATEventCube::save(const GFilename& filename, + const bool& clobber) const { // Create empty FITS file GFits fits; @@ -343,7 +344,7 @@ void GLATEventCube::save(const std::string& filename, write(fits); // Save FITS file - fits.saveto(filename, clobber); + fits.saveto(filename.filename(), clobber); // Return return; diff --git a/inst/lat/src/GLATEventList.cpp b/inst/lat/src/GLATEventList.cpp index 84f5698..44c90b8 100644 --- a/inst/lat/src/GLATEventList.cpp +++ b/inst/lat/src/GLATEventList.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GLATEventList.cpp - Fermi/LAT event list class * * ----------------------------------------------------------------------- * - * copyright (C) 2009-2015 by Juergen Knoedlseder * + * copyright (C) 2009-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -31,13 +31,14 @@ #include // std::sprintf #include "GException.hpp" #include "GTools.hpp" -#include "GLATEventList.hpp" -#include "GLATException.hpp" +#include "GFilename.hpp" #include "GFitsTable.hpp" #include "GFitsTableFloatCol.hpp" #include "GFitsTableDoubleCol.hpp" #include "GFitsTableLongCol.hpp" #include "GFitsTableShortCol.hpp" +#include "GLATEventList.hpp" +#include "GLATException.hpp" /* __ Method name definitions ____________________________________________ */ #define G_OPERATOR "GLATEventList::operator[](int&)" @@ -76,7 +77,7 @@ GLATEventList::GLATEventList(void) : GEventList() * * Construct event list object by loading the events from a FITS file. ***************************************************************************/ -GLATEventList::GLATEventList(const std::string& filename) : GEventList() +GLATEventList::GLATEventList(const GFilename& filename) : GEventList() { // Initialise members init_members(); @@ -248,13 +249,13 @@ GLATEventList* GLATEventList::clone(void) const * * This method loads LAT events from a FT1 file. ***************************************************************************/ -void GLATEventList::load(const std::string& filename) +void GLATEventList::load(const GFilename& filename) { // Clear object clear(); // Open FITS file - GFits file(filename); + GFits file(filename.filename()); // Read event list read(file); @@ -277,8 +278,8 @@ void GLATEventList::load(const std::string& filename) * * @todo To be implemented. ***************************************************************************/ -void GLATEventList::save(const std::string& filename, - const bool& clobber) const +void GLATEventList::save(const GFilename& filename, + const bool& clobber) const { // Return return; diff --git a/inst/mwl/include/GMWLSpectrum.hpp b/inst/mwl/include/GMWLSpectrum.hpp index 1eb84f6..72480e4 100644 --- a/inst/mwl/include/GMWLSpectrum.hpp +++ b/inst/mwl/include/GMWLSpectrum.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GMWLSpectrum.hpp - Multi-wavelength spectrum class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2015 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -34,6 +34,9 @@ #include "GFitsTable.hpp" #include "GEnergy.hpp" +/* __ Forward declarations _______________________________________________ */ +class GFilename; + /***********************************************************************//** * @class GMWLSpectrum @@ -49,7 +52,7 @@ class GMWLSpectrum : public GEventCube { public: // Constructors and destructors GMWLSpectrum(void); - explicit GMWLSpectrum(const std::string& filename); + explicit GMWLSpectrum(const GFilename& filename); GMWLSpectrum(const GMWLSpectrum& spec); virtual ~GMWLSpectrum(void); @@ -65,9 +68,9 @@ public: virtual int size(void) const; virtual int dim(void) const; virtual int naxis(const int& axis) const; - virtual void load(const std::string& filename); - virtual void save(const std::string& filename, - const bool& clobber = false) const; + virtual void load(const GFilename& filename); + virtual void save(const GFilename& filename, + const bool& clobber = false) const; virtual void read(const GFits& file); virtual void write(GFits& file) const; virtual int number(void) const; diff --git a/inst/mwl/pyext/GMWLSpectrum.i b/inst/mwl/pyext/GMWLSpectrum.i index d93e09e..fae38fe 100644 --- a/inst/mwl/pyext/GMWLSpectrum.i +++ b/inst/mwl/pyext/GMWLSpectrum.i @@ -1,7 +1,7 @@ /*************************************************************************** * GMWLSpectrum.i - Multi-wavelength spectrum class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2015 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -38,7 +38,7 @@ class GMWLSpectrum : public GEventCube { public: // Constructors and destructors GMWLSpectrum(void); - explicit GMWLSpectrum(const std::string& filename); + explicit GMWLSpectrum(const GFilename& filename); GMWLSpectrum(const GMWLSpectrum& spec); virtual ~GMWLSpectrum(void); @@ -49,9 +49,9 @@ public: virtual int size(void) const; virtual int dim(void) const; virtual int naxis(const int& axis) const; - virtual void load(const std::string& filename); - virtual void save(const std::string& filename, - const bool& clobber = false) const; + virtual void load(const GFilename& filename); + virtual void save(const GFilename& filename, + const bool& clobber = false) const; virtual void read(const GFits& file); virtual void write(GFits& file) const; virtual int number(void) const; diff --git a/inst/mwl/src/GMWLSpectrum.cpp b/inst/mwl/src/GMWLSpectrum.cpp index f2b4395..b419a9c 100644 --- a/inst/mwl/src/GMWLSpectrum.cpp +++ b/inst/mwl/src/GMWLSpectrum.cpp @@ -81,7 +81,7 @@ GMWLSpectrum::GMWLSpectrum(void) : GEventCube() * * Creates instance from file. ***************************************************************************/ -GMWLSpectrum::GMWLSpectrum(const std::string& filename) : GEventCube() +GMWLSpectrum::GMWLSpectrum(const GFilename& filename) : GEventCube() { // Initialise members init_members(); @@ -258,23 +258,20 @@ GMWLSpectrum* GMWLSpectrum::clone(void) const * * @todo So far only FITS file support is implemented. ***************************************************************************/ -void GMWLSpectrum::load(const std::string& filename) +void GMWLSpectrum::load(const GFilename& filename) { - // Create file name - GFilename fname(filename); - // Clear object clear(); // Open FITS file - GFits file(fname.filename()); + GFits file(filename.filename()); // Read spectrum - if (fname.has_extno()) { - read(file, fname.extno()); + if (filename.has_extno()) { + read(file, filename.extno()); } - else if (fname.has_extname()) { - read(file, fname.extname()); + else if (filename.has_extname()) { + read(file, filename.extname()); } else { read(file); @@ -296,8 +293,8 @@ void GMWLSpectrum::load(const std::string& filename) * * @todo To be implemented. ***************************************************************************/ -void GMWLSpectrum::save(const std::string& filename, - const bool& clobber) const +void GMWLSpectrum::save(const GFilename& filename, + const bool& clobber) const { // Return return; diff --git a/pyext/GEnergies.i b/pyext/GEnergies.i index 44378a3..14bf6ed 100644 --- a/pyext/GEnergies.i +++ b/pyext/GEnergies.i @@ -1,7 +1,7 @@ /*************************************************************************** * GEnergies.i - Energy container class * * ----------------------------------------------------------------------- * - * copyright (C) 2013-2015 by Juergen Knoedlseder * + * copyright (C) 2013-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -41,7 +41,7 @@ class GEnergies : public GContainer { public: // Constructors and destructors GEnergies(void); - explicit GEnergies(const std::string& filename); + explicit GEnergies(const GFilename& filename); GEnergies(const GEnergies& energies); GEnergies(const int& num, const GEnergy& emin, const GEnergy& emax, const bool& log = true); @@ -63,9 +63,9 @@ public: const GEnergy& emax); void set_log(const int& num, const GEnergy& emin, const GEnergy& emax); - void load(const std::string& filename); - void save(const std::string& filename, - const bool& clobber = false) const; + void load(const GFilename& filename); + void save(const GFilename& filename, + const bool& clobber = false) const; void read(const GFitsTable& table); void write(GFits& file, const std::string& extname = "ENERGIES") const; diff --git a/pyext/GEventCube.i b/pyext/GEventCube.i index 71050cd..caf65a9 100644 --- a/pyext/GEventCube.i +++ b/pyext/GEventCube.i @@ -1,7 +1,7 @@ /*************************************************************************** * GEventCube.i - Abstract event bin container class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2015 by Jurgen Knodlseder * + * copyright (C) 2010-2016 by Jurgen Knodlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -48,9 +48,9 @@ public: virtual int size(void) const = 0; virtual int dim(void) const = 0; virtual int naxis(const int& axis) const = 0; - virtual void load(const std::string& filename) = 0; - virtual void save(const std::string& filename, - const bool& clobber = false) const = 0; + virtual void load(const GFilename& filename) = 0; + virtual void save(const GFilename& filename, + const bool& clobber = false) const = 0; virtual void read(const GFits& file) = 0; virtual void write(GFits& file) const = 0; virtual int number(void) const = 0; diff --git a/pyext/GEventList.i b/pyext/GEventList.i index 6f704f3..d2b0ddf 100644 --- a/pyext/GEventList.i +++ b/pyext/GEventList.i @@ -1,7 +1,7 @@ /*************************************************************************** * GEventList.i - Abstract event atom container class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2015 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -46,9 +46,9 @@ public: virtual GEventList* clone(void) const = 0; virtual std::string classname(void) const = 0; virtual int size(void) const = 0; - virtual void load(const std::string& filename) = 0; - virtual void save(const std::string& filename, - const bool& clobber = false) const = 0; + virtual void load(const GFilename& filename) = 0; + virtual void save(const GFilename& filename, + const bool& clobber = false) const = 0; virtual void read(const GFits& file) = 0; virtual void write(GFits& file) const = 0; virtual int number(void) const = 0; diff --git a/pyext/GEvents.i b/pyext/GEvents.i index 33960b8..813f14c 100644 --- a/pyext/GEvents.i +++ b/pyext/GEvents.i @@ -1,7 +1,7 @@ /*************************************************************************** * GEvents.i - Abstract event container class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2015 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -50,9 +50,9 @@ public: virtual GEvents* clone(void) const = 0; virtual std::string classname(void) const = 0; virtual int size(void) const = 0; - virtual void load(const std::string& filename) = 0; - virtual void save(const std::string& filename, - const bool& clobber = false) const = 0; + virtual void load(const GFilename& filename) = 0; + virtual void save(const GFilename& filename, + const bool& clobber = false) const = 0; virtual void read(const GFits& file) = 0; virtual void write(GFits& file) const = 0; virtual int number(void) const = 0; diff --git a/src/obs/GEnergies.cpp b/src/obs/GEnergies.cpp index bb29869..9f6a4a7 100644 --- a/src/obs/GEnergies.cpp +++ b/src/obs/GEnergies.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GEnergies.cpp - Energy container class * * ----------------------------------------------------------------------- * - * copyright (C) 2013-2015 by Juergen Knoedlseder * + * copyright (C) 2013-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -60,6 +60,8 @@ /***********************************************************************//** * @brief Void constructor + * + * Constructs empty energy container. ***************************************************************************/ GEnergies::GEnergies(void) { @@ -78,7 +80,7 @@ GEnergies::GEnergies(void) * * Constructs energy container from a FITS file. ***************************************************************************/ -GEnergies::GEnergies(const std::string& filename) +GEnergies::GEnergies(const GFilename& filename) { // Initialise members init_members(); @@ -95,6 +97,8 @@ GEnergies::GEnergies(const std::string& filename) * @brief Copy constructor * * @param energies Energy container. + * + * Construct energy container by copying from another energy container. ***************************************************************************/ GEnergies::GEnergies(const GEnergies& energies) { @@ -193,7 +197,7 @@ GEnergies& GEnergies::operator=(const GEnergies& energies) ==========================================================================*/ /***********************************************************************//** - * @brief Clear container + * @brief Clear energy container * * Removes all energies from the container. ***************************************************************************/ @@ -211,7 +215,7 @@ void GEnergies::clear(void) /***********************************************************************//** - * @brief Clone instance + * @brief Clone energy container * * @return Pointer to deep copy of energy container * @@ -541,19 +545,16 @@ void GEnergies::set_log(const int& num, * If no extension name is provided, the energies are loaded from the * "ENERGIES" extension. ***************************************************************************/ -void GEnergies::load(const std::string& filename) +void GEnergies::load(const GFilename& filename) { - // Create file name - GFilename fname(filename); - // Allocate FITS file GFits file; // Open FITS file - file.open(fname.filename()); + file.open(filename.filename()); // Get energies table - const GFitsTable& table = *file.table(fname.extname("ENERGIES")); + const GFitsTable& table = *file.table(filename.extname("ENERGIES")); // Read energies from table read(table); @@ -577,19 +578,16 @@ void GEnergies::load(const std::string& filename) * If no extension name is provided, the energies are saved into an * "ENERGIES" extension. ***************************************************************************/ -void GEnergies::save(const std::string& filename, const bool& clobber) const +void GEnergies::save(const GFilename& filename, const bool& clobber) const { - // Create file name - GFilename fname(filename); - // Allocate FITS file GFits file; // Write energies to FITS file - write(file, fname.extname("ENERGIES")); + write(file, filename.extname("ENERGIES")); // Save to file - file.saveto(fname.filename(), clobber); + file.saveto(filename.filename(), clobber); // Return return; diff --git a/test/testinst/GTestEventCube.hpp b/test/testinst/GTestEventCube.hpp index 6aada4b..af6ebce 100644 --- a/test/testinst/GTestEventCube.hpp +++ b/test/testinst/GTestEventCube.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GTestEventCube.hpp - Test event bin container class * * ----------------------------------------------------------------------- * - * copyright (C) 2013-2015 by Jean-Baptiste Cayrou * + * copyright (C) 2013-2016 by Jean-Baptiste Cayrou * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -40,6 +40,9 @@ #include "GFitsTable.hpp" #include "GFitsImage.hpp" +/* __ Forward declarations _______________________________________________ */ +class GFilename; + /***********************************************************************//** * @class GTestEventCube @@ -97,16 +100,16 @@ public: } virtual GTestEventCube* clone(void) const { return new GTestEventCube(*this);} virtual std::string classname(void) const { return "GTestEventCube"; } - virtual int size(void) const { return m_bins.size(); } - virtual int dim(void) const { return 1; } - virtual int naxis(const int& axis) const { return 1;} - virtual void load(const std::string& filename) { } - virtual void save(const std::string& filename, - const bool& clobber = false) const { } - virtual void read(const GFits& file) { } - virtual void write(GFits& file) const { } - virtual int number(void) const { return m_counts; } - virtual std::string print(const GChatter& chatter = NORMAL) const { + virtual int size(void) const { return m_bins.size(); } + virtual int dim(void) const { return 1; } + virtual int naxis(const int& axis) const { return 1;} + virtual void load(const GFilename& filename) { } + virtual void save(const GFilename& filename, + const bool& clobber = false) const { } + virtual void read(const GFits& file) { } + virtual void write(GFits& file) const { } + virtual int number(void) const { return m_counts; } + virtual std::string print(const GChatter& chatter = NORMAL) const { std::string result; result.append("=== GTestEventCube ==="); result.append("\n"+gammalib::parformat("Number of events")+gammalib::str(number())); diff --git a/test/testinst/GTestEventList.hpp b/test/testinst/GTestEventList.hpp index 33d01ae..f94f96c 100644 --- a/test/testinst/GTestEventList.hpp +++ b/test/testinst/GTestEventList.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GTestEventList.hpp - Test event atom container class * * ----------------------------------------------------------------------- * - * copyright (C) 2012-2014 by Jean-Baptiste Cayrou * + * copyright (C) 2012-2016 by Jean-Baptiste Cayrou * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -34,6 +34,9 @@ #include "GTestEventAtom.hpp" #include "GTestRoi.hpp" +/* __ Forward declarations _______________________________________________ */ +class GFilename; + /***********************************************************************//** * @class GTestEventList @@ -93,15 +96,15 @@ public: virtual GTestEventList* clone(void) const{ return new GTestEventList(*this); } - virtual std::string classname(void) const { return "GTestEventList"; } - virtual int size(void) const { return m_events.size(); } - virtual void load(const std::string& filename) {} - virtual void save(const std::string& filename, - const bool& clobber = false) const {} - virtual void read(const GFits& file) {} - virtual void write(GFits& file) const {} - virtual int number(void) const { return m_events.size(); } - virtual void roi(const GRoi& roi) { + virtual std::string classname(void) const { return "GTestEventList"; } + virtual int size(void) const { return m_events.size(); } + virtual void load(const GFilename& filename) {} + virtual void save(const GFilename& filename, + const bool& clobber = false) const {} + virtual void read(const GFits& file) {} + virtual void write(GFits& file) const {} + virtual int number(void) const { return m_events.size(); } + virtual void roi(const GRoi& roi) { const GTestRoi* ptr = dynamic_cast(&roi); if (ptr == NULL) { throw;