diff --git a/ChangeLog b/ChangeLog index 8716a24..fe65f4b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ * Version 0.11.0 released ========================= + Rename GSkymap to GSkyMap + Add binary operators to GSkymap class GSkymap::operator/=(GSkymap) operator now ignores division by zero Remove deadtime correction from GCTAModelCubeBackground (#1503) Add GCTAObservation::object() method diff --git a/NEWS b/NEWS index 2cee5e0..873f04c 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,9 @@ The GOptimizerLM logger constructor now takes a pointer to a logger instead of a reference. This allows setting of a NULL pointer, disabling the logging of the optimizer. +The GSkymap class has been renamed to GSkyMap to be consistent with the other +classes in the sky module. + 3. Configuration ----------------- @@ -100,6 +103,8 @@ This quite severe bug was now corrected. The GSkymap::operator/=(GSkymap) operator now sets all pixels to zero for which the nominator is zero. No exception is thrown any longer. +Add +, -, * and / binary operators to the GSkymap class. + 13. Support module ------------------ diff --git a/doc/dev/inst/gammalib_inst.tex b/doc/dev/inst/gammalib_inst.tex index 3c09474..d884c10 100644 --- a/doc/dev/inst/gammalib_inst.tex +++ b/doc/dev/inst/gammalib_inst.tex @@ -546,7 +546,7 @@ T_{\rm disp}(t' | \vec{d}, \vec{p}, E, t) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsubsection{Sky maps} -\label{sec:GSkymap} +\label{sec:GSkyMap} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/doc/dev/sdd/gammalib_sdd.tex b/doc/dev/sdd/gammalib_sdd.tex index e70f6d5..3ae162c 100644 --- a/doc/dev/sdd/gammalib_sdd.tex +++ b/doc/dev/sdd/gammalib_sdd.tex @@ -85,16 +85,16 @@ A Python interface allows scripting of library components. \subsection{Skymaps} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\subsubsection{{\tt GSkymap}} +\subsubsection{{\tt GSkyMap}} -The {\tt GSkymap} class holds a single skymap (or a set of skymaps with identical coordinates) +The {\tt GSkyMap} class holds a single skymap (or a set of skymaps with identical coordinates) in a specific world coordinate projection (see {\tt GWcs}). Three different constructors exist: \begin{verbatim} - GSkymap(void); - GSkymap(std::string wcs, std::string coordsys, int nside, std::string ordering, + GSkyMap(void); + GSkyMap(std::string wcs, std::string coordsys, int nside, std::string ordering, int nmaps = 1); - GSkymap(std::string wcs, std::string coordsys, GSkyDir dir, int nlon, int nlat, + GSkyMap(std::string wcs, std::string coordsys, GSkyDir dir, int nlon, int nlat, double dlon, double dlat, int nmaps = 1); \end{verbatim} The first one creates an instance of an empty skymap. @@ -124,7 +124,7 @@ Two coordinate systems are implemented ({\tt coordsys}): {\tt GAL} indicates the galactic system (galactic longitude and latitude), and {\tt CEL} indicates equatorial or celestial system (Right Ascension and declination). -The following methods are defined for {\tt GSkymap}: +The following methods are defined for {\tt GSkyMap}: \begin{verbatim} void read(std::string filename); //!< Read skymap from FITS file void read(const GFitsHDU* hdu); //!< Read skymap from FITS HDU @@ -146,7 +146,7 @@ The following methods are defined for {\tt GSkymap}: void smooth_gaussian(double sigma); //!< Smooth skymap using Gaussian kernel \end{verbatim} -The {\tt GSkymap} class contains: +The {\tt GSkyMap} class contains: \begin{verbatim} GWcs* m_wcs; //!< Pointer to World Coordinate System projection double* m_pixels; //!< Pointer to sky map pixels diff --git a/doc/source/howto/sky.rst b/doc/source/howto/sky.rst index c42afdd..90cc081 100644 --- a/doc/source/howto/sky.rst +++ b/doc/source/howto/sky.rst @@ -14,8 +14,8 @@ Python: .. code-block:: python >>> import gammalib - >>> healpix = gammalib.GSkymap("healpix.fits") - >>> map = gammalib.GSkymap("CAR","GAL",0.0,0.0,0.5,0.5,100,100) + >>> healpix = gammalib.GSkyMap("healpix.fits") + >>> map = gammalib.GSkyMap("CAR","GAL",0.0,0.0,0.5,0.5,100,100) >>> map += healpix >>> map.save("carmap.fits") @@ -24,8 +24,8 @@ C++: .. code-block:: cpp #include "GammaLib.hpp" - GSkymap healpix("healpix.fits"); - GSkymap map("CAR","GAL",0.0,0.0,0.5,0.5,100,100); + GSkyMap healpix("healpix.fits"); + GSkyMap map("CAR","GAL",0.0,0.0,0.5,0.5,100,100); map += healpix; map.save("carmap.fits"); \ No newline at end of file diff --git a/doc/source/user_manual/modules/cta_overview.rst b/doc/source/user_manual/modules/cta_overview.rst index 0891c4e..8868c1d 100644 --- a/doc/source/user_manual/modules/cta_overview.rst +++ b/doc/source/user_manual/modules/cta_overview.rst @@ -37,7 +37,7 @@ collected by the :doxy:`GObservations` container class). The data of binned observations are stored by the :doxy:`GCTAEventCube` class. The :doxy:`GCTAEventCube` class holds the binned event data in form of a sky map, implemented by the -:doxy:`GSkymap` class. The sky coordinates of all sky map pixels +:doxy:`GSkyMap` class. The sky coordinates of all sky map pixels are stored in an array of CTA instrument directions, implemented by the :doxy:`GCTAInstDir` class which holds a single :doxy:`GSkyDir` object. The mean energies of the event cube diff --git a/doc/source/user_manual/modules/sky.rst b/doc/source/user_manual/modules/sky.rst index fb789f6..1b1619b 100644 --- a/doc/source/user_manual/modules/sky.rst +++ b/doc/source/user_manual/modules/sky.rst @@ -19,9 +19,9 @@ module and their relations. The sky module provides classes to handle sky maps, sky coordinates and sky regions. -Sky maps are implemented by the :doxy:`GSkymap` class which stores +Sky maps are implemented by the :doxy:`GSkyMap` class which stores intensities for a defined grid of sky coordinates. -A :doxy:`GSkymap` object may hold several sky maps with identical +A :doxy:`GSkyMap` object may hold several sky maps with identical pixelisation, for example to represent the energy-dependence of the sky intensities. The relation between sky coordinates and pixel coordinates is diff --git a/doc/source/user_manual/modules/uml_sky.png b/doc/source/user_manual/modules/uml_sky.png index 57ab810..e4dc990 100644 --- a/doc/source/user_manual/modules/uml_sky.png +++ b/doc/source/user_manual/modules/uml_sky.png diff --git a/examples/cpp/createskymap/createskymap.cpp b/examples/cpp/createskymap/createskymap.cpp index 327a203..90a25be 100644 --- a/examples/cpp/createskymap/createskymap.cpp +++ b/examples/cpp/createskymap/createskymap.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * createskymap.cpp - Create sky map * * ----------------------------------------------------------------------- * - * copyright (C) 2013 by Juergen Knoedlseder * + * copyright (C) 2013-2015 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -49,7 +49,7 @@ int main(void) { double dec(0.0); double binsz(0.01); int npix(300); - GSkymap image("CAR", "CEL", ra, dec, -binsz, binsz, npix, npix, 1); + GSkyMap image("CAR", "CEL", ra, dec, -binsz, binsz, npix, npix, 1); // Fill the sky map with the model image GEnergy energy; // Dummy (not relevant as model is not energy dependent) diff --git a/examples/python/example_radial_models.py b/examples/python/example_radial_models.py index 6483b23..c4155b8 100755 --- a/examples/python/example_radial_models.py +++ b/examples/python/example_radial_models.py @@ -3,7 +3,7 @@ # This script makes an image from a radial model and verifies that the # model is correctly normalized. # -# Copyright (C) 2011-2013 Juergen Knoedlseder +# Copyright (C) 2011-2015 Juergen Knoedlseder # # 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 @@ -30,7 +30,7 @@ def test_radial_model(name, model, clobber=True): """ # Make a 2D FITS image (cartesian projection, celestial coordinates) ra, dec, binsz, npix = 0, 0, 0.01, 300 - image = gammalib.GSkymap("CAR", "CEL", ra, dec, -binsz, binsz, npix, npix, 1) + image = gammalib.GSkyMap("CAR", "CEL", ra, dec, -binsz, binsz, npix, npix, 1) # Fill the image energy = gammalib.GEnergy() diff --git a/include/GException.hpp b/include/GException.hpp index 173e89e..7e3372c 100644 --- a/include/GException.hpp +++ b/include/GException.hpp @@ -398,7 +398,7 @@ public: }; - // GSkymap exceptions + // GSkyMap exceptions class skymap : public GExceptionHandler { public: skymap(std::string origin, std::string message = ""); diff --git a/include/GModelSpatialDiffuseCube.hpp b/include/GModelSpatialDiffuseCube.hpp index 1778502..3ff1f06 100644 --- a/include/GModelSpatialDiffuseCube.hpp +++ b/include/GModelSpatialDiffuseCube.hpp @@ -34,7 +34,7 @@ #include "GModelSpectralNodes.hpp" #include "GModelPar.hpp" #include "GSkyDir.hpp" -#include "GSkymap.hpp" +#include "GSkyMap.hpp" #include "GNodeArray.hpp" #include "GXmlElement.hpp" #include "GEbounds.hpp" @@ -59,7 +59,7 @@ public: explicit GModelSpatialDiffuseCube(const GXmlElement& xml); GModelSpatialDiffuseCube(const std::string& filename, const double& value = 1.0); - GModelSpatialDiffuseCube(const GSkymap& cube, + GModelSpatialDiffuseCube(const GSkyMap& cube, const GEnergies& energies, const double& value = 1.0); GModelSpatialDiffuseCube(const GModelSpatialDiffuseCube& model); @@ -94,8 +94,8 @@ public: void value(const double& value); const std::string& filename(void) const; void filename(const std::string& filename); - const GSkymap& cube(void) const; - void cube(const GSkymap& cube); + const GSkyMap& cube(void) const; + void cube(const GSkyMap& cube); GEnergies energies(void); void energies(const GEnergies& energies); const GModelSpectralNodes& spectrum(void) const; @@ -116,7 +116,7 @@ protected: GModelPar m_value; //!< Value std::string m_filename; //!< Name of map cube bool m_loaded; //!< Signals if map cube has been loaded - GSkymap m_cube; //!< Map cube + GSkyMap m_cube; //!< Map cube GNodeArray m_logE; //!< Log10(energy) values of the maps GEbounds m_ebounds; //!< Energy bounds of the maps std::vector m_mc_cache; //!< Monte Carlo cache @@ -247,7 +247,7 @@ void GModelSpatialDiffuseCube::filename(const std::string& filename) * Returns the map cube. ***************************************************************************/ inline -const GSkymap& GModelSpatialDiffuseCube::cube(void) const +const GSkyMap& GModelSpatialDiffuseCube::cube(void) const { return (m_cube); } @@ -261,7 +261,7 @@ const GSkymap& GModelSpatialDiffuseCube::cube(void) const * Set the map cube of the spatial map cube model. ***************************************************************************/ inline -void GModelSpatialDiffuseCube::cube(const GSkymap& cube) +void GModelSpatialDiffuseCube::cube(const GSkyMap& cube) { m_filename.clear(); m_loaded = false; diff --git a/include/GModelSpatialDiffuseMap.hpp b/include/GModelSpatialDiffuseMap.hpp index 76a88dd..def822e 100644 --- a/include/GModelSpatialDiffuseMap.hpp +++ b/include/GModelSpatialDiffuseMap.hpp @@ -33,7 +33,7 @@ #include "GModelSpatialDiffuse.hpp" #include "GModelPar.hpp" #include "GSkyDir.hpp" -#include "GSkymap.hpp" +#include "GSkyMap.hpp" #include "GXmlElement.hpp" @@ -54,7 +54,7 @@ public: GModelSpatialDiffuseMap(const std::string& filename, const double& value = 1.0, const bool& normalize = true); - GModelSpatialDiffuseMap(const GSkymap& map, + GModelSpatialDiffuseMap(const GSkyMap& map, const double& value = 1.0, const bool& normalize = true); GModelSpatialDiffuseMap(const GModelSpatialDiffuseMap& model); @@ -86,8 +86,8 @@ public: void value(const double& value); const std::string& filename(void) const; void load(const std::string& filename); - const GSkymap& map(void) const; - void map(const GSkymap& map); + const GSkyMap& map(void) const; + void map(const GSkyMap& map); bool normalize(void) const; protected: @@ -99,7 +99,7 @@ protected: // Protected members GModelPar m_value; //!< Value - GSkymap m_map; //!< Skymap + GSkyMap m_map; //!< Skymap std::string m_filename; //!< Name of skymap std::vector m_mc_cache; //!< Monte Carlo cache std::vector m_mc_max; //!< Monte Carlo maximum @@ -188,7 +188,7 @@ const std::string& GModelSpatialDiffuseMap::filename(void) const * Returns the sky map. ***************************************************************************/ inline -const GSkymap& GModelSpatialDiffuseMap::map(void) const +const GSkyMap& GModelSpatialDiffuseMap::map(void) const { return (m_map); } @@ -202,7 +202,7 @@ const GSkymap& GModelSpatialDiffuseMap::map(void) const * Set the sky map. ***************************************************************************/ inline -void GModelSpatialDiffuseMap::map(const GSkymap& map) +void GModelSpatialDiffuseMap::map(const GSkyMap& map) { m_map = map; prepare_map(); diff --git a/include/GSkymap.hpp b/include/GSkyMap.hpp index 7fe2915..c5a9218 100644 --- a/include/GSkymap.hpp +++ b/include/GSkyMap.hpp @@ -1,5 +1,5 @@ /*************************************************************************** - * GSkymap.hpp - Sky map class * + * GSkyMap.hpp - Sky map class * * ----------------------------------------------------------------------- * * copyright (C) 2010-2015 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * @@ -19,7 +19,7 @@ * * ***************************************************************************/ /** - * @file GSkymap.hpp + * @file GSkyMap.hpp * @brief Sky map class definition * @author Juergen Knoedlseder */ @@ -44,7 +44,7 @@ /***********************************************************************//** - * @class GSkymap + * @class GSkyMap * * @brief Sky map class * @@ -77,19 +77,19 @@ * GSkyPixel pixel = map.dir2pix(dir); // Sky direction to pixel * ***************************************************************************/ -class GSkymap : public GBase { +class GSkyMap : public GBase { - friend GSkymap sqrt(const GSkymap& map); + friend GSkyMap sqrt(const GSkyMap& map); public: // Constructors and destructors - GSkymap(void); - explicit GSkymap(const std::string& filename); - explicit GSkymap(const std::string& coords, + GSkyMap(void); + explicit GSkyMap(const std::string& filename); + explicit GSkyMap(const std::string& coords, const int& nside, const std::string& order, const int& nmaps = 1); - explicit GSkymap(const std::string& wcs, + explicit GSkyMap(const std::string& wcs, const std::string& coords, const double& x, const double& y, @@ -98,24 +98,24 @@ public: const int& nx, const int& ny, const int& nmaps = 1); - GSkymap(const GSkymap& map); - virtual ~GSkymap(void); + GSkyMap(const GSkyMap& map); + virtual ~GSkyMap(void); // Operators - GSkymap& operator=(const GSkymap& map); - GSkymap& operator=(const double& value); - GSkymap& operator+=(const GSkymap& map); - GSkymap& operator+=(const double& value); - GSkymap& operator-=(const GSkymap& map); - GSkymap& operator-=(const double& value); - GSkymap& operator*=(const GSkymap& map); - GSkymap& operator*=(const double& factor); - GSkymap& operator/=(const GSkymap& map); - GSkymap& operator/=(const double& factor); - GSkymap operator+(const GSkymap& map) const; - GSkymap operator-(const GSkymap& map) const; - GSkymap operator*(const GSkymap& map) const; - GSkymap operator/(const GSkymap& map) const; + GSkyMap& operator=(const GSkyMap& map); + GSkyMap& operator=(const double& value); + GSkyMap& operator+=(const GSkyMap& map); + GSkyMap& operator+=(const double& value); + GSkyMap& operator-=(const GSkyMap& map); + GSkyMap& operator-=(const double& value); + GSkyMap& operator*=(const GSkyMap& map); + GSkyMap& operator*=(const double& factor); + GSkyMap& operator/=(const GSkyMap& map); + GSkyMap& operator/=(const double& factor); + GSkyMap operator+(const GSkyMap& map) const; + GSkyMap operator-(const GSkyMap& map) const; + GSkyMap operator*(const GSkyMap& map) const; + GSkyMap operator/(const GSkyMap& map) const; double& operator()(const int& index, const int& map = 0); const double& operator()(const int& index, const int& map = 0) const; double& operator()(const GSkyPixel& pixel, const int& map = 0); @@ -124,7 +124,7 @@ public: // Methods void clear(void); - GSkymap* clone(void) const; + GSkyMap* clone(void) const; std::string classname(void) const; const int& npix(void) const; const int& nx(void) const; @@ -146,7 +146,7 @@ public: const GSkyProjection* projection(void) const; void projection(const GSkyProjection& proj); const double* pixels(void) const; - GSkymap extract(const int& map, const int& nmaps = 1) const; + GSkyMap extract(const int& map, const int& nmaps = 1) const; void stack_maps(void); void load(const std::string& filename); void save(const std::string& filename, bool clobber = false) const; @@ -158,7 +158,7 @@ private: // Private methods void init_members(void); void alloc_pixels(void); - void copy_members(const GSkymap& map); + void copy_members(const GSkyMap& map); void free_members(void); void set_wcs(const std::string& wcs, const std::string& coords, const double& crval1, const double& crval2, @@ -200,9 +200,9 @@ private: * Returns the sum of two sky maps. ***************************************************************************/ inline -GSkymap GSkymap::operator+(const GSkymap& map) const +GSkyMap GSkyMap::operator+(const GSkyMap& map) const { - GSkymap result = *this; + GSkyMap result = *this; result += map; return result; } @@ -217,9 +217,9 @@ GSkymap GSkymap::operator+(const GSkymap& map) const * Returns the difference of two sky maps. ***************************************************************************/ inline -GSkymap GSkymap::operator-(const GSkymap& map) const +GSkyMap GSkyMap::operator-(const GSkyMap& map) const { - GSkymap result = *this; + GSkyMap result = *this; result -= map; return result; } @@ -234,9 +234,9 @@ GSkymap GSkymap::operator-(const GSkymap& map) const * Returns the product of two sky maps. ***************************************************************************/ inline -GSkymap GSkymap::operator*(const GSkymap& map) const +GSkyMap GSkyMap::operator*(const GSkyMap& map) const { - GSkymap result = *this; + GSkyMap result = *this; result *= map; return result; } @@ -251,9 +251,9 @@ GSkymap GSkymap::operator*(const GSkymap& map) const * Returns the ratio of two sky maps. ***************************************************************************/ inline -GSkymap GSkymap::operator/(const GSkymap& map) const +GSkyMap GSkyMap::operator/(const GSkyMap& map) const { - GSkymap result = *this; + GSkyMap result = *this; result /= map; return result; } @@ -262,12 +262,12 @@ GSkymap GSkymap::operator/(const GSkymap& map) const /***********************************************************************//** * @brief Return class name * - * @return String containing the class name ("GSkymap"). + * @return String containing the class name ("GSkyMap"). ***************************************************************************/ inline -std::string GSkymap::classname(void) const +std::string GSkyMap::classname(void) const { - return ("GSkymap"); + return ("GSkyMap"); } @@ -279,7 +279,7 @@ std::string GSkymap::classname(void) const * Returns the number of pixels in one sky map. ***************************************************************************/ inline -const int& GSkymap::npix(void) const +const int& GSkyMap::npix(void) const { return m_num_pixels; } @@ -295,7 +295,7 @@ const int& GSkymap::npix(void) const * the method returns 0. ***************************************************************************/ inline -const int& GSkymap::nx(void) const +const int& GSkyMap::nx(void) const { return m_num_x; } @@ -311,7 +311,7 @@ const int& GSkymap::nx(void) const * the method returns 0. ***************************************************************************/ inline -const int& GSkymap::ny(void) const +const int& GSkyMap::ny(void) const { return m_num_y; } @@ -323,7 +323,7 @@ const int& GSkymap::ny(void) const * @return Number of maps in the sky map object. ***************************************************************************/ inline -const int& GSkymap::nmaps(void) const +const int& GSkyMap::nmaps(void) const { return m_num_maps; } @@ -335,7 +335,7 @@ const int& GSkymap::nmaps(void) const * @return Pointer to sky projection (NULL if no projection is defined). ***************************************************************************/ inline -const GSkyProjection* GSkymap::projection(void) const +const GSkyProjection* GSkyMap::projection(void) const { return m_proj; } @@ -347,7 +347,7 @@ const GSkyProjection* GSkymap::projection(void) const * @return Pointer to pixel data. ***************************************************************************/ inline -const double* GSkymap::pixels(void) const +const double* GSkyMap::pixels(void) const { return m_pixels; } diff --git a/include/GammaLib.hpp b/include/GammaLib.hpp index bfaff73..9b92eb5 100644 --- a/include/GammaLib.hpp +++ b/include/GammaLib.hpp @@ -140,7 +140,7 @@ #include "GSkyDir.hpp" #include "GHorizDir.hpp" #include "GSkyPixel.hpp" -#include "GSkymap.hpp" +#include "GSkyMap.hpp" #include "GSkyRegions.hpp" #include "GSkyRegion.hpp" #include "GSkyRegionCircle.hpp" diff --git a/include/Makefile.am b/include/Makefile.am index 5e13a04..a227a79 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -81,7 +81,7 @@ pkginclude_HEADERS = GammaLib.hpp \ GSkyDir.hpp \ GHorizDir.hpp \ GSkyPixel.hpp \ - GSkymap.hpp \ + GSkyMap.hpp \ GSkyRegion.hpp \ GSkyRegions.hpp \ GSkyRegionCircle.hpp \ diff --git a/inst/com/include/GCOMEventCube.hpp b/inst/com/include/GCOMEventCube.hpp index f0b5e1b..d770fb8 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-2014 by Juergen Knoedlseder * + * copyright (C) 2012-2015 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -34,7 +34,7 @@ #include "GCOMEventBin.hpp" #include "GCOMInstDir.hpp" #include "GSkyDir.hpp" -#include "GSkymap.hpp" +#include "GSkyMap.hpp" #include "GEbounds.hpp" #include "GGti.hpp" #include "GEnergy.hpp" @@ -54,7 +54,7 @@ public: // Constructors and destructors GCOMEventCube(void); explicit GCOMEventCube(const std::string& filename); - explicit GCOMEventCube(const GSkymap& map, const GEbounds& ebds, + explicit GCOMEventCube(const GSkyMap& map, const GEbounds& ebds, const GGti& gti, const double& phimin, const double& dphi); GCOMEventCube(const GCOMEventCube& cube); @@ -81,9 +81,9 @@ public: virtual std::string print(const GChatter& chatter = NORMAL) const; // Other methods - void map(const GSkymap& map, const double& phimin, + void map(const GSkyMap& map, const double& phimin, const double& dphi); - const GSkymap& map(void) const { return m_map; } + 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(); } @@ -104,7 +104,7 @@ protected: // Protected members GCOMEventBin m_bin; //!< Actual event bin GCOMInstDir m_dir; //!< Actual event direction - GSkymap m_map; //!< Counts map stored as sky map + GSkyMap m_map; //!< Counts map stored as sky map GTime m_time; //!< Event cube mean time double m_ontime; //!< Event cube ontime (sec) GEnergy m_energy; //!< Event cube mean energy diff --git a/inst/com/include/GCOMObservation.hpp b/inst/com/include/GCOMObservation.hpp index 6da4500..5433c2f 100644 --- a/inst/com/include/GCOMObservation.hpp +++ b/inst/com/include/GCOMObservation.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GCOMObservation.hpp - COMPTEL observation class * * ----------------------------------------------------------------------- * - * copyright (C) 2012-2014 by Juergen Knoedlseder * + * copyright (C) 2012-2015 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -31,7 +31,7 @@ #include "GObservation.hpp" #include "GTime.hpp" #include "GModel.hpp" -#include "GSkymap.hpp" +#include "GSkyMap.hpp" #include "GCOMResponse.hpp" #include "GCaldb.hpp" @@ -87,9 +87,9 @@ public: void ewidth(const double& ewidth) { m_ewidth=ewidth; } const double& obs_id(void) const { return m_obs_id; } const double& ewidth(void) const { return m_ewidth; } - const GSkymap& drb(void) const { return m_drb; } - const GSkymap& drg(void) const { return m_drg; } - const GSkymap& drx(void) const { return m_drx; } + const GSkyMap& drb(void) const { return m_drb; } + const GSkyMap& drg(void) const { return m_drg; } + const GSkyMap& drx(void) const { return m_drx; } protected: // Protected methods @@ -100,7 +100,7 @@ protected: void load_drb(const std::string& drbname); void load_drg(const std::string& drgname); void load_drx(const std::string& drxname); - bool check_map(const GSkymap& map) const; + bool check_map(const GSkyMap& map) const; void read_attributes(const GFitsHDU* hdu); void write_attributes(GFitsHDU* hdu) const; @@ -110,9 +110,9 @@ protected: std::string m_drbname; //!< DRB filename std::string m_drgname; //!< DRG filename std::string m_drxname; //!< DRX filename - GSkymap m_drb; //!< Background model - GSkymap m_drg; //!< Geometry factors - GSkymap m_drx; //!< Exposure map + GSkyMap m_drb; //!< Background model + GSkyMap m_drg; //!< Geometry factors + GSkyMap m_drx; //!< Exposure map GSkyDir m_pointing; //!< Pointing direction GCOMResponse m_response; //!< Response functions double m_obs_id; //!< Observation ID diff --git a/inst/com/pyext/GCOMEventCube.i b/inst/com/pyext/GCOMEventCube.i index 3ea72bc..183dd49 100644 --- a/inst/com/pyext/GCOMEventCube.i +++ b/inst/com/pyext/GCOMEventCube.i @@ -39,7 +39,7 @@ public: // Constructors and destructors GCOMEventCube(void); explicit GCOMEventCube(const std::string& filename); - explicit GCOMEventCube(const GSkymap& map, const GEbounds& ebds, + explicit GCOMEventCube(const GSkyMap& map, const GEbounds& ebds, const GGti& gti, const double& phimin, const double& dphi); GCOMEventCube(const GCOMEventCube& cube); @@ -60,9 +60,9 @@ public: virtual int number(void) const; // Other methods - void map(const GSkymap& map, const double& phimin, + void map(const GSkyMap& map, const double& phimin, const double& dphi); - const GSkymap& map(void) const; + const GSkyMap& map(void) const; int nchi(void) const; int npsi(void) const; int nphi(void) const; diff --git a/inst/com/pyext/GCOMObservation.i b/inst/com/pyext/GCOMObservation.i index 90f8613..3688ce0 100644 --- a/inst/com/pyext/GCOMObservation.i +++ b/inst/com/pyext/GCOMObservation.i @@ -1,7 +1,7 @@ /*************************************************************************** * GCOMObservation.i - COMPTEL observation class * * ----------------------------------------------------------------------- * - * copyright (C) 2012-2014 by Juergen Knoedlseder * + * copyright (C) 2012-2015 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -71,9 +71,9 @@ public: void ewidth(const double& ewidth); const double& obs_id(void) const; const double& ewidth(void) const; - const GSkymap& drb(void) const; - const GSkymap& drg(void) const; - const GSkymap& drx(void) const; + const GSkyMap& drb(void) const; + const GSkyMap& drg(void) const; + const GSkyMap& drx(void) const; }; diff --git a/inst/com/src/GCOMEventCube.cpp b/inst/com/src/GCOMEventCube.cpp index 00d7719..b94a8b9 100644 --- a/inst/com/src/GCOMEventCube.cpp +++ b/inst/com/src/GCOMEventCube.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GCOMEventCube.cpp - COMPTEL event bin container class * * ----------------------------------------------------------------------- * - * copyright (C) 2012-2013 by Juergen Knoedlseder * + * copyright (C) 2012-2015 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -102,7 +102,7 @@ GCOMEventCube::GCOMEventCube(const std::string& filename) : GEventCube() * Construct an event cube from sky map, energy boundaries, Good Time * Intervals and the scatter angle minimum value and step size. ***************************************************************************/ -GCOMEventCube::GCOMEventCube(const GSkymap& map, const GEbounds& ebds, +GCOMEventCube::GCOMEventCube(const GSkyMap& map, const GEbounds& ebds, const GGti& gti, const double& phimin, const double& dphi) : GEventCube() { @@ -530,7 +530,7 @@ int GCOMEventCube::number(void) const * * @todo Check if we really need this method. ***************************************************************************/ -void GCOMEventCube::map(const GSkymap& map, const double& phimin, +void GCOMEventCube::map(const GSkyMap& map, const double& phimin, const double& dphi) { // Store sky map diff --git a/inst/com/src/GCOMObservation.cpp b/inst/com/src/GCOMObservation.cpp index 8d5e4aa..222f161 100644 --- a/inst/com/src/GCOMObservation.cpp +++ b/inst/com/src/GCOMObservation.cpp @@ -790,10 +790,10 @@ void GCOMObservation::load_drx(const std::string& drxname) * Compares the dimension and the WCS definition of a sky map to that of the * event cube. If both are identical, true is returned, false otherwise. ***************************************************************************/ -bool GCOMObservation::check_map(const GSkymap& map) const +bool GCOMObservation::check_map(const GSkyMap& map) const { // Get reference to event cube map - const GSkymap& ref = dynamic_cast(m_events)->map(); + const GSkyMap& ref = dynamic_cast(m_events)->map(); // Compare dimensions bool same_dimension = ((map.nx() == ref.nx()) && diff --git a/inst/com/src/GCOMSupport.cpp b/inst/com/src/GCOMSupport.cpp index ce48e5a..a6d7864 100644 --- a/inst/com/src/GCOMSupport.cpp +++ b/inst/com/src/GCOMSupport.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GCOMSupport.cpp - COMPTEL support functions * * ----------------------------------------------------------------------- * - * copyright (C) 2012 by Juergen Knoedlseder * + * copyright (C) 2012-2015 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -51,7 +51,7 @@ * Nothing is done for all other sky map. This method can thus be * transparently be applied to the sky maps read from COMPTEL data files. ***************************************************************************/ -void com_wcs_mer2car(GSkymap& map) +void com_wcs_mer2car(GSkyMap& map) { // Get WCS poiunter const GWcs* wcs = dynamic_cast(map.projection()); diff --git a/inst/com/src/GCOMSupport.hpp b/inst/com/src/GCOMSupport.hpp index 4840752..028d888 100644 --- a/inst/com/src/GCOMSupport.hpp +++ b/inst/com/src/GCOMSupport.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GCOMSupport.hpp - COMPTEL support functions * * ----------------------------------------------------------------------- * - * copyright (C) 2012 by Juergen Knoedlseder * + * copyright (C) 2012-2015 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -28,13 +28,13 @@ #define GCOMSUPPORT_HPP /* __ Includes ___________________________________________________________ */ -#include "GSkymap.hpp" +#include "GSkyMap.hpp" /* __ Namespaces _________________________________________________________ */ /* __ Constants __________________________________________________________ */ /* __ Prototypes _________________________________________________________ */ -void com_wcs_mer2car(GSkymap& map); +void com_wcs_mer2car(GSkyMap& map); #endif /* GCOMSUPPORT_HPP */ diff --git a/inst/cta/include/GCTACubeBackground.hpp b/inst/cta/include/GCTACubeBackground.hpp index a7270b1..85667de 100644 --- a/inst/cta/include/GCTACubeBackground.hpp +++ b/inst/cta/include/GCTACubeBackground.hpp @@ -29,7 +29,7 @@ /* __ Includes ___________________________________________________________ */ #include -#include "GSkymap.hpp" +#include "GSkyMap.hpp" #include "GNodeArray.hpp" #include "GEbounds.hpp" @@ -72,7 +72,7 @@ public: void load(const std::string& filename); void save(const std::string& filename, const bool& clobber = false) const; - const GSkymap& cube(void) const; + const GSkyMap& cube(void) const; const GEbounds& ebounds(void) const; const GNodeArray& elogmeans(void) const; const std::string& filename(void) const; @@ -88,7 +88,7 @@ private: // Members mutable std::string m_filename; //!< Name of background response file - GSkymap m_cube; //!< Background cube + GSkyMap m_cube; //!< Background cube GEbounds m_ebounds; //!< Energy bounds for the background cube GNodeArray m_elogmeans; //!< Mean energy for the background cube @@ -118,11 +118,11 @@ std::string GCTACubeBackground::classname(void) const * * @return Sky map holding the background cube. * - * Returns the GSkymap object that is used to store the background cube + * Returns the GSkyMap object that is used to store the background cube * information. ***************************************************************************/ inline -const GSkymap& GCTACubeBackground::cube(void) const +const GSkyMap& GCTACubeBackground::cube(void) const { return (m_cube); } diff --git a/inst/cta/include/GCTACubeExposure.hpp b/inst/cta/include/GCTACubeExposure.hpp index ab36efa..5db2171 100644 --- a/inst/cta/include/GCTACubeExposure.hpp +++ b/inst/cta/include/GCTACubeExposure.hpp @@ -31,7 +31,7 @@ #include #include "GBase.hpp" #include "GFits.hpp" -#include "GSkymap.hpp" +#include "GSkyMap.hpp" #include "GObservations.hpp" #include "GCTAObservation.hpp" #include "GCTAEventCube.hpp" @@ -75,7 +75,7 @@ public: std::string classname(void) const; void set(const GCTAObservation& obs); void fill(const GObservations& obs, GLog* log = NULL); - const GSkymap& cube(void) const; + const GSkyMap& cube(void) const; const GEbounds& ebounds(void) const; const GGti& gti(void) const; const GNodeArray& elogmeans(void) const; @@ -102,7 +102,7 @@ protected: // Members mutable std::string m_filename; //!< Filename - GSkymap m_cube; //!< Average Exposure cube + GSkyMap m_cube; //!< Average Exposure cube GEbounds m_ebounds; //!< Energy bounds for the Exposure cube GNodeArray m_elogmeans; //!< Mean energy for the Exposure cube GGti m_gti; //!< Good time interval for the Exposure cube @@ -136,11 +136,11 @@ std::string GCTACubeExposure::classname(void) const * * @return Exposure cube. * - * Returns the GSkymap object that is used to store the exposure cube + * Returns the GSkyMap object that is used to store the exposure cube * information. ***************************************************************************/ inline -const GSkymap& GCTACubeExposure::cube(void) const +const GSkyMap& GCTACubeExposure::cube(void) const { return (m_cube); } diff --git a/inst/cta/include/GCTACubePsf.hpp b/inst/cta/include/GCTACubePsf.hpp index 8fcc251..dc14c1a 100644 --- a/inst/cta/include/GCTACubePsf.hpp +++ b/inst/cta/include/GCTACubePsf.hpp @@ -31,7 +31,7 @@ #include #include "GBase.hpp" #include "GFits.hpp" -#include "GSkymap.hpp" +#include "GSkyMap.hpp" #include "GObservations.hpp" #include "GCTAObservation.hpp" #include "GNodeArray.hpp" @@ -83,7 +83,7 @@ public: std::string classname(void) const; void set(const GCTAObservation& obs); void fill(const GObservations& obs, GLog* log = NULL); - const GSkymap& map(void) const; + const GSkyMap& map(void) const; const GEbounds& ebounds(void) const; const GNodeArray& deltas(void) const; const GNodeArray& elogmeans(void) const; @@ -109,7 +109,7 @@ protected: // Data mutable std::string m_filename; //!< Filename - GSkymap m_cube; //!< PSF cube + GSkyMap m_cube; //!< PSF cube GEbounds m_ebounds; //!< Energy bounds for the PSF cube GNodeArray m_elogmeans; //!< Mean log10TeV energy for the PSF cube GNodeArray m_deltas; //!< Delta bins (deg) for the PSF cube @@ -151,7 +151,7 @@ std::string GCTACubePsf::classname(void) const * cube. ***************************************************************************/ inline -const GSkymap& GCTACubePsf::map(void) const +const GSkyMap& GCTACubePsf::map(void) const { return (m_cube); } diff --git a/inst/cta/include/GCTACubeSourceDiffuse.hpp b/inst/cta/include/GCTACubeSourceDiffuse.hpp index f62c97a..d2badba 100644 --- a/inst/cta/include/GCTACubeSourceDiffuse.hpp +++ b/inst/cta/include/GCTACubeSourceDiffuse.hpp @@ -31,7 +31,7 @@ #include #include #include "GCTACubeSource.hpp" -#include "GSkymap.hpp" +#include "GSkyMap.hpp" #include "GFunction.hpp" #include "GCTAResponseCube.hpp" @@ -92,7 +92,7 @@ protected: void free_members(void); // Data members - GSkymap m_cube; //!< Diffuse map convolved with IRF + GSkyMap m_cube; //!< Diffuse map convolved with IRF }; diff --git a/inst/cta/include/GCTAEventCube.hpp b/inst/cta/include/GCTAEventCube.hpp index 159f28a..b8eacc1 100644 --- a/inst/cta/include/GCTAEventCube.hpp +++ b/inst/cta/include/GCTAEventCube.hpp @@ -32,7 +32,7 @@ #include #include "GEventCube.hpp" #include "GCTAEventBin.hpp" -#include "GSkymap.hpp" +#include "GSkyMap.hpp" #include "GEbounds.hpp" #include "GGti.hpp" #include "GEnergy.hpp" @@ -55,7 +55,7 @@ public: // Constructors and destructors GCTAEventCube(void); explicit GCTAEventCube(const std::string& filename); - GCTAEventCube(const GSkymap& map, const GEbounds& ebds, const GGti& gti); + GCTAEventCube(const GSkyMap& map, const GEbounds& ebds, const GGti& gti); GCTAEventCube(const GCTAEventCube& cube); virtual ~GCTAEventCube(void); @@ -82,8 +82,8 @@ public: // Other methods const GTime& time(void) const; const GEnergy& energy(const int& index) const; - void map(const GSkymap& map); - const GSkymap& map(void) const; + void map(const GSkyMap& map); + const GSkyMap& map(void) const; int nx(void) const; int ny(void) const; int npix(void) const; @@ -103,7 +103,7 @@ protected: void set_bin(const int& index); // Protected members - GSkymap m_map; //!< Counts map stored as sky map + GSkyMap m_map; //!< Counts map stored as sky map GCTAEventBin m_bin; //!< Actual event bin GTime m_time; //!< Event cube mean time std::vector m_dirs; //!< Array of event directions @@ -149,7 +149,7 @@ int GCTAEventCube::dim(void) const * cube. ***************************************************************************/ inline -const GSkymap& GCTAEventCube::map(void) const +const GSkyMap& GCTAEventCube::map(void) const { return (m_map); } diff --git a/inst/cta/pyext/GCTACubeBackground.i b/inst/cta/pyext/GCTACubeBackground.i index 72e0a3b..27c0371 100644 --- a/inst/cta/pyext/GCTACubeBackground.i +++ b/inst/cta/pyext/GCTACubeBackground.i @@ -59,7 +59,7 @@ public: void load(const std::string& filename); void save(const std::string& filename, const bool& clobber = false) const; - const GSkymap& cube(void) const; + const GSkyMap& cube(void) const; const GEbounds& ebounds(void) const; const GNodeArray& elogmeans(void) const; const std::string& filename(void) const; diff --git a/inst/cta/pyext/GCTACubeExposure.i b/inst/cta/pyext/GCTACubeExposure.i index edbce61..5e7f28f 100644 --- a/inst/cta/pyext/GCTACubeExposure.i +++ b/inst/cta/pyext/GCTACubeExposure.i @@ -66,7 +66,7 @@ public: std::string classname(void) const; void set(const GCTAObservation& obs); void fill(const GObservations& obs, GLog* log = NULL); - const GSkymap& cube(void) const; + const GSkyMap& cube(void) const; const GEbounds& ebounds(void) const; const GGti& gti(void) const; const GNodeArray& elogmeans(void) const; diff --git a/inst/cta/pyext/GCTACubePsf.i b/inst/cta/pyext/GCTACubePsf.i index de64a18..5ed52ba 100644 --- a/inst/cta/pyext/GCTACubePsf.i +++ b/inst/cta/pyext/GCTACubePsf.i @@ -75,7 +75,7 @@ public: std::string classname(void) const; void set(const GCTAObservation& obs); void fill(const GObservations& obs, GLog* log = NULL); - const GSkymap& map(void) const; + const GSkyMap& map(void) const; const GEbounds& ebounds(void) const; const GNodeArray& deltas(void) const; const GNodeArray& elogmeans(void) const; diff --git a/inst/cta/pyext/GCTAEventCube.i b/inst/cta/pyext/GCTAEventCube.i index 9fd1e42..c8f8065 100644 --- a/inst/cta/pyext/GCTAEventCube.i +++ b/inst/cta/pyext/GCTAEventCube.i @@ -39,7 +39,7 @@ public: // Constructors and destructors GCTAEventCube(void); explicit GCTAEventCube(const std::string& filename); - GCTAEventCube(const GSkymap& map, const GEbounds& ebds, const GGti& gti); + GCTAEventCube(const GSkyMap& map, const GEbounds& ebds, const GGti& gti); GCTAEventCube(const GCTAEventCube& cube); virtual ~GCTAEventCube(void); @@ -58,8 +58,8 @@ public: virtual int number(void) const; // Other methods - void map(const GSkymap& map); - const GSkymap& map(void) const; + void map(const GSkyMap& map); + const GSkyMap& map(void) const; int nx(void) const; int ny(void) const; int npix(void) const; diff --git a/inst/cta/src/GCTACubeExposure.cpp b/inst/cta/src/GCTACubeExposure.cpp index a7b4d00..9df047e 100644 --- a/inst/cta/src/GCTACubeExposure.cpp +++ b/inst/cta/src/GCTACubeExposure.cpp @@ -175,7 +175,7 @@ GCTACubeExposure::GCTACubeExposure(const std::string& wcs, set_eng_axis(); // Create sky map - m_cube = GSkymap(wcs, coords, x, y, dx, dy, nx, ny, m_ebounds.size()); + m_cube = GSkyMap(wcs, coords, x, y, dx, dy, nx, ny, m_ebounds.size()); // Return return; diff --git a/inst/cta/src/GCTACubePsf.cpp b/inst/cta/src/GCTACubePsf.cpp index 3946915..44c5cf2 100644 --- a/inst/cta/src/GCTACubePsf.cpp +++ b/inst/cta/src/GCTACubePsf.cpp @@ -226,7 +226,7 @@ GCTACubePsf::GCTACubePsf(const std::string& wcs, int nmaps = m_ebounds.size() * m_deltas.size(); // Create sky map - m_cube = GSkymap(wcs, coords, x, y, dx, dy, nx, ny, nmaps); + m_cube = GSkyMap(wcs, coords, x, y, dx, dy, nx, ny, nmaps); // Return return; @@ -452,7 +452,7 @@ void GCTACubePsf::fill(const GObservations& obs, GLog* log) clear_cube(); // Initialise skymap for exposure weight accumulation - GSkymap exposure(m_cube); + GSkyMap exposure(m_cube); // Loop over all observations in container for (int i = 0; i < obs.size(); ++i) { diff --git a/inst/cta/src/GCTAEventCube.cpp b/inst/cta/src/GCTAEventCube.cpp index a20f13e..ccd01fd 100644 --- a/inst/cta/src/GCTAEventCube.cpp +++ b/inst/cta/src/GCTAEventCube.cpp @@ -98,7 +98,7 @@ GCTAEventCube::GCTAEventCube(const std::string& filename) : GEventCube() * Construct instance of events cube from sky map, energy boundaries and * Good Time Intervals. ***************************************************************************/ -GCTAEventCube::GCTAEventCube(const GSkymap& map, const GEbounds& ebds, +GCTAEventCube::GCTAEventCube(const GSkyMap& map, const GEbounds& ebds, const GGti& gti) : GEventCube() { // Initialise members @@ -448,7 +448,7 @@ int GCTAEventCube::number(void) const /***********************************************************************//** * @brief Set event cube from sky map ***************************************************************************/ -void GCTAEventCube::map(const GSkymap& map) +void GCTAEventCube::map(const GSkyMap& map) { // Store sky map m_map = map; @@ -610,7 +610,7 @@ void GCTAEventCube::free_members(void) * @param[in] hdu Image HDU. * * This method reads a CTA counts map from a FITS HDU. The counts map is - * stored in a GSkymap object. + * stored in a GSkyMap object. ***************************************************************************/ void GCTAEventCube::read_cntmap(const GFitsImage& hdu) { diff --git a/inst/cta/test/test_CTA.cpp b/inst/cta/test/test_CTA.cpp index 7930ae2..a545a94 100644 --- a/inst/cta/test/test_CTA.cpp +++ b/inst/cta/test/test_CTA.cpp @@ -692,7 +692,7 @@ void TestGCTAResponse::test_response_irf_diffuse(void) pnt.dir(skyDir); // Setup skymap (10 energy layers) - GSkymap map("CAR", "CEL", src_ra, src_dec, 0.5, 0.5, 10, 10, nebins); + GSkyMap map("CAR", "CEL", src_ra, src_dec, 0.5, 0.5, 10, 10, nebins); // Setup time interval GGti gti; diff --git a/inst/cta/test/test_irf_offset.py b/inst/cta/test/test_irf_offset.py index 26ce18c..fdfa224 100755 --- a/inst/cta/test/test_irf_offset.py +++ b/inst/cta/test/test_irf_offset.py @@ -6,7 +6,7 @@ # It creates a set of models for different offset angles and evaluates the # counts map for this set of models. # -# Copyright (C) 2012 Juergen Knoedlseder +# Copyright (C) 2012-2015 Juergen Knoedlseder # # 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 @@ -152,7 +152,7 @@ def observation(ra=0.0, dec=0.0, binsz=0.05, npix=200, ebins=10): tmin = GTime(0.0) tmax = GTime(1800.0) gti.append(tmin, tmax) - map = GSkymap("CAR", "CEL", ra, dec, -binsz, binsz, npix, npix, ebins) + map = GSkyMap("CAR", "CEL", ra, dec, -binsz, binsz, npix, npix, ebins) cube = GCTAEventCube(map, ebounds, gti) obs.events(cube) obs.ontime(1800.0) diff --git a/inst/cta/test/test_model.py b/inst/cta/test/test_model.py index 2d06a54..32ebd48 100755 --- a/inst/cta/test/test_model.py +++ b/inst/cta/test/test_model.py @@ -2,7 +2,7 @@ # ========================================================================== # This script tests the model computations using the CTA response function. # -# Copyright (C) 2011-2014 Jurgen Knodlseder +# Copyright (C) 2011-2015 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 @@ -192,7 +192,7 @@ def observation(ra=83.6331, dec=22.0145, emin=0.1, emax=100.0, tmin = gammalib.GTime(0.0) tmax = gammalib.GTime(duration) gti.append(tmin, tmax) - map = gammalib.GSkymap("CAR", "CEL", ra, dec, -binsz, binsz, npix, npix, ebins) + map = gammalib.GSkyMap("CAR", "CEL", ra, dec, -binsz, binsz, npix, npix, ebins) cube = gammalib.GCTAEventCube(map, ebounds, gti) obs.events(cube) diff --git a/inst/lat/include/GLATEventCube.hpp b/inst/lat/include/GLATEventCube.hpp index 14f299c..166912d 100644 --- a/inst/lat/include/GLATEventCube.hpp +++ b/inst/lat/include/GLATEventCube.hpp @@ -38,7 +38,7 @@ #include "GFits.hpp" #include "GFitsImage.hpp" #include "GFitsTable.hpp" -#include "GSkymap.hpp" +#include "GSkyMap.hpp" #include "GNodeArray.hpp" @@ -78,11 +78,11 @@ public: // Other methods void time(const GTime& time); - void map(const GSkymap& map); + void map(const GSkyMap& map); void enodes(const GNodeArray& enodes); void ontime(const double& ontime); const GTime& time(void) const; - const GSkymap& map(void) const; + const GSkyMap& map(void) const; const GNodeArray& enodes(void) const; const double& ontime(void) const; int nx(void) const; @@ -91,7 +91,7 @@ public: int ebins(void) const; int ndiffrsp(void) const; std::string diffname(const int& index) const; - GSkymap* diffrsp(const int& index) const; + GSkyMap* diffrsp(const int& index) const; double maxrad(const GSkyDir& dir) const; protected: @@ -110,14 +110,14 @@ protected: // Protected data area GLATEventBin m_bin; //!< Actual energy bin - GSkymap m_map; //!< Counts map stored as sky map + GSkyMap m_map; //!< Counts map stored as sky map GTime m_time; //!< Event cube mean time double m_ontime; //!< Event cube ontime (sec) std::vector m_dirs; //!< Array of event directions std::vector m_solidangle; //!< Array of solid angles (sr) std::vector m_energies; //!< Array of log mean energies std::vector m_ewidth; //!< Array of energy bin widths - std::vector m_srcmap; //!< Pointers to source maps + std::vector m_srcmap; //!< Pointers to source maps std::vector m_srcmap_names; //!< Source map names GNodeArray m_enodes; //!< Energy nodes }; @@ -192,7 +192,7 @@ const GTime& GLATEventCube::time(void) const * @return Sky map. ***************************************************************************/ inline -const GSkymap& GLATEventCube::map(void) const +const GSkyMap& GLATEventCube::map(void) const { return m_map; } diff --git a/inst/lat/include/GLATLtCubeMap.hpp b/inst/lat/include/GLATLtCubeMap.hpp index c839a8f..70fcb6a 100644 --- a/inst/lat/include/GLATLtCubeMap.hpp +++ b/inst/lat/include/GLATLtCubeMap.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GLATLtCubeMap.hpp - Fermi LAT livetime cube map class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2013 by Juergen Knoedlseder * + * copyright (C) 2010-2015 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -31,7 +31,7 @@ #include #include "GBase.hpp" #include "GFitsTable.hpp" -#include "GSkymap.hpp" +#include "GSkyMap.hpp" #include "GSkyDir.hpp" #include "GLATAeff.hpp" #include "GLATPsf.hpp" @@ -89,7 +89,7 @@ private: void free_members(void); // Protected members - GSkymap m_map; //!< Lifetime cube map + GSkyMap m_map; //!< Lifetime cube map int m_num_ctheta; //!< Number of bins in cos theta int m_num_phi; //!< Number of bins in phi double m_min_ctheta; //!< Minimum cos theta value diff --git a/inst/lat/pyext/GLATEventCube.i b/inst/lat/pyext/GLATEventCube.i index 544456b..b8f60db 100644 --- a/inst/lat/pyext/GLATEventCube.i +++ b/inst/lat/pyext/GLATEventCube.i @@ -59,11 +59,11 @@ public: // Other methods void time(const GTime& time); - void map(const GSkymap& map); + void map(const GSkyMap& map); void enodes(const GNodeArray& enodes); void ontime(const double& ontime); const GTime& time(void) const; - const GSkymap& map(void) const; + const GSkyMap& map(void) const; const GNodeArray& enodes(void); const double& ontime(void) const; int nx(void) const; @@ -72,7 +72,7 @@ public: int ebins(void) const; int ndiffrsp(void) const; std::string diffname(const int& index) const; - GSkymap* diffrsp(const int& index) const; + GSkyMap* diffrsp(const int& index) const; double maxrad(const GSkyDir& dir) const; }; diff --git a/inst/lat/src/GLATEventCube.cpp b/inst/lat/src/GLATEventCube.cpp index 1d47150..3c06d2d 100644 --- a/inst/lat/src/GLATEventCube.cpp +++ b/inst/lat/src/GLATEventCube.cpp @@ -447,7 +447,7 @@ int GLATEventCube::number(void) const /***********************************************************************//** * @brief Set event cube from sky map ***************************************************************************/ -void GLATEventCube::map(const GSkymap& map) +void GLATEventCube::map(const GSkyMap& map) { // Store sky map m_map = map; @@ -575,7 +575,7 @@ std::string GLATEventCube::diffname(const int& index) const * * Returns pointer to diffuse model sky map. ***************************************************************************/ -GSkymap* GLATEventCube::diffrsp(const int& index) const +GSkyMap* GLATEventCube::diffrsp(const int& index) const { // Optionally check if the index is valid #if defined(G_RANGE_CHECK) @@ -741,7 +741,7 @@ void GLATEventCube::free_members(void) * @param[in] hdu Image HDU. * * This method reads a Fermi/LAT counts map from a FITS image. The counts map - * is stored in a GSkymap object, and a pointer is set up to access the + * is stored in a GSkyMap object, and a pointer is set up to access the * pixels individually. Recall that skymap pixels are stored in the order * (ix,iy,ebin). ***************************************************************************/ @@ -767,12 +767,12 @@ void GLATEventCube::read_cntmap(const GFitsImage& hdu) * Source map not compatible with sky map * * This method reads a LAT source map from a FITS image. The source map is - * stored in a GSkymap object and is given in units of counts/pixel/MeV. + * stored in a GSkyMap object and is given in units of counts/pixel/MeV. ***************************************************************************/ void GLATEventCube::read_srcmap(const GFitsImage& hdu) { // Allocate skymap - GSkymap* map = new GSkymap; + GSkyMap* map = new GSkyMap; // Read skymap map->read(hdu); diff --git a/inst/lat/src/GLATResponse.cpp b/inst/lat/src/GLATResponse.cpp index f851401..23db62e 100644 --- a/inst/lat/src/GLATResponse.cpp +++ b/inst/lat/src/GLATResponse.cpp @@ -405,7 +405,7 @@ double GLATResponse::irf(const GLATEventBin& event, nodes.set_value(srcEng.log10MeV()); // Compute diffuse response - GSkymap* map = cube->diffrsp(idiff); + GSkyMap* map = cube->diffrsp(idiff); const double* pixels = map->pixels() + event.ipix(); rsp = nodes.wgt_left() * pixels[nodes.inx_left() * map->npix()] + nodes.wgt_right() * pixels[nodes.inx_right() * map->npix()]; diff --git a/inst/lat/test/test_LAT.cpp b/inst/lat/test/test_LAT.cpp index beb4c1b..fe69852 100644 --- a/inst/lat/test/test_LAT.cpp +++ b/inst/lat/test/test_LAT.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * test_LAT.cpp - test LAT classes * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2014 by Juergen Knoedlseder * + * copyright (C) 2010-2015 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -331,7 +331,7 @@ void TestGLATLtCube::test_one_ltcube(const std::string& datadir, const double& r // Create livetime skymap (no phi dependence) test_try("Create livetime skymap (no phi dependence)"); try { - GSkymap map("GAL", 64, "RING", 1); + GSkyMap map("GAL", 64, "RING", 1); GLATLtCube ltcube(lat_ltcube); GEnergy energy; for (int i = 0; i < map.npix(); ++i) { @@ -348,7 +348,7 @@ void TestGLATLtCube::test_one_ltcube(const std::string& datadir, const double& r // Create livetime skymap (phi dependence) test_try("Create livetime skymap (phi dependence)"); try { - GSkymap map("GAL", 64, "RING", 1); + GSkyMap map("GAL", 64, "RING", 1); GLATLtCube ltcube(lat_ltcube); GEnergy energy; for (int i = 0; i < map.npix(); ++i) { diff --git a/pyext/GModelSpatialDiffuseCube.i b/pyext/GModelSpatialDiffuseCube.i index 8ff4545..ff63835 100644 --- a/pyext/GModelSpatialDiffuseCube.i +++ b/pyext/GModelSpatialDiffuseCube.i @@ -41,7 +41,7 @@ public: explicit GModelSpatialDiffuseCube(const GXmlElement& xml); GModelSpatialDiffuseCube(const std::string& filename, const double& value = 1.0); - GModelSpatialDiffuseCube(const GSkymap& map, + GModelSpatialDiffuseCube(const GSkyMap& map, const GEnergies& energies, const double& value = 1.0); GModelSpatialDiffuseCube(const GModelSpatialDiffuseCube& model); @@ -72,8 +72,8 @@ public: void value(const double& value); const std::string& filename(void) const; void filename(const std::string& filename); - const GSkymap& cube(void) const; - void cube(const GSkymap& cube); + const GSkyMap& cube(void) const; + void cube(const GSkyMap& cube); GEnergies energies(void); void energies(const GEnergies& energies); const GModelSpectralNodes& spectrum(void) const; diff --git a/pyext/GModelSpatialDiffuseMap.i b/pyext/GModelSpatialDiffuseMap.i index 53f15d6..39442a4 100644 --- a/pyext/GModelSpatialDiffuseMap.i +++ b/pyext/GModelSpatialDiffuseMap.i @@ -42,7 +42,7 @@ public: GModelSpatialDiffuseMap(const std::string& filename, const double& value = 1.0, const bool& normalize = true); - GModelSpatialDiffuseMap(const GSkymap& map, + GModelSpatialDiffuseMap(const GSkyMap& map, const double& value = 1.0, const bool& normalize = true); GModelSpatialDiffuseMap(const GModelSpatialDiffuseMap& model); @@ -70,8 +70,8 @@ public: void value(const double& value); const std::string& filename(void) const; void load(const std::string& filename); - const GSkymap& map(void) const; - void map(const GSkymap& map); + const GSkyMap& map(void) const; + void map(const GSkyMap& map); bool normalize(void) const; }; diff --git a/pyext/GSkymap.i b/pyext/GSkyMap.i index 91fb00b..eb3ea8f 100644 --- a/pyext/GSkymap.i +++ b/pyext/GSkyMap.i @@ -1,5 +1,5 @@ /*************************************************************************** - * GSkymap.i - Sky map class * + * GSkyMap.i - Sky map class * * ----------------------------------------------------------------------- * * copyright (C) 2010-2015 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * @@ -19,13 +19,13 @@ * * ***************************************************************************/ /** - * @file GSkymap.i + * @file GSkyMap.i * @brief Sky map class SWIG file. * @author Juergen Knoedlseder */ %{ /* Put headers and other declarations here that are needed for compilation */ -#include "GSkymap.hpp" +#include "GSkyMap.hpp" #include "GTools.hpp" %} @@ -71,7 +71,7 @@ static int skymap_tuple(PyObject *input, int *ptr) { %} // This is the typemap that makes use of the function defined above -%typemap(in) int GSkymapInx[ANY](int temp[3]) { +%typemap(in) int GSkyMapInx[ANY](int temp[3]) { if (!skymap_tuple($input,temp)) { return NULL; } @@ -79,8 +79,8 @@ static int skymap_tuple(PyObject *input, int *ptr) { } // This typecheck verifies that all arguments are integers. The typecheck -// is needed for using "int GSkymapInx" in overloaded methods. -%typemap(typecheck) int GSkymapInx[ANY] { +// is needed for using "int GSkyMapInx" in overloaded methods. +%typemap(typecheck) int GSkyMapInx[ANY] { $1 = 1; if (PySequence_Check($input)) { int size = PyObject_Length($input); @@ -101,21 +101,21 @@ static int skymap_tuple(PyObject *input, int *ptr) { /***********************************************************************//** - * @class GSkymap + * @class GSkyMap * - * @brief GSkymap class interface definition + * @brief GSkyMap class interface definition ***************************************************************************/ -class GSkymap : public GBase { +class GSkyMap : public GBase { public: // Constructors and destructors - GSkymap(void); - explicit GSkymap(const std::string& filename); - explicit GSkymap(const std::string& coords, + GSkyMap(void); + explicit GSkyMap(const std::string& filename); + explicit GSkyMap(const std::string& coords, const int& nside, const std::string& order, const int& nmaps = 1); - explicit GSkymap(const std::string& wcs, + explicit GSkyMap(const std::string& wcs, const std::string& coords, const double& x, const double& y, @@ -124,27 +124,27 @@ public: const int& nx, const int& ny, const int& nmaps = 1); - GSkymap(const GSkymap& map); - virtual ~GSkymap(void); + GSkyMap(const GSkyMap& map); + virtual ~GSkyMap(void); // Operators - GSkymap& operator+=(const GSkymap& map); - GSkymap& operator+=(const double& value); - GSkymap& operator-=(const GSkymap& map); - GSkymap& operator-=(const double& value); - GSkymap& operator*=(const GSkymap& map); - GSkymap& operator*=(const double& factor); - GSkymap operator+(const GSkymap& map) const; - GSkymap operator-(const GSkymap& map) const; - GSkymap operator*(const GSkymap& map) const; - GSkymap operator/(const GSkymap& map) const; + GSkyMap& operator+=(const GSkyMap& map); + GSkyMap& operator+=(const double& value); + GSkyMap& operator-=(const GSkyMap& map); + GSkyMap& operator-=(const double& value); + GSkyMap& operator*=(const GSkyMap& map); + GSkyMap& operator*=(const double& factor); + GSkyMap operator+(const GSkyMap& map) const; + GSkyMap operator-(const GSkyMap& map) const; + GSkyMap operator*(const GSkyMap& map) const; + GSkyMap operator/(const GSkyMap& map) const; double& operator()(const int& index, const int& map = 0); double& operator()(const GSkyPixel& pixel, const int& map = 0); double operator()(const GSkyDir& dir, const int& map = 0) const; // Methods void clear(void); - GSkymap* clone(void) const; + GSkyMap* clone(void) const; std::string classname(void) const; const int& npix(void) const; const int& nx(void) const; @@ -166,7 +166,7 @@ public: const GSkyProjection* projection(void) const; void projection(const GSkyProjection& proj); const double* pixels(void) const; - GSkymap extract(const int& map, const int& nmaps = 1) const; + GSkyMap extract(const int& map, const int& nmaps = 1) const; void stack_maps(void); void load(const std::string& filename); void save(const std::string& filename, bool clobber = false) const; @@ -176,18 +176,18 @@ public: /***********************************************************************//** - * @brief GSkymap class extension + * @brief GSkyMap class extension * * @todo Implement __getitem__ and __setitem__ methods for GSkyPixel and * GSkyDir ***************************************************************************/ -%extend GSkymap { - double __getitem__(int GSkymapInx[]) { - if (GSkymapInx[0] == 1) { - return (*self)(GSkymapInx[1]); +%extend GSkyMap { + double __getitem__(int GSkyMapInx[]) { + if (GSkyMapInx[0] == 1) { + return (*self)(GSkyMapInx[1]); } else { - return (*self)(GSkymapInx[1], GSkymapInx[2]); + return (*self)(GSkyMapInx[1], GSkyMapInx[2]); } } /* @@ -195,12 +195,12 @@ public: return (*self)(pixel); } */ - void __setitem__(int GSkymapInx[], double value) { - if (GSkymapInx[0] == 1) { - (*self)(GSkymapInx[1]) = value; + void __setitem__(int GSkyMapInx[], double value) { + if (GSkyMapInx[0] == 1) { + (*self)(GSkyMapInx[1]) = value; } else { - (*self)(GSkymapInx[1], GSkymapInx[2]) = value; + (*self)(GSkyMapInx[1], GSkyMapInx[2]) = value; } } /* @@ -208,29 +208,29 @@ public: (*self)(pixel) = value; } */ - GSkymap copy() { + GSkyMap copy() { return (*self); } - GSkymap sqrt() { + GSkyMap sqrt() { return sqrt(*self); } // Python 2.x operator/= - GSkymap __idiv__(const GSkymap& map) { + GSkyMap __idiv__(const GSkyMap& map) { self->operator/=(map); return (*self); } // Python 3.x operator/= - GSkymap __itruediv__(const GSkymap& map) { + GSkyMap __itruediv__(const GSkyMap& map) { self->operator/=(map); return (*self); } // Python 2.x operator/= - GSkymap __idiv__(const double& factor) { + GSkyMap __idiv__(const double& factor) { self->operator/=(factor); return (*self); } // Python 3.x operator/= - GSkymap __itruediv__(const double& factor) { + GSkyMap __itruediv__(const double& factor) { self->operator/=(factor); return (*self); } diff --git a/pyext/gammalib/sky.i b/pyext/gammalib/sky.i index c6b6ee8..3898b34 100644 --- a/pyext/gammalib/sky.i +++ b/pyext/gammalib/sky.i @@ -101,7 +101,7 @@ %include "GSkyDir.i" %include "GHorizDir.i" %include "GSkyPixel.i" -%include "GSkymap.i" +%include "GSkyMap.i" %include "GSkyRegions.i" %include "GSkyRegion.i" %include "GSkyRegionCircle.i" diff --git a/src/model/GModelSpatialDiffuseCube.cpp b/src/model/GModelSpatialDiffuseCube.cpp index c58f67a..ecc1619 100644 --- a/src/model/GModelSpatialDiffuseCube.cpp +++ b/src/model/GModelSpatialDiffuseCube.cpp @@ -144,7 +144,7 @@ GModelSpatialDiffuseCube::GModelSpatialDiffuseCube(const std::string& filename, * constructor also assigns the energy values for all maps and sets the * scaling @p value. The filename will remain blank. ***************************************************************************/ -GModelSpatialDiffuseCube::GModelSpatialDiffuseCube(const GSkymap& cube, +GModelSpatialDiffuseCube::GModelSpatialDiffuseCube(const GSkyMap& cube, const GEnergies& energies, const double& value) : GModelSpatialDiffuse() diff --git a/src/model/GModelSpatialDiffuseMap.cpp b/src/model/GModelSpatialDiffuseMap.cpp index 22bb487..9c8500d 100644 --- a/src/model/GModelSpatialDiffuseMap.cpp +++ b/src/model/GModelSpatialDiffuseMap.cpp @@ -139,7 +139,7 @@ GModelSpatialDiffuseMap::GModelSpatialDiffuseMap(const std::string& filename, * Constructs spatial map model by setting the sky @p map and by setting the * normalization @p value. ***************************************************************************/ -GModelSpatialDiffuseMap::GModelSpatialDiffuseMap(const GSkymap& map, +GModelSpatialDiffuseMap::GModelSpatialDiffuseMap(const GSkyMap& map, const double& value, const bool& normalize) : GModelSpatialDiffuse() @@ -771,7 +771,7 @@ void GModelSpatialDiffuseMap::free_members(void) * maximum expected value for each pixel which is also used in Monte Carlo * sampling. * - * Note that if the GSkymap object contains multiple maps, only the first + * Note that if the GSkyMap object contains multiple maps, only the first * map is used. ***************************************************************************/ void GModelSpatialDiffuseMap::prepare_map(void) diff --git a/src/sky/GException_sky.cpp b/src/sky/GException_sky.cpp index e62f370..0bbd881 100644 --- a/src/sky/GException_sky.cpp +++ b/src/sky/GException_sky.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GException_sky.cpp - sky exception handlers * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2011 by Jurgen Knodlseder * + * copyright (C) 2010-2015 by Jurgen Knodlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -33,7 +33,7 @@ /***********************************************************************//** - * @brief General GSkymap error + * @brief General GSkyMap error * * @param[in] origin Method that throws the error. * @param[in] message Error message. diff --git a/src/sky/GSkymap.cpp b/src/sky/GSkyMap.cpp index 4a8f6cb..95287c9 100644 --- a/src/sky/GSkymap.cpp +++ b/src/sky/GSkyMap.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * GSkymap.cpp - Sky map class * + * GSkyMap.cpp - Sky map class * * ----------------------------------------------------------------------- * * copyright (C) 2010-2015 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * @@ -19,7 +19,7 @@ * * ***************************************************************************/ /** - * @file GSkymap.cpp + * @file GSkyMap.cpp * @brief Sky map class implementation * @author Juergen Knoedlseder */ @@ -31,7 +31,7 @@ #include "GException.hpp" #include "GMath.hpp" #include "GTools.hpp" -#include "GSkymap.hpp" +#include "GSkyMap.hpp" #include "GHealpix.hpp" #include "GWcsRegistry.hpp" #include "GWcs.hpp" @@ -40,35 +40,35 @@ #include "GFitsImageDouble.hpp" /* __ Method name definitions ____________________________________________ */ -#define G_CONSTRUCT_HPX "GSkymap::GSkymap(std::string&, int&,"\ +#define G_CONSTRUCT_HPX "GSkyMap::GSkyMap(std::string&, int&,"\ " std::string&, int&)" -#define G_CONSTRUCT_MAP "GSkymap::GSkymap(std::string&, std::string&,"\ +#define G_CONSTRUCT_MAP "GSkyMap::GSkyMap(std::string&, std::string&,"\ " double&, double&, double& double&, int&, int&, int&)" -#define G_NMAPS "GSkymap::nmaps(int&)" -#define G_OP_UNARY_ADD "GSkymap::operator+=(GSkymap&)" -#define G_OP_UNARY_SUB "GSkymap::operator-=(GSkymap&)" -#define G_OP_UNARY_MUL "GSkymap::operator-=(GSkymap&)" -#define G_OP_UNARY_DIV "GSkymap::operator/=(GSkymap&)" -#define G_OP_UNARY_DIV2 "GSkymap::operator/=(double&)" -#define G_OP_ACCESS_1D "GSkymap::operator(int&, int&)" -#define G_OP_ACCESS_2D "GSkymap::operator(GSkyPixel&, int&)" -#define G_OP_VALUE "GSkymap::operator(GSkyDir&, int&)" -#define G_INX2DIR "GSkymap::inx2dir(int&)" -#define G_PIX2DIR "GSkymap::pix2dir(GSkyPixel&)" -#define G_DIR2INX "GSkymap::dir2inx(GSkyDir&)" -#define G_DIR2PIX "GSkymap::dir2pix(GSkyDir&)" -#define G_FLUX1 "GSkymap::flux(int&)" -#define G_FLUX2 "GSkymap::flux(GSkyPixel&)" -#define G_SOLIDANGLE1 "GSkymap::solidangle(int&)" -#define G_SOLIDANGLE2 "GSkymap::solidangle(GSkyPixel&)" -#define G_EXTRACT "GSkymap::extract(int&, int&)" -#define G_READ "GSkymap::read(GFitsHDU&)" -#define G_SET_WCS "GSkymap::set_wcs(std::string&, std::string&, double&,"\ +#define G_NMAPS "GSkyMap::nmaps(int&)" +#define G_OP_UNARY_ADD "GSkyMap::operator+=(GSkyMap&)" +#define G_OP_UNARY_SUB "GSkyMap::operator-=(GSkyMap&)" +#define G_OP_UNARY_MUL "GSkyMap::operator-=(GSkyMap&)" +#define G_OP_UNARY_DIV "GSkyMap::operator/=(GSkyMap&)" +#define G_OP_UNARY_DIV2 "GSkyMap::operator/=(double&)" +#define G_OP_ACCESS_1D "GSkyMap::operator(int&, int&)" +#define G_OP_ACCESS_2D "GSkyMap::operator(GSkyPixel&, int&)" +#define G_OP_VALUE "GSkyMap::operator(GSkyDir&, int&)" +#define G_INX2DIR "GSkyMap::inx2dir(int&)" +#define G_PIX2DIR "GSkyMap::pix2dir(GSkyPixel&)" +#define G_DIR2INX "GSkyMap::dir2inx(GSkyDir&)" +#define G_DIR2PIX "GSkyMap::dir2pix(GSkyDir&)" +#define G_FLUX1 "GSkyMap::flux(int&)" +#define G_FLUX2 "GSkyMap::flux(GSkyPixel&)" +#define G_SOLIDANGLE1 "GSkyMap::solidangle(int&)" +#define G_SOLIDANGLE2 "GSkyMap::solidangle(GSkyPixel&)" +#define G_EXTRACT "GSkyMap::extract(int&, int&)" +#define G_READ "GSkyMap::read(GFitsHDU&)" +#define G_SET_WCS "GSkyMap::set_wcs(std::string&, std::string&, double&,"\ " double&, double&, double&, double&, double&,"\ " GMatrix&, GVector&)" -#define G_READ_HEALPIX "GSkymap::read_healpix(GFitsTable*)" -#define G_READ_WCS "GSkymap::read_wcs(GFitsImage*)" -#define G_ALLOC_WCS "GSkymap::alloc_wcs(GFitsImage*)" +#define G_READ_HEALPIX "GSkyMap::read_healpix(GFitsTable*)" +#define G_READ_WCS "GSkyMap::read_wcs(GFitsImage*)" +#define G_ALLOC_WCS "GSkyMap::alloc_wcs(GFitsImage*)" /* __ Macros _____________________________________________________________ */ @@ -90,7 +90,7 @@ /***********************************************************************//** * @brief Void constructor ***************************************************************************/ -GSkymap::GSkymap(void) +GSkyMap::GSkyMap(void) { // Initialise class members for clean destruction init_members(); @@ -105,7 +105,7 @@ GSkymap::GSkymap(void) * * @param[in] filename FITS file name. ***************************************************************************/ -GSkymap::GSkymap(const std::string& filename) +GSkyMap::GSkyMap(const std::string& filename) { // Initialise class members for clean destruction init_members(); @@ -131,7 +131,7 @@ GSkymap::GSkymap(const std::string& filename) * * Constructs sky map in Healpix pixelisation. ***************************************************************************/ -GSkymap::GSkymap(const std::string& coords, +GSkyMap::GSkyMap(const std::string& coords, const int& nside, const std::string& order, const int& nmaps) @@ -179,7 +179,7 @@ GSkymap::GSkymap(const std::string& coords, * * Constructs sky map in World Coordinate System projection. ***************************************************************************/ -GSkymap::GSkymap(const std::string& wcs, +GSkyMap::GSkyMap(const std::string& wcs, const std::string& coords, const double& x, const double& y, @@ -237,7 +237,7 @@ GSkymap::GSkymap(const std::string& wcs, * * @param[in] map Sky map. ***************************************************************************/ -GSkymap::GSkymap(const GSkymap& map) +GSkyMap::GSkyMap(const GSkyMap& map) { // Initialise class members for clean destruction init_members(); @@ -253,7 +253,7 @@ GSkymap::GSkymap(const GSkymap& map) /***********************************************************************//** * @brief Destructor ***************************************************************************/ -GSkymap::~GSkymap(void) +GSkyMap::~GSkyMap(void) { // Free members free_members(); @@ -275,7 +275,7 @@ GSkymap::~GSkymap(void) * @param[in] map Sky map. * @return Sky map. ***************************************************************************/ -GSkymap& GSkymap::operator=(const GSkymap& map) +GSkyMap& GSkyMap::operator=(const GSkyMap& map) { // Execute only if object is not identical if (this != &map) { @@ -304,7 +304,7 @@ GSkymap& GSkymap::operator=(const GSkymap& map) * * Sets all pixels to the specified @p value. ***************************************************************************/ -GSkymap& GSkymap::operator=(const double& value) +GSkyMap& GSkyMap::operator=(const double& value) { // Get number of pixels int num = m_num_pixels * m_num_maps; @@ -338,7 +338,7 @@ GSkymap& GSkymap::operator=(const double& value) * does the transformation, allowing the to loop more effectively over the * layers. ***************************************************************************/ -GSkymap& GSkymap::operator+=(const GSkymap& map) +GSkyMap& GSkyMap::operator+=(const GSkyMap& map) { // Check if number of layers are identical if (map.nmaps() != nmaps()) { @@ -378,7 +378,7 @@ GSkymap& GSkymap::operator+=(const GSkymap& map) * * Add @p value to all sky map pixels. ***************************************************************************/ -GSkymap& GSkymap::operator+=(const double& value) +GSkyMap& GSkyMap::operator+=(const double& value) { // Set total number of sky map pixels int num = m_num_pixels * m_num_maps; @@ -412,7 +412,7 @@ GSkymap& GSkymap::operator+=(const double& value) * does the transformation, allowing the to loop more effectively over the * layers. ***************************************************************************/ -GSkymap& GSkymap::operator-=(const GSkymap& map) +GSkyMap& GSkyMap::operator-=(const GSkyMap& map) { // Check if number of layers are identical if (map.nmaps() != nmaps()) { @@ -452,7 +452,7 @@ GSkymap& GSkymap::operator-=(const GSkymap& map) * * Subtracts @p value from all sky map pixels. ***************************************************************************/ -GSkymap& GSkymap::operator-=(const double& value) +GSkyMap& GSkyMap::operator-=(const double& value) { // Set total number of sky map pixels int num = m_num_pixels * m_num_maps; @@ -486,7 +486,7 @@ GSkymap& GSkymap::operator-=(const double& value) * does the transformation, allowing to loop more effectively over the * layers. ***************************************************************************/ -GSkymap& GSkymap::operator*=(const GSkymap& map) +GSkyMap& GSkyMap::operator*=(const GSkyMap& map) { // Check if number of layers are identical if (map.nmaps() != nmaps()) { @@ -526,7 +526,7 @@ GSkymap& GSkymap::operator*=(const GSkymap& map) * * Multiplies all pixels of the sky map by the given scale @p factor. ***************************************************************************/ -GSkymap& GSkymap::operator*=(const double& factor) +GSkyMap& GSkyMap::operator*=(const double& factor) { // Compute total number of pixels int n = npix() * nmaps(); @@ -559,7 +559,7 @@ GSkymap& GSkymap::operator*=(const double& factor) * On return, all pixels in @p map that are zero are silently set to zero in * the skymap. ***************************************************************************/ -GSkymap& GSkymap::operator/=(const GSkymap& map) +GSkyMap& GSkyMap::operator/=(const GSkyMap& map) { // Check if number of layers are identical if (map.nmaps() != nmaps()) { @@ -614,7 +614,7 @@ GSkymap& GSkymap::operator/=(const GSkymap& map) * * Divides all pixels of the sky map by the given @p factor. ***************************************************************************/ -GSkymap& GSkymap::operator/=(const double& factor) +GSkyMap& GSkyMap::operator/=(const double& factor) { // Check for division by zero if (factor == 0.0) { @@ -649,7 +649,7 @@ GSkymap& GSkymap::operator/=(const double& factor) * Access sky map pixel by its index, where the most quickly varying axis is * the x axis of the map. ***************************************************************************/ -double& GSkymap::operator()(const int& index, const int& map) +double& GSkyMap::operator()(const int& index, const int& map) { // Throw an error if pixel index or map index is not in valid range #if defined(G_RANGE_CHECK) @@ -682,7 +682,7 @@ double& GSkymap::operator()(const int& index, const int& map) * Access sky map pixel by its index, where the most quickly varying axis is * the x axis of the map. ***************************************************************************/ -const double& GSkymap::operator()(const int& index, const int& map) const +const double& GSkyMap::operator()(const int& index, const int& map) const { // Throw an error if pixel index or map index is not in valid range #if defined(G_RANGE_CHECK) @@ -717,7 +717,7 @@ const double& GSkymap::operator()(const int& index, const int& map) const * * @todo Implement proper skymap exception (actual is for matrix elements) ***************************************************************************/ -double& GSkymap::operator()(const GSkyPixel& pixel, const int& map) +double& GSkyMap::operator()(const GSkyPixel& pixel, const int& map) { // Throw an error if pixel index or map index is not in valid range #if defined(G_RANGE_CHECK) @@ -755,7 +755,7 @@ double& GSkymap::operator()(const GSkyPixel& pixel, const int& map) * * @todo Implement proper skymap exception (actual is for matrix elements) ***************************************************************************/ -const double& GSkymap::operator()(const GSkyPixel& pixel, const int& map) const +const double& GSkyMap::operator()(const GSkyPixel& pixel, const int& map) const { // Throw an error if pixel index or map index is not in valid range #if defined(G_RANGE_CHECK) @@ -798,7 +798,7 @@ const double& GSkymap::operator()(const GSkyPixel& pixel, const int& map) const * is requested several times. This speeds up use cases where skymap values * for various map indices have to be returned for the same sky direction. ***************************************************************************/ -double GSkymap::operator()(const GSkyDir& dir, const int& map) const +double GSkyMap::operator()(const GSkyDir& dir, const int& map) const { // Throw an error if the map index is not in valid range #if defined(G_RANGE_CHECK) @@ -956,7 +956,7 @@ double GSkymap::operator()(const GSkyDir& dir, const int& map) const * * Resets the sky map to the initial state. ***************************************************************************/ -void GSkymap::clear(void) +void GSkyMap::clear(void) { // Free class members free_members(); @@ -974,9 +974,9 @@ void GSkymap::clear(void) * * @return Pointer to deep copy of sky map. ***************************************************************************/ -GSkymap* GSkymap::clone(void) const +GSkyMap* GSkyMap::clone(void) const { - return new GSkymap(*this); + return new GSkyMap(*this); } @@ -988,18 +988,18 @@ GSkymap* GSkymap::clone(void) const * @exception GException::invalid_argument * Invalid number of maps specified. * - * Redefines the number of maps in an GSkymap object. If the number of maps + * Redefines the number of maps in an GSkyMap object. If the number of maps * is increased with respect to the existing number, additional maps with * pixel values of zero are append to the object. Existing map pixel values * are kept. If the number of maps is decreased with respect to the existing * number, the excedent maps are dropped. The remaining map pixel values are * kept. ***************************************************************************/ -void GSkymap::nmaps(const int& nmaps) +void GSkyMap::nmaps(const int& nmaps) { // Throw an exception if less than 1 map is required if (nmaps < 1) { - std::string msg = "At least one map is required in an GSkymap object." + std::string msg = "At least one map is required in an GSkyMap object." " Please specify an argument >=1."; throw GException::invalid_argument(G_NMAPS, msg); } @@ -1055,7 +1055,7 @@ void GSkymap::nmaps(const int& nmaps) * sky map leads to a 1D GSkyPixel object, a 2D sky map leads to a 2D * GSkyPixel object. ***************************************************************************/ -GSkyPixel GSkymap::inx2pix(const int& index) const +GSkyPixel GSkyMap::inx2pix(const int& index) const { // Initialise sky map pixel GSkyPixel pixel; @@ -1085,7 +1085,7 @@ GSkyPixel GSkymap::inx2pix(const int& index) const * * Returns sky direction for a given pixel index. ***************************************************************************/ -GSkyDir GSkymap::inx2dir(const int& index) const +GSkyDir GSkyMap::inx2dir(const int& index) const { // Throw error if sky projection is not valid if (m_proj == NULL) { @@ -1114,7 +1114,7 @@ GSkyDir GSkymap::inx2dir(const int& index) const * * Returns sky direction for a given sky map @p pixel. ***************************************************************************/ -GSkyDir GSkymap::pix2dir(const GSkyPixel& pixel) const +GSkyDir GSkyMap::pix2dir(const GSkyPixel& pixel) const { // Throw error if WCS is not valid if (m_proj == NULL) { @@ -1161,7 +1161,7 @@ GSkyDir GSkymap::pix2dir(const GSkyPixel& pixel) const * * Converts a sky map @p pixel into the pixel index. ***************************************************************************/ -int GSkymap::pix2inx(const GSkyPixel& pixel) const +int GSkyMap::pix2inx(const GSkyPixel& pixel) const { // Initialise pixel index int index = 0; @@ -1199,7 +1199,7 @@ int GSkymap::pix2inx(const GSkyPixel& pixel) const * * Returns sky map pixel index for a given sky direction. ***************************************************************************/ -int GSkymap::dir2inx(const GSkyDir& dir) const +int GSkyMap::dir2inx(const GSkyDir& dir) const { // Throw error if WCS is not valid if (m_proj == NULL) { @@ -1226,7 +1226,7 @@ int GSkymap::dir2inx(const GSkyDir& dir) const * * Returns sky map pixel for a given sky direction. ***************************************************************************/ -GSkyPixel GSkymap::dir2pix(const GSkyDir& dir) const +GSkyPixel GSkyMap::dir2pix(const GSkyDir& dir) const { // Throw error if WCS is not valid if (m_proj == NULL) { @@ -1254,7 +1254,7 @@ GSkyPixel GSkymap::dir2pix(const GSkyDir& dir) const * * Returns the flux in the pixel with the specified @p index. ***************************************************************************/ -double GSkymap::flux(const int& index, const int& map) const +double GSkyMap::flux(const int& index, const int& map) const { // Throw error if WCS is not valid if (m_proj == NULL) { @@ -1291,7 +1291,7 @@ double GSkymap::flux(const int& index, const int& map) const * For a HealPix pixelisation, the pixel is divided into 12 wedges. For a * WCS pixelisation, the pixel is divided into 8 wedges. ***************************************************************************/ -double GSkymap::flux(const GSkyPixel& pixel, const int& map) const +double GSkyMap::flux(const GSkyPixel& pixel, const int& map) const { // Throw error if WCS is not valid if (m_proj == NULL) { @@ -1437,7 +1437,7 @@ double GSkymap::flux(const GSkyPixel& pixel, const int& map) const * * Returns the solid angle of the pixel with the specified @p index. ***************************************************************************/ -double GSkymap::solidangle(const int& index) const +double GSkyMap::solidangle(const int& index) const { // Throw error if WCS is not valid if (m_proj == NULL) { @@ -1464,7 +1464,7 @@ double GSkymap::solidangle(const int& index) const * * Returns the solid angle of the specified sky map @p pixel. ***************************************************************************/ -double GSkymap::solidangle(const GSkyPixel& pixel) const +double GSkyMap::solidangle(const GSkyPixel& pixel) const { // Throw error if WCS is not valid if (m_proj == NULL) { @@ -1512,14 +1512,14 @@ double GSkymap::solidangle(const GSkyPixel& pixel) const * performs a deep copy of @p proj, allowing to destroy the argument after * using the method. * - * Warning: this method may corrupt the GSkymap object as it allows assigning + * Warning: this method may corrupt the GSkyMap object as it allows assigning * for example a 1D projection to a 2D skymap. Please use this method only * when you know what you're doing. * * @todo We may restrict this method to not allow changing the projection * dimension. ***************************************************************************/ -void GSkymap::projection(const GSkyProjection& proj) +void GSkyMap::projection(const GSkyProjection& proj) { // Free any existing WCS if (m_proj != NULL) delete m_proj; @@ -1542,7 +1542,7 @@ void GSkymap::projection(const GSkyProjection& proj) * sky direction into 2D pixel indices, and then checks whether the pixel * indices fall in the skymap. ***************************************************************************/ -bool GSkymap::contains(const GSkyDir& dir) const +bool GSkyMap::contains(const GSkyDir& dir) const { // Convert sky direction into sky pixel GSkyPixel pixel = dir2pix(dir); @@ -1561,7 +1561,7 @@ bool GSkymap::contains(const GSkyDir& dir) const * Checks whether the specified sky map @p pixel falls within the skymap * or not. ***************************************************************************/ -bool GSkymap::contains(const GSkyPixel& pixel) const +bool GSkyMap::contains(const GSkyPixel& pixel) const { // Initialise containment flag bool inmap = false; @@ -1604,7 +1604,7 @@ bool GSkymap::contains(const GSkyPixel& pixel) const * * Extracts @p nmaps sky maps starting from @p map from the sky map. ***************************************************************************/ -GSkymap GSkymap::extract(const int& map, const int& nmaps) const +GSkyMap GSkyMap::extract(const int& map, const int& nmaps) const { // Throw an exception if the first map index is invalid if (map < 0 || map >= m_num_maps) { @@ -1644,7 +1644,7 @@ GSkymap GSkymap::extract(const int& map, const int& nmaps) const } // Create a copy of the map - GSkymap result = *this; + GSkyMap result = *this; // Delete pixels from that map if (result.m_pixels != NULL) delete [] result.m_pixels; @@ -1670,7 +1670,7 @@ GSkymap GSkymap::extract(const int& map, const int& nmaps) const * pixels or there is only a single map in the object, the method does * nothing. ***************************************************************************/ -void GSkymap::stack_maps(void) +void GSkyMap::stack_maps(void) { // Continue only if the map has pixels and if there is more than 1 map if (m_num_pixels > 0 && m_num_maps > 1) { @@ -1715,7 +1715,7 @@ void GSkymap::stack_maps(void) * @todo Do we have to restrict a HEALPix map to a BinTable and a WCS map * to a Double precision image??? ***************************************************************************/ -void GSkymap::load(const std::string& filename) +void GSkyMap::load(const std::string& filename) { // Free memory and initialise members free_members(); @@ -1784,7 +1784,7 @@ void GSkymap::load(const std::string& filename) * * The method does nothing if the skymap holds no valid WCS. ***************************************************************************/ -void GSkymap::save(const std::string& filename, bool clobber) const +void GSkyMap::save(const std::string& filename, bool clobber) const { // Continue only if we have data to save if (m_proj != NULL) { @@ -1824,7 +1824,7 @@ void GSkymap::save(const std::string& filename, bool clobber) const * * @param[in] hdu FITS HDU. ***************************************************************************/ -void GSkymap::read(const GFitsHDU& hdu) +void GSkyMap::read(const GFitsHDU& hdu) { // Free memory and initialise members free_members(); @@ -1860,7 +1860,7 @@ void GSkymap::read(const GFitsHDU& hdu) * * @param[in] file FITS file pointer. ***************************************************************************/ -void GSkymap::write(GFits& file) const +void GSkyMap::write(GFits& file) const { // Continue only if we have data to save if (m_proj != NULL) { @@ -1899,7 +1899,7 @@ void GSkymap::write(GFits& file) const * @param[in] chatter Chattiness (defaults to NORMAL). * @return String containing sky map information. ***************************************************************************/ -std::string GSkymap::print(const GChatter& chatter) const +std::string GSkyMap::print(const GChatter& chatter) const { // Initialise result string std::string result; @@ -1908,7 +1908,7 @@ std::string GSkymap::print(const GChatter& chatter) const if (chatter != SILENT) { // Append header - result.append("=== GSkymap ==="); + result.append("=== GSkyMap ==="); // Append information result.append("\n"+gammalib::parformat("Number of pixels")); @@ -1948,7 +1948,7 @@ std::string GSkymap::print(const GChatter& chatter) const /***********************************************************************//** * @brief Initialise class members ***************************************************************************/ -void GSkymap::init_members(void) +void GSkyMap::init_members(void) { // Initialise members m_num_pixels = 0; @@ -1972,7 +1972,7 @@ void GSkymap::init_members(void) /***********************************************************************//** * @brief Allocate skymap pixels ***************************************************************************/ -void GSkymap::alloc_pixels(void) +void GSkyMap::alloc_pixels(void) { // Compute data size int size = m_num_pixels * m_num_maps; @@ -1998,7 +1998,7 @@ void GSkymap::alloc_pixels(void) * * @param[in] map Sky map. ***************************************************************************/ -void GSkymap::copy_members(const GSkymap& map) +void GSkyMap::copy_members(const GSkyMap& map) { // Copy attributes m_num_pixels = map.m_num_pixels; @@ -2034,7 +2034,7 @@ void GSkymap::copy_members(const GSkymap& map) /***********************************************************************//** * @brief Delete class members ***************************************************************************/ -void GSkymap::free_members(void) +void GSkyMap::free_members(void) { // Free memory if (m_proj != NULL) delete m_proj; @@ -2079,7 +2079,7 @@ void GSkymap::free_members(void) * * @todo Remove cd and pv2 parameters. ***************************************************************************/ -void GSkymap::set_wcs(const std::string& wcs, const std::string& coords, +void GSkyMap::set_wcs(const std::string& wcs, const std::string& coords, const double& crval1, const double& crval2, const double& crpix1, const double& crpix2, const double& cdelt1, const double& cdelt2, @@ -2133,7 +2133,7 @@ void GSkymap::set_wcs(const std::string& wcs, const std::string& coords, * several HEALPix maps into a single column. Alternatively, multiple maps * may be stored in multiple columns. ***************************************************************************/ -void GSkymap::read_healpix(const GFitsTable& table) +void GSkyMap::read_healpix(const GFitsTable& table) { // Determine number of rows and columns in table int nrows = table.nrows(); @@ -2251,7 +2251,7 @@ void GSkymap::read_healpix(const GFitsTable& table) * WCS image has an invalid dimension or covers a too large * range. ***************************************************************************/ -void GSkymap::read_wcs(const GFitsImage& image) +void GSkyMap::read_wcs(const GFitsImage& image) { // Allocate WCS alloc_wcs(image); @@ -2346,7 +2346,7 @@ void GSkymap::read_wcs(const GFitsImage& image) * @exception GException::wcs_invalid * WCS projection of FITS file not supported by GammaLib. ***************************************************************************/ -void GSkymap::alloc_wcs(const GFitsImage& image) +void GSkyMap::alloc_wcs(const GFitsImage& image) { // Get standard keywords std::string ctype1 = image.string("CTYPE1"); @@ -2386,7 +2386,7 @@ void GSkymap::alloc_wcs(const GFitsImage& image) * This method allocates a binary table HDU that contains the Healpix data. * Deallocation of the table has to be done by the client. ***************************************************************************/ -GFitsBinTable* GSkymap::create_healpix_hdu(void) const +GFitsBinTable* GSkyMap::create_healpix_hdu(void) const { // Initialise result to NULL pointer GFitsBinTable* hdu = NULL; @@ -2445,7 +2445,7 @@ GFitsBinTable* GSkymap::create_healpix_hdu(void) const * * @todo Set additional keywords. ***************************************************************************/ -GFitsImageDouble* GSkymap::create_wcs_hdu(void) const +GFitsImageDouble* GSkyMap::create_wcs_hdu(void) const { // Initialise result to NULL pointer GFitsImageDouble* hdu = NULL; @@ -2534,7 +2534,7 @@ GFitsImageDouble* GSkymap::create_wcs_hdu(void) const * a34 * ***************************************************************************/ -double GSkymap::solidangle(const GSkyDir& dir1, const GSkyDir& dir2, +double GSkyMap::solidangle(const GSkyDir& dir1, const GSkyDir& dir2, const GSkyDir& dir3, const GSkyDir& dir4) const { // Initialise solid angle @@ -2622,7 +2622,7 @@ double GSkymap::solidangle(const GSkyDir& dir1, const GSkyDir& dir2, * 3 * ***************************************************************************/ -double GSkymap::solidangle(const GSkyDir& dir1, const GSkyDir& dir2, +double GSkyMap::solidangle(const GSkyDir& dir1, const GSkyDir& dir2, const GSkyDir& dir3) const { // Initialise solid angle @@ -2657,10 +2657,10 @@ double GSkymap::solidangle(const GSkyDir& dir1, const GSkyDir& dir2, * @param[in] map Skymap. * @return Skymap containing the square root of every element. ***************************************************************************/ -GSkymap sqrt(const GSkymap& map) +GSkyMap sqrt(const GSkyMap& map) { // Initialise result vector - GSkymap result(map); + GSkyMap result(map); // Loop over all maps for (int i = 0; i < map.nmaps(); ++i) { diff --git a/src/sky/Makefile.am b/src/sky/Makefile.am index 8b42248..5e9ccdb 100644 --- a/src/sky/Makefile.am +++ b/src/sky/Makefile.am @@ -9,7 +9,7 @@ INCLUDES = -I$(top_srcdir)/include \ sources = GSkyDir.cpp \ GHorizDir.cpp \ GSkyPixel.cpp \ - GSkymap.cpp \ + GSkyMap.cpp \ GSkyRegions.cpp \ GSkyRegion.cpp \ GSkyRegionCircle.cpp \ diff --git a/test/test_GModel.cpp b/test/test_GModel.cpp index e6d1fa9..cdbfe94 100644 --- a/test/test_GModel.cpp +++ b/test/test_GModel.cpp @@ -606,7 +606,7 @@ void TestGModel::test_diffuse_cube(void) // Test skymap value constructor test_try("Test skymap value constructor"); try { - GSkymap map("GAL", 16, "RING", 10); + GSkyMap map("GAL", 16, "RING", 10); GEnergies energies; for (int i = 0; i < 10; ++i) { energies.append(GEnergy(double(i+1.0), "MeV")); @@ -644,7 +644,7 @@ void TestGModel::test_diffuse_cube(void) "Model filename \"Help me!\" expected."); // Test cube method - model.cube(GSkymap("GAL", 16, "RING", 10)); + model.cube(GSkyMap("GAL", 16, "RING", 10)); test_value(model.cube().npix(), 3072); // Test operator access @@ -703,7 +703,7 @@ void TestGModel::test_diffuse_map(void) // Test skymap value constructor test_try("Test skymap value constructor"); try { - GSkymap map("GAL", 16, "RING", 10); + GSkyMap map("GAL", 16, "RING", 10); GModelSpatialDiffuseMap model(map, 3.0); test_value(model.value(), 3.0); test_assert(model.filename() == "", "Expected \"\""); @@ -736,7 +736,7 @@ void TestGModel::test_diffuse_map(void) "Model filename \""+m_map_file+"\" expected."); // Test map method - model.map(GSkymap("GAL", 16, "RING", 10)); + model.map(GSkyMap("GAL", 16, "RING", 10)); test_value(model.map().npix(), 3072); // Test operator access diff --git a/test/test_GSky.cpp b/test/test_GSky.cpp index 21f7cc3..ca8a5ff 100644 --- a/test/test_GSky.cpp +++ b/test/test_GSky.cpp @@ -55,11 +55,11 @@ void TestGSky::set(void){ // Append tests append(static_cast(&TestGSky::test_GWcs),"Test GWcs"); append(static_cast(&TestGSky::test_GSkyPixel),"Test GSkyPixel"); - append(static_cast(&TestGSky::test_GSkymap_healpix_construct),"Test Healpix GSkymap constructors"); - append(static_cast(&TestGSky::test_GSkymap_healpix_io),"Test Healpix GSkymap I/O"); - append(static_cast(&TestGSky::test_GSkymap_wcs_construct),"Test WCS GSkymap constructors"); - append(static_cast(&TestGSky::test_GSkymap_wcs_io),"Test WCS GSkymap I/O"); - append(static_cast(&TestGSky::test_GSkymap),"Test GSkymap"); + append(static_cast(&TestGSky::test_GSkyMap_healpix_construct),"Test Healpix GSkyMap constructors"); + append(static_cast(&TestGSky::test_GSkyMap_healpix_io),"Test Healpix GSkyMap I/O"); + append(static_cast(&TestGSky::test_GSkyMap_wcs_construct),"Test WCS GSkyMap constructors"); + append(static_cast(&TestGSky::test_GSkyMap_wcs_io),"Test WCS GSkyMap I/O"); + append(static_cast(&TestGSky::test_GSkyMap),"Test GSkyMap"); append(static_cast(&TestGSky::test_GSkyRegions_io),"Test GSkyRegions"); append(static_cast(&TestGSky::test_GSkyRegionCircle_construct),"Test GSkyRegionCircle constructors"); append(static_cast(&TestGSky::test_GSkyRegionCircle_logic),"Test GSkyRegionCircle logic"); @@ -511,15 +511,15 @@ void TestGSky::test_GWcs(void) /*************************************************************************** - * @brief GSkymap_healpix_construct + * @brief GSkyMap_healpix_construct ***************************************************************************/ -void TestGSky::test_GSkymap_healpix_construct(void) +void TestGSky::test_GSkyMap_healpix_construct(void) { // Test void constructor test_try("Test void constructor"); try { - GSkymap map; + GSkyMap map; test_try_success(); } catch (std::exception &e) { @@ -529,30 +529,30 @@ void TestGSky::test_GSkymap_healpix_construct(void) // Test correct Healpix constructors test_try("Test correct Healpix constructors"); try { - GSkymap ring1("GAL", 1, "RING", 1); - GSkymap ring2("GAL", 2, "RING", 1); - GSkymap ring4("GAL", 4, "RING", 1); - GSkymap ring8("GAL", 8, "RING", 1); - GSkymap ring16("GAL", 16, "RING", 1); - GSkymap ring32("GAL", 32, "RING", 1); - GSkymap ring64("GAL", 64, "RING", 1); - GSkymap ring128("GAL", 128, "RING", 1); - GSkymap ring256("GAL", 256, "RING", 1); - GSkymap ring512("GAL", 512, "RING", 1); - GSkymap nest1("GAL", 1, "NEST", 1); - GSkymap nest2("GAL", 2, "NEST", 1); - GSkymap nest4("GAL", 4, "NEST", 1); - GSkymap nest8("GAL", 8, "NEST", 1); - GSkymap nest16("GAL", 16, "NEST", 1); - GSkymap nest32("GAL", 32, "NEST", 1); - GSkymap nest64("GAL", 64, "NEST", 1); - GSkymap nest128("GAL", 128, "NEST", 1); - GSkymap nest256("GAL", 256, "NEST", 1); - GSkymap nest512("GAL", 512, "NEST", 1); - GSkymap map1("CEL", 1, "RING", 1); - GSkymap map2("CEL", 1, "RING", 2); - GSkymap map3("EQU", 1, "RING", 1); - GSkymap map4("EQU", 1, "NESTED", 1); + GSkyMap ring1("GAL", 1, "RING", 1); + GSkyMap ring2("GAL", 2, "RING", 1); + GSkyMap ring4("GAL", 4, "RING", 1); + GSkyMap ring8("GAL", 8, "RING", 1); + GSkyMap ring16("GAL", 16, "RING", 1); + GSkyMap ring32("GAL", 32, "RING", 1); + GSkyMap ring64("GAL", 64, "RING", 1); + GSkyMap ring128("GAL", 128, "RING", 1); + GSkyMap ring256("GAL", 256, "RING", 1); + GSkyMap ring512("GAL", 512, "RING", 1); + GSkyMap nest1("GAL", 1, "NEST", 1); + GSkyMap nest2("GAL", 2, "NEST", 1); + GSkyMap nest4("GAL", 4, "NEST", 1); + GSkyMap nest8("GAL", 8, "NEST", 1); + GSkyMap nest16("GAL", 16, "NEST", 1); + GSkyMap nest32("GAL", 32, "NEST", 1); + GSkyMap nest64("GAL", 64, "NEST", 1); + GSkyMap nest128("GAL", 128, "NEST", 1); + GSkyMap nest256("GAL", 256, "NEST", 1); + GSkyMap nest512("GAL", 512, "NEST", 1); + GSkyMap map1("CEL", 1, "RING", 1); + GSkyMap map2("CEL", 1, "RING", 2); + GSkyMap map3("EQU", 1, "RING", 1); + GSkyMap map4("EQU", 1, "NESTED", 1); test_try_success(); } @@ -563,8 +563,8 @@ void TestGSky::test_GSkymap_healpix_construct(void) // Test Healpix copy constructor test_try("Test Healpix copy constructor"); try { - GSkymap ring1("GAL", 1, "RING", 1); - GSkymap ring2 = ring1; + GSkyMap ring1("GAL", 1, "RING", 1); + GSkyMap ring2 = ring1; test_try_success(); } @@ -575,7 +575,7 @@ void TestGSky::test_GSkymap_healpix_construct(void) // Test invalid coordsys in constructor test_try("Test invalid coordsys in constructor"); try { - GSkymap map("HOR", 1, "RING", 1); + GSkyMap map("HOR", 1, "RING", 1); test_try_failure(); } catch (GException::wcs_bad_coords &e) { @@ -588,7 +588,7 @@ void TestGSky::test_GSkymap_healpix_construct(void) // Test invalid nside in constructor test_try("Test invalid nside in constructor"); try { - GSkymap map("GAL", 3, "RING", 1); + GSkyMap map("GAL", 3, "RING", 1); test_try_failure(); } catch (GException::wcs_hpx_bad_nside &e) { @@ -601,7 +601,7 @@ void TestGSky::test_GSkymap_healpix_construct(void) // Test invalid ordering in constructor test_try("Test invalid ordering in constructor"); try { - GSkymap map("GAL", 2, "SPHERICAL", 1); + GSkyMap map("GAL", 2, "SPHERICAL", 1); test_try_failure(); } catch (GException::wcs_hpx_bad_ordering &e) { @@ -615,7 +615,7 @@ void TestGSky::test_GSkymap_healpix_construct(void) // Test invalid nmaps in constructor test_try("Test invalid nmaps in constructor"); try { - GSkymap map("GAL", 2, "NEST", 0); + GSkyMap map("GAL", 2, "NEST", 0); test_try_failure(); } catch (GException::skymap_bad_par &e) { @@ -632,15 +632,15 @@ void TestGSky::test_GSkymap_healpix_construct(void) /*************************************************************************** - * @brief GSkymap_healpix_io + * @brief GSkyMap_healpix_io ***************************************************************************/ -void TestGSky::test_GSkymap_healpix_io(void) +void TestGSky::test_GSkyMap_healpix_io(void) { // Set filenames const std::string file1 = "test_skymap_hpx_1.fits"; // Define Healpix map for comparison - GSkymap refmap("GAL", 4, "RING", 1); + GSkyMap refmap("GAL", 4, "RING", 1); // Test Healpix map saving test_try("Test Healpix map saving"); @@ -658,7 +658,7 @@ void TestGSky::test_GSkymap_healpix_io(void) // Test Healpix map loading test_try("Test Healpix map loading"); try { - GSkymap map; + GSkyMap map; map.load(file1); int diff = 0; for (int pix = 0; pix < refmap.npix(); ++pix) { @@ -678,7 +678,7 @@ void TestGSky::test_GSkymap_healpix_io(void) // Test Healpix map instantiation test_try("Test Healpix map instantiation"); try { - GSkymap map(file1); + GSkyMap map(file1); int diff = 0; for (int pix = 0; pix < refmap.npix(); ++pix) { if (map(pix) != refmap(pix)) @@ -699,9 +699,9 @@ void TestGSky::test_GSkymap_healpix_io(void) /*************************************************************************** - * @brief GSkymap_wcs_construct + * @brief GSkyMap_wcs_construct ***************************************************************************/ -void TestGSky::test_GSkymap_wcs_construct(void) +void TestGSky::test_GSkyMap_wcs_construct(void) { // Set precision double eps = 1.0e-5; @@ -709,7 +709,7 @@ void TestGSky::test_GSkymap_wcs_construct(void) // Test void constructor test_try("Test void constructor"); try { - GSkymap map; + GSkyMap map; test_try_success(); } catch (std::exception &e) { @@ -719,7 +719,7 @@ void TestGSky::test_GSkymap_wcs_construct(void) // Test non-Healpix constructors test_try("Test non-Healpix constructors"); try { - GSkymap map1("CAR", "GAL", 0.0, 0.0, 1.0, 1.0, 100, 100); + GSkyMap map1("CAR", "GAL", 0.0, 0.0, 1.0, 1.0, 100, 100); test_try_success(); } catch (std::exception &e) { @@ -729,7 +729,7 @@ void TestGSky::test_GSkymap_wcs_construct(void) // Test CAR projection test_try("Test CAR projection"); try { - GSkymap map1("CAR", "GAL", 138.817, 37.293, 0.521, 0.931, 100, 100); + GSkyMap map1("CAR", "GAL", 138.817, 37.293, 0.521, 0.931, 100, 100); GSkyDir dir; for (int l = -180; l < 180; ++l) { for (int b = -90; b < 90; ++b) { @@ -755,17 +755,17 @@ void TestGSky::test_GSkymap_wcs_construct(void) /*************************************************************************** - * @brief GSkymap_wcs_io + * @brief GSkyMap_wcs_io ***************************************************************************/ -void TestGSky::test_GSkymap_wcs_io(void) +void TestGSky::test_GSkyMap_wcs_io(void) { // Set filenames const std::string file1 = "test_skymap_wcs_1.fits"; const std::string file2 = "test_skymap_wcs_2.fits"; // Define WCS map for comparison - GSkymap refmap1("CAR", "GAL", 0.0, 0.0, -1.0, 1.0, 100, 100); - GSkymap refmap2("CAR", "CEL", 0.0, 0.0, -0.3, 0.3, 200, 200); + GSkyMap refmap1("CAR", "GAL", 0.0, 0.0, -1.0, 1.0, 100, 100); + GSkyMap refmap2("CAR", "CEL", 0.0, 0.0, -0.3, 0.3, 200, 200); // Test WCS map saving test_try("Test WCS map saving"); @@ -787,7 +787,7 @@ void TestGSky::test_GSkymap_wcs_io(void) // Test WCS map loading (1) test_try("Test WCS map loading (1)"); try { - GSkymap map; + GSkyMap map; map.load(file1); int diff = 0; for (int pix = 0; pix < refmap1.npix(); ++pix) { @@ -807,7 +807,7 @@ void TestGSky::test_GSkymap_wcs_io(void) // Test WCS map loading (2) test_try("Test WCS map loading (2)"); try { - GSkymap map; + GSkyMap map; map.load(file2); int diff = 0; for (int pix = 0; pix < refmap2.npix(); ++pix) { @@ -830,16 +830,16 @@ void TestGSky::test_GSkymap_wcs_io(void) /*************************************************************************** - * @brief GSkymap + * @brief GSkyMap * - * This method tests the GSkymap class. + * This method tests the GSkyMap class. ***************************************************************************/ -void TestGSky::test_GSkymap(void) +void TestGSky::test_GSkyMap(void) { // Define several maps for comparison - GSkymap map_src("CAR", "GAL", 0.0, 0.0, -1.0, 1.0, 10, 10, 2); - GSkymap map_dst("CAR", "GAL", 0.0, 0.0, -0.1, 0.1, 100, 100, 2); - GSkymap map_new("CAR", "GAL", 0.0, 0.0, -0.1, 0.1, 100, 100, 2); + GSkyMap map_src("CAR", "GAL", 0.0, 0.0, -1.0, 1.0, 10, 10, 2); + GSkyMap map_dst("CAR", "GAL", 0.0, 0.0, -0.1, 0.1, 100, 100, 2); + GSkyMap map_new("CAR", "GAL", 0.0, 0.0, -0.1, 0.1, 100, 100, 2); // Fill map pixels double total_src = 0.0; @@ -870,8 +870,8 @@ void TestGSky::test_GSkymap(void) total_dst /= 100.0; total_new /= 100.0; total_ref /= 100.0; - test_value(total_dst, total_ref, 1.0e-3, "Test operator+=(GSkymap)"); - test_value(total_new, total_ref, 1.0e-3, "Test operator+(GSkymap)"); + test_value(total_dst, total_ref, 1.0e-3, "Test operator+=(GSkyMap)"); + test_value(total_new, total_ref, 1.0e-3, "Test operator+(GSkyMap)"); // Subtract pixels from destination map map_new = map_dst - map_src; @@ -887,11 +887,11 @@ void TestGSky::test_GSkymap(void) total_new += map_dst(pix,k); } } - test_value(total_dst, 0.0, 1.0e-3, "Test operator-=(GSkymap)"); - test_value(total_new, 0.0, 1.0e-3, "Test operator-(GSkymap)"); + test_value(total_dst, 0.0, 1.0e-3, "Test operator-=(GSkyMap)"); + test_value(total_new, 0.0, 1.0e-3, "Test operator-(GSkyMap)"); // Check map multiplication - GSkymap test_map = map_src; + GSkyMap test_map = map_src; test_map *= map_src; map_new = map_src * map_src; double total_test = 0.0; @@ -904,8 +904,8 @@ void TestGSky::test_GSkymap(void) total_ref += map_src(pix,k) * map_src(pix,k); } } - test_value(total_test, total_ref, 1.0e-3, "Test operator*=(GSkymap)"); - test_value(total_new, total_ref, 1.0e-3, "Test operator*(GSkymap)"); + test_value(total_test, total_ref, 1.0e-3, "Test operator*=(GSkyMap)"); + test_value(total_new, total_ref, 1.0e-3, "Test operator*(GSkyMap)"); // Check map division test_map = map_src; @@ -921,8 +921,8 @@ void TestGSky::test_GSkymap(void) total_ref += map_src(pix,k) / map_src(pix,k); } } - test_value(total_test, total_ref, 1.0e-3, "Test operator/=(GSkymap)"); - test_value(total_new, total_ref, 1.0e-3, "Test operator/(GSkymap)"); + test_value(total_test, total_ref, 1.0e-3, "Test operator/=(GSkyMap)"); + test_value(total_new, total_ref, 1.0e-3, "Test operator/(GSkyMap)"); // Check map scaling test_map = map_src; @@ -975,7 +975,7 @@ void TestGSky::test_GSkymap(void) map_dst.save("test_map_dst.fits", true); // Test map stacking - GSkymap map_stacked = map_src; + GSkyMap map_stacked = map_src; map_stacked.stack_maps(); double total_stacked = 0.0; for (int pix = 0; pix < map_stacked.npix(); ++pix) { @@ -985,7 +985,7 @@ void TestGSky::test_GSkymap(void) test_value(map_stacked.nmaps(), 1, "Test stack_maps() method"); // Test map number changing - GSkymap map_more = map_src; + GSkyMap map_more = map_src; map_more.nmaps(4); double total_more = 0.0; for (int k = 0; k < map_more.nmaps(); ++k) { @@ -995,7 +995,7 @@ void TestGSky::test_GSkymap(void) } test_value(total_more, total_src, 1.0e-3, "Test nmaps() method with more maps"); test_value(map_more.nmaps(), 4, "Test nmaps() method with more maps"); - GSkymap map_less = map_src; + GSkyMap map_less = map_src; map_less.nmaps(1); double total_less = 0.0; for (int k = 0; k < map_less.nmaps(); ++k) { @@ -1007,7 +1007,7 @@ void TestGSky::test_GSkymap(void) test_value(map_less.nmaps(), 1, "Test nmaps() method with less maps"); // Test map extraction - GSkymap map_extract = map_src.extract(0); + GSkyMap map_extract = map_src.extract(0); double total_extract = 0.0; for (int k = 0; k < map_extract.nmaps(); ++k) { for (int pix = 0; pix < map_extract.npix(); ++pix) { diff --git a/test/test_GSky.hpp b/test/test_GSky.hpp index c5add6e..bcf76d2 100644 --- a/test/test_GSky.hpp +++ b/test/test_GSky.hpp @@ -43,11 +43,11 @@ public: virtual std::string classname(void) const { return "TestGSky"; } void test_GWcs(void); void test_GSkyPixel(void); - void test_GSkymap_healpix_construct(void); - void test_GSkymap_healpix_io(void); - void test_GSkymap_wcs_construct(void); - void test_GSkymap_wcs_io(void); - void test_GSkymap(void); + void test_GSkyMap_healpix_construct(void); + void test_GSkyMap_healpix_io(void); + void test_GSkyMap_wcs_construct(void); + void test_GSkyMap_wcs_io(void); + void test_GSkyMap(void); void test_GSkyRegions_io(void); void test_GSkyRegionCircle_construct(void); void test_GSkyRegionCircle_logic(void); diff --git a/test/test_GSky.py b/test/test_GSky.py index e45d491..cf46a50 100755 --- a/test/test_GSky.py +++ b/test/test_GSky.py @@ -96,7 +96,7 @@ class Test(GPythonTestSuite): dir = pixels.inx2dir(i) inx = pixels.dir2inx(dir) msg = map + " inx2dir/dir2inx check for pixel " + str(i) - err = map + " GSkymap trouble with pixel " + str(i) + " (" + str(inx) + \ + err = map + " GSkyMap trouble with pixel " + str(i) + " (" + str(inx) + \ "), RA=" + str(dir.ra() * 180 / pi) + ", Dec=" + str(dir.dec() * 180 / pi) self.test_assert(i == inx, msg, err) @@ -110,7 +110,7 @@ class Test(GPythonTestSuite): dra -= 2.0 * pi ddec = abs(dir.dec() - dir_new.dec()) msg = map + " dir check for pixel " + str(i) - err = map + " GSkymap trouble with pixel " + str(i) + " (" + str(dra) + \ + err = map + " GSkyMap trouble with pixel " + str(i) + " (" + str(dra) + \ "," + str(ddec) + ")" self.test_assert(not (dra > 1.0e-9 or ddec > 1.0e-9), msg, err) @@ -132,7 +132,7 @@ class Test(GPythonTestSuite): pass # Create skymap - pixels = GSkymap(proj, "CEL", 83.6331, 22.0145, -3.7, 2.6, 5, 5, 20) + pixels = GSkyMap(proj, "CEL", 83.6331, 22.0145, -3.7, 2.6, 5, 5, 20) for map in range(pixels.nmaps()): for i in range(pixels.npix()): pixels[i, map] = i + map * pixels.npix() @@ -161,14 +161,14 @@ class Test(GPythonTestSuite): pass # Create HEALPix skymap - pixels = GSkymap("GAL", 2, "RING", 2) + pixels = GSkyMap("GAL", 2, "RING", 2) for i in range(pixels.npix()): pixels[i] = i + 1.0 pixels[i, 1] = i + 1.0 + 1000.0 pixels.save(file1) # Load HEALPix skymap - pixels = GSkymap(file1) + pixels = GSkyMap(file1) # Control coordinate and pixel transformations self.test_skymap_pixels(pixels, "HEALPix") @@ -184,7 +184,7 @@ class Test(GPythonTestSuite): pixels.save(file2, True) # Load again HEALPix skymap - pixels = GSkymap(file1) + pixels = GSkyMap(file1) # Return return @@ -323,7 +323,7 @@ class Test(GPythonTestSuite): Test the skymap operators. """ # Setup skymaps - map = GSkymap("CAR", "CEL", 83.6331, 22.0145, -3.7, 2.6, 2, 2) + map = GSkyMap("CAR", "CEL", 83.6331, 22.0145, -3.7, 2.6, 2, 2) map[0] = 1.0 map[1] = 2.0 map[2] = 3.0 diff --git a/test/test_healpix_boundaries.py b/test/test_healpix_boundaries.py index 985c1a7..6ecd397 100755 --- a/test/test_healpix_boundaries.py +++ b/test/test_healpix_boundaries.py @@ -23,7 +23,7 @@ import gammalib import matplotlib.pyplot as plt -map = gammalib.GSkymap("GAL", 1, "RING") +map = gammalib.GSkyMap("GAL", 1, "RING") print(map) # Create figures diff --git a/test/test_healpix_flux.py b/test/test_healpix_flux.py index 1369108..1381105 100755 --- a/test/test_healpix_flux.py +++ b/test/test_healpix_flux.py @@ -37,10 +37,10 @@ print("Pixels %d" % npix) for index in range(npix): # Allocate HealPix map - map = gammalib.GSkymap("GAL", nside, "RING") + map = gammalib.GSkyMap("GAL", nside, "RING") # Create WCS map, set Healpix index and merge into WCS map - wcs = gammalib.GSkymap("CAR", "GAL", 0.0, 0.0, -0.1, 0.1, 3600, 1800) + wcs = gammalib.GSkyMap("CAR", "GAL", 0.0, 0.0, -0.1, 0.1, 3600, 1800) map[index] = 1.0 wcs += map diff --git a/test/test_model_spatial_const.py b/test/test_model_spatial_const.py index 58ae1a7..7e5a876 100755 --- a/test/test_model_spatial_const.py +++ b/test/test_model_spatial_const.py @@ -33,7 +33,7 @@ def test_mc(samples=100000): model = gammalib.GModelSpatialDiffuseConst(1.0) # Create WCS map - map = gammalib.GSkymap("AIT", "GAL", 0.0, 0.0, -1.0, 1.0, 360, 180) + map = gammalib.GSkyMap("AIT", "GAL", 0.0, 0.0, -1.0, 1.0, 360, 180) # Set fixed parameters energy = gammalib.GEnergy() diff --git a/test/test_model_spatial_map.py b/test/test_model_spatial_map.py index a47555b..dcc48d8 100755 --- a/test/test_model_spatial_map.py +++ b/test/test_model_spatial_map.py @@ -31,7 +31,7 @@ def eval_model(model, binsz=0.01, nbins=1000): interpolate the skymap into a finer grid. """ # Create CAR skymap - map = GSkymap("CAR", "CEL", 201.3651, -43.0191, binsz, binsz, nbins, nbins) + map = GSkyMap("CAR", "CEL", 201.3651, -43.0191, binsz, binsz, nbins, nbins) # Fill map for i in range(map.npix()): diff --git a/test/test_skymap_flux.py b/test/test_skymap_flux.py index c6d3840..af4edfe 100755 --- a/test/test_skymap_flux.py +++ b/test/test_skymap_flux.py @@ -1,6 +1,6 @@ #! /usr/bin/env python # ========================================================================== -# This script tests the accuracy of the GSkymap flux computation. +# This script tests the accuracy of the GSkyMap flux computation. # # -------------------------------------------------------------------------- # @@ -31,9 +31,9 @@ na = 3600 dr_rad = dr * gammalib.deg2rad da_rad = da * gammalib.deg2rad -# Allocate GSkymap -map = gammalib.GSkymap("CAR", "GAL", 0.0, 0.0, -1.0, 1.0, 360, 180) -#map = gammalib.GSkymap("GAL", 64, "RING") +# Allocate GSkyMap +map = gammalib.GSkyMap("CAR", "GAL", 0.0, 0.0, -1.0, 1.0, 360, 180) +#map = gammalib.GSkyMap("GAL", 64, "RING") # Loop over all pixels for index in range(map.npix()): diff --git a/test/testinst/GTestEventCube.hpp b/test/testinst/GTestEventCube.hpp index c98d5fa..6aada4b 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-2014 by Jean-Baptiste Cayrou * + * copyright (C) 2013-2015 by Jean-Baptiste Cayrou * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -32,7 +32,6 @@ #include #include "GEventCube.hpp" #include "GTestEventBin.hpp" -#include "GSkymap.hpp" #include "GEbounds.hpp" #include "GGti.hpp" #include "GEnergy.hpp"