diff --git a/include/GLATObservation.hpp b/include/GLATObservation.hpp index c2022dc..cc69b01 100644 --- a/include/GLATObservation.hpp +++ b/include/GLATObservation.hpp @@ -21,6 +21,7 @@ /* __ Includes ___________________________________________________________ */ #include "GObservation.hpp" +#include "GFits.hpp" /* __ Namespaces _________________________________________________________ */ @@ -35,24 +36,30 @@ class GLATObservation : public GObservation { public: // Constructors and destructors GLATObservation(); + GLATObservation(const std::string& ft1name, const std::string& ft2name); GLATObservation(const GLATObservation& obs); virtual ~GLATObservation(); // Operators - virtual GLATObservation& operator= (const GLATObservation& obs); + GLATObservation& operator= (const GLATObservation& obs); // Methods + GFits* ft1(void) const; + GFits* ft2(void) const; protected: // Protected methods - void init_members(void); - void copy_members(const GLATObservation& obs); - void free_members(void); - virtual GLATObservation* clone(void) const; + void init_members(void); + void copy_members(const GLATObservation& obs); + void free_members(void); + GLATObservation* clone(void) const; // Protected data area private: + GFits* m_ft1; //!< FT1 FITS file + GFits* m_ft2; //!< FT2 FITS file + GFits* m_ltcube; //!< Lifetime cube FITS file }; #endif /* GLATOBSERVATION_HPP */ diff --git a/include/Makefile.am b/include/Makefile.am index 90f8df3..192b5e7 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -17,6 +17,7 @@ pkginclude_HEADERS = GammaLib.hpp \ GFitsAsciiTable.hpp \ GFitsBinTable.hpp \ GFitsTableCol.hpp \ + GFitsTableLogCol.hpp \ GFitsTableStrCol.hpp \ GFitsTableShtCol.hpp \ GFitsTableLngCol.hpp \ diff --git a/include/Makefile.in b/include/Makefile.in index 44a41fa..023ed14 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -123,6 +123,7 @@ pkginclude_HEADERS = GammaLib.hpp \ GFitsAsciiTable.hpp \ GFitsBinTable.hpp \ GFitsTableCol.hpp \ + GFitsTableLogCol.hpp \ GFitsTableStrCol.hpp \ GFitsTableShtCol.hpp \ GFitsTableLngCol.hpp \ diff --git a/pyext/GLATObservation.i b/pyext/GLATObservation.i new file mode 100644 index 0000000..1578790 --- /dev/null +++ b/pyext/GLATObservation.i @@ -0,0 +1,43 @@ +/*************************************************************************** + * GLATObservation.i - LAT Observation class SWIG interface * + * ----------------------------------------------------------------------- * + * copyright : (C) 2008 by Jurgen Knodlseder * + * ----------------------------------------------------------------------- * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/** + * @file GLATObservation.i + * @brief GLATObservation class SWIG file. + * @author J. Knodlseder + */ +%{ +/* Put headers and other declarations here that are needed for compilation */ +#include "GLATObservation.hpp" +%} +%include stl.i +%feature("notabstract") GLATObservation; +%import GObservation.i + +/***********************************************************************//** + * @class GLATObservation + * + * @brief Interface for the LAT observation classes. + ***************************************************************************/ +class GLATObservation : public GObservation { +public: + // Constructors and destructors + GLATObservation(); + GLATObservation(const std::string& ft1name, const std::string& ft2name); + GLATObservation(const GLATObservation& obs); + virtual ~GLATObservation(); + + // Methods + GFits* ft1(void) const; + GFits* ft2(void) const; +}; + diff --git a/src/Makefile.am b/src/Makefile.am index 89a2f70..be3e35a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -30,6 +30,7 @@ files = GException.cpp \ fits/GFitsAsciiTable.cpp \ fits/GFitsBinTable.cpp \ fits/GFitsTableCol.cpp \ + fits/GFitsTableLogCol.cpp \ fits/GFitsTableStrCol.cpp \ fits/GFitsTableShtCol.cpp \ fits/GFitsTableLngCol.cpp \ diff --git a/src/Makefile.in b/src/Makefile.in index 84889cb..b0d7e01 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -135,6 +135,7 @@ files = GException.cpp \ fits/GFitsAsciiTable.cpp \ fits/GFitsBinTable.cpp \ fits/GFitsTableCol.cpp \ + fits/GFitsTableLogCol.cpp \ fits/GFitsTableStrCol.cpp \ fits/GFitsTableShtCol.cpp \ fits/GFitsTableLngCol.cpp \ @@ -169,10 +170,11 @@ am__objects_1 = GException.lo GTools.lo GSkyDir.lo GNodeArray.lo \ GLATObservation.lo GFitsHeaderCard.lo GFitsHeader.lo \ GFitsData.lo GFitsImage.lo GFitsDblImage.lo GFitsTable.lo \ GFitsAsciiTable.lo GFitsBinTable.lo GFitsTableCol.lo \ - GFitsTableStrCol.lo GFitsTableShtCol.lo GFitsTableLngCol.lo \ - GFitsTableFltCol.lo GFitsTableDblCol.lo GFitsHDU.lo GFits.lo \ - GFitPar.lo GVector.lo GMatrixBase.lo GMatrix.lo GSymMatrix.lo \ - GSparseMatrix.lo GSparseSymbolic.lo GSparseNumeric.lo + GFitsTableLogCol.lo GFitsTableStrCol.lo GFitsTableShtCol.lo \ + GFitsTableLngCol.lo GFitsTableFltCol.lo GFitsTableDblCol.lo \ + GFitsHDU.lo GFits.lo GFitPar.lo GVector.lo GMatrixBase.lo \ + GMatrix.lo GSymMatrix.lo GSparseMatrix.lo GSparseSymbolic.lo \ + GSparseNumeric.lo am_libgamma_la_OBJECTS = $(am__objects_1) libgamma_la_OBJECTS = $(am_libgamma_la_OBJECTS) @@ -251,6 +253,7 @@ GFitsTable.lo: fits/GFitsTable.cpp GFitsAsciiTable.lo: fits/GFitsAsciiTable.cpp GFitsBinTable.lo: fits/GFitsBinTable.cpp GFitsTableCol.lo: fits/GFitsTableCol.cpp +GFitsTableLogCol.lo: fits/GFitsTableLogCol.cpp GFitsTableStrCol.lo: fits/GFitsTableStrCol.cpp GFitsTableShtCol.lo: fits/GFitsTableShtCol.cpp GFitsTableLngCol.lo: fits/GFitsTableLngCol.cpp @@ -446,6 +449,15 @@ GFitsTableCol.obj: fits/GFitsTableCol.cpp GFitsTableCol.lo: fits/GFitsTableCol.cpp $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GFitsTableCol.lo `test -f 'fits/GFitsTableCol.cpp' || echo '$(srcdir)/'`fits/GFitsTableCol.cpp +GFitsTableLogCol.o: fits/GFitsTableLogCol.cpp + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GFitsTableLogCol.o `test -f 'fits/GFitsTableLogCol.cpp' || echo '$(srcdir)/'`fits/GFitsTableLogCol.cpp + +GFitsTableLogCol.obj: fits/GFitsTableLogCol.cpp + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GFitsTableLogCol.obj `cygpath -w fits/GFitsTableLogCol.cpp` + +GFitsTableLogCol.lo: fits/GFitsTableLogCol.cpp + $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GFitsTableLogCol.lo `test -f 'fits/GFitsTableLogCol.cpp' || echo '$(srcdir)/'`fits/GFitsTableLogCol.cpp + GFitsTableStrCol.o: fits/GFitsTableStrCol.cpp $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GFitsTableStrCol.o `test -f 'fits/GFitsTableStrCol.cpp' || echo '$(srcdir)/'`fits/GFitsTableStrCol.cpp diff --git a/src/obs/GLATObservation.cpp b/src/obs/GLATObservation.cpp index 96b9cde..b3ed9cf 100644 --- a/src/obs/GLATObservation.cpp +++ b/src/obs/GLATObservation.cpp @@ -54,6 +54,31 @@ GLATObservation::GLATObservation() : GObservation() /***********************************************************************//** + * @brief Constructor + * + * @param[in] ft1name FT1 FITS filename. + * @param[in] ft2name FT2 FITS filename. + ***************************************************************************/ +GLATObservation::GLATObservation(const std::string& ft1name, + const std::string& ft2name) : GObservation() +{ + // Initialise class members for clean destruction + init_members(); + + // Allocate FT1 & FT2 FITS files + m_ft1 = new GFits; + m_ft2 = new GFits; + + // Open FT1 & FT2 FITS files + m_ft1->open(ft1name); + m_ft2->open(ft2name); + + // Return + return; +} + + +/***********************************************************************//** * @brief Copy constructor * * @param[in] obs Observation from which the instance should be built. @@ -125,6 +150,25 @@ GLATObservation& GLATObservation::operator= (const GLATObservation& obs) = = ==========================================================================*/ +/***********************************************************************//** + * @brief Return pointer to FT1 file. + ***************************************************************************/ +GFits* GLATObservation::ft1(void) const +{ + // Return FT1 pointer + return m_ft1; +} + + +/***********************************************************************//** + * @brief Return pointer to FT2 file. + ***************************************************************************/ +GFits* GLATObservation::ft2(void) const +{ + // Return FT2 pointer + return m_ft2; +} + /*========================================================================== = = @@ -138,6 +182,9 @@ GLATObservation& GLATObservation::operator= (const GLATObservation& obs) void GLATObservation::init_members(void) { // Initialise members + m_ft1 = NULL; + m_ft2 = NULL; + m_ltcube = NULL; // Return return; @@ -164,6 +211,14 @@ void GLATObservation::copy_members(const GLATObservation& obs) void GLATObservation::free_members(void) { // Free members + if (m_ft1 != NULL) delete m_ft1; + if (m_ft2 != NULL) delete m_ft2; + if (m_ltcube != NULL) delete m_ltcube; + + // Mark memory as free + m_ft1 = NULL; + m_ft2 = NULL; + m_ltcube = NULL; // Return return;