Commit c22cb46a26e45324300b71b8b13689aa2dfa7172
1 parent
fa383a4f
initial default implementation of GHealpix class
Showing
7 changed files
with
244 additions
and
2 deletions
include/GHealpix.hpp
0 → 100644
| 1 | +/*************************************************************************** | ||
| 2 | + * GHealpix.hpp - Healpix sky representation class * | ||
| 3 | + * ----------------------------------------------------------------------- * | ||
| 4 | + * copyright : (C) 2008 by Jurgen Knodlseder * | ||
| 5 | + * ----------------------------------------------------------------------- * | ||
| 6 | + * * | ||
| 7 | + * This program is free software; you can redistribute it and/or modify * | ||
| 8 | + * it under the terms of the GNU General Public License as published by * | ||
| 9 | + * the Free Software Foundation; either version 2 of the License, or * | ||
| 10 | + * (at your option) any later version. * | ||
| 11 | + * * | ||
| 12 | + ***************************************************************************/ | ||
| 13 | +/** | ||
| 14 | + * @file GHealpix.hpp | ||
| 15 | + * @brief GHealpix class definition. | ||
| 16 | + * @author J. Knodlseder | ||
| 17 | + */ | ||
| 18 | + | ||
| 19 | +#ifndef GHEALPIX_HPP | ||
| 20 | +#define GHEALPIX_HPP | ||
| 21 | + | ||
| 22 | +/* __ Includes ___________________________________________________________ */ | ||
| 23 | + | ||
| 24 | +/* __ Namespaces _________________________________________________________ */ | ||
| 25 | + | ||
| 26 | + | ||
| 27 | +/***********************************************************************//** | ||
| 28 | + * @class GHealpix | ||
| 29 | + * | ||
| 30 | + * @brief GHealpix class interface defintion | ||
| 31 | + ***************************************************************************/ | ||
| 32 | +class GHealpix { | ||
| 33 | + | ||
| 34 | +public: | ||
| 35 | + // Constructors and destructors | ||
| 36 | + GHealpix(); | ||
| 37 | + GHealpix(const GHealpix& pixels); | ||
| 38 | + virtual ~GHealpix(); | ||
| 39 | + | ||
| 40 | + // Operators | ||
| 41 | + GHealpix& operator= (const GHealpix& pixels); | ||
| 42 | + | ||
| 43 | + // Methods | ||
| 44 | + | ||
| 45 | +protected: | ||
| 46 | + // Protected methods | ||
| 47 | + void init_members(void); | ||
| 48 | + void copy_members(const GHealpix& pixels); | ||
| 49 | + void free_members(void); | ||
| 50 | + GHealpix* clone(void) const; | ||
| 51 | + | ||
| 52 | + // Protected data area | ||
| 53 | +private: | ||
| 54 | +}; | ||
| 55 | + | ||
| 56 | +#endif /* GHEALPIX_HPP */ |
include/Makefile.am
| @@ -3,6 +3,7 @@ pkginclude_HEADERS = GammaLib.hpp \ | @@ -3,6 +3,7 @@ pkginclude_HEADERS = GammaLib.hpp \ | ||
| 3 | GException.hpp \ | 3 | GException.hpp \ |
| 4 | GSkyDir.hpp \ | 4 | GSkyDir.hpp \ |
| 5 | GImage.hpp \ | 5 | GImage.hpp \ |
| 6 | + GHealpix.hpp \ | ||
| 6 | GData.hpp \ | 7 | GData.hpp \ |
| 7 | GResponse.hpp \ | 8 | GResponse.hpp \ |
| 8 | GLATResponse.hpp \ | 9 | GLATResponse.hpp \ |
include/Makefile.in
| @@ -109,6 +109,7 @@ pkginclude_HEADERS = GammaLib.hpp \ | @@ -109,6 +109,7 @@ pkginclude_HEADERS = GammaLib.hpp \ | ||
| 109 | GException.hpp \ | 109 | GException.hpp \ |
| 110 | GSkyDir.hpp \ | 110 | GSkyDir.hpp \ |
| 111 | GImage.hpp \ | 111 | GImage.hpp \ |
| 112 | + GHealpix.hpp \ | ||
| 112 | GData.hpp \ | 113 | GData.hpp \ |
| 113 | GResponse.hpp \ | 114 | GResponse.hpp \ |
| 114 | GLATResponse.hpp \ | 115 | GLATResponse.hpp \ |
src/GHealpix.cpp
0 → 100644
| 1 | +/*************************************************************************** | ||
| 2 | + * GHealpix.cpp - Healpix sky representation class * | ||
| 3 | + * ----------------------------------------------------------------------- * | ||
| 4 | + * copyright : (C) 2008 by Jurgen Knodlseder * | ||
| 5 | + * ----------------------------------------------------------------------- * | ||
| 6 | + * * | ||
| 7 | + * This program is free software; you can redistribute it and/or modify * | ||
| 8 | + * it under the terms of the GNU General Public License as published by * | ||
| 9 | + * the Free Software Foundation; either version 2 of the License, or * | ||
| 10 | + * (at your option) any later version. * | ||
| 11 | + * * | ||
| 12 | + * ----------------------------------------------------------------------- * | ||
| 13 | + ***************************************************************************/ | ||
| 14 | +/** | ||
| 15 | + * @file GHealpix.cpp | ||
| 16 | + * @brief GHealpix class implementation. | ||
| 17 | + * @author J. Knodlseder | ||
| 18 | + */ | ||
| 19 | + | ||
| 20 | +/* __ Includes ___________________________________________________________ */ | ||
| 21 | +#include "GException.hpp" | ||
| 22 | +#include "GHealpix.hpp" | ||
| 23 | + | ||
| 24 | +/* __ Namespaces _________________________________________________________ */ | ||
| 25 | + | ||
| 26 | +/* __ Method name definitions ____________________________________________ */ | ||
| 27 | + | ||
| 28 | +/* __ Macros _____________________________________________________________ */ | ||
| 29 | + | ||
| 30 | +/* __ Coding definitions _________________________________________________ */ | ||
| 31 | + | ||
| 32 | +/* __ Debug definitions __________________________________________________ */ | ||
| 33 | + | ||
| 34 | + | ||
| 35 | + | ||
| 36 | +/*========================================================================== | ||
| 37 | + = = | ||
| 38 | + = GHealpix constructors/destructors = | ||
| 39 | + = = | ||
| 40 | + ==========================================================================*/ | ||
| 41 | + | ||
| 42 | +/***********************************************************************//** | ||
| 43 | + * @brief Constructor | ||
| 44 | + ***************************************************************************/ | ||
| 45 | +GHealpix::GHealpix() | ||
| 46 | +{ | ||
| 47 | + // Initialise class members for clean destruction | ||
| 48 | + init_members(); | ||
| 49 | + | ||
| 50 | + // Return | ||
| 51 | + return; | ||
| 52 | +} | ||
| 53 | + | ||
| 54 | + | ||
| 55 | +/***********************************************************************//** | ||
| 56 | + * @brief Copy constructor | ||
| 57 | + * | ||
| 58 | + * @param pixels GHealpix instance which should be used for construction | ||
| 59 | + ***************************************************************************/ | ||
| 60 | +GHealpix::GHealpix(const GHealpix& pixels) | ||
| 61 | +{ | ||
| 62 | + // Initialise class members for clean destruction | ||
| 63 | + init_members(); | ||
| 64 | + | ||
| 65 | + // Copy members | ||
| 66 | + copy_members(pixels); | ||
| 67 | + | ||
| 68 | + // Return | ||
| 69 | + return; | ||
| 70 | +} | ||
| 71 | + | ||
| 72 | + | ||
| 73 | +/***********************************************************************//** | ||
| 74 | + * @brief Destructor | ||
| 75 | + ***************************************************************************/ | ||
| 76 | +GHealpix::~GHealpix() | ||
| 77 | +{ | ||
| 78 | + // Free members | ||
| 79 | + free_members(); | ||
| 80 | + | ||
| 81 | + // Return | ||
| 82 | + return; | ||
| 83 | +} | ||
| 84 | + | ||
| 85 | + | ||
| 86 | +/*========================================================================== | ||
| 87 | + = = | ||
| 88 | + = GHealpix operators = | ||
| 89 | + = = | ||
| 90 | + ==========================================================================*/ | ||
| 91 | + | ||
| 92 | +/***********************************************************************//** | ||
| 93 | + * @brief Assignment operator | ||
| 94 | + * | ||
| 95 | + * @param[in] pixels GHealpix instance to be assigned | ||
| 96 | + ***************************************************************************/ | ||
| 97 | +GHealpix& GHealpix::operator= (const GHealpix& pixels) | ||
| 98 | +{ | ||
| 99 | + // Execute only if object is not identical | ||
| 100 | + if (this != &pixels) { | ||
| 101 | + | ||
| 102 | + // Free members | ||
| 103 | + free_members(); | ||
| 104 | + | ||
| 105 | + // Initialise private members for clean destruction | ||
| 106 | + init_members(); | ||
| 107 | + | ||
| 108 | + // Copy members | ||
| 109 | + copy_members(pixels); | ||
| 110 | + | ||
| 111 | + } // endif: object was not identical | ||
| 112 | + | ||
| 113 | + // Return this object | ||
| 114 | + return *this; | ||
| 115 | +} | ||
| 116 | + | ||
| 117 | + | ||
| 118 | +/*========================================================================== | ||
| 119 | + = = | ||
| 120 | + = GHealpix public methods = | ||
| 121 | + = = | ||
| 122 | + ==========================================================================*/ | ||
| 123 | + | ||
| 124 | + | ||
| 125 | +/*========================================================================== | ||
| 126 | + = = | ||
| 127 | + = GHealpix private methods = | ||
| 128 | + = = | ||
| 129 | + ==========================================================================*/ | ||
| 130 | + | ||
| 131 | +/***********************************************************************//** | ||
| 132 | + * @brief Initialise class members | ||
| 133 | + ***************************************************************************/ | ||
| 134 | +void GHealpix::init_members(void) | ||
| 135 | +{ | ||
| 136 | + // Initialise members | ||
| 137 | + | ||
| 138 | + // Return | ||
| 139 | + return; | ||
| 140 | +} | ||
| 141 | + | ||
| 142 | + | ||
| 143 | +/***********************************************************************//** | ||
| 144 | + * @brief Copy class members | ||
| 145 | + * | ||
| 146 | + * @param[in] pixels GHealpix instance from which members should be copied | ||
| 147 | + ***************************************************************************/ | ||
| 148 | +void GHealpix::copy_members(const GHealpix& pixels) | ||
| 149 | +{ | ||
| 150 | + // Copy attributes | ||
| 151 | + | ||
| 152 | + // Return | ||
| 153 | + return; | ||
| 154 | +} | ||
| 155 | + | ||
| 156 | + | ||
| 157 | +/***********************************************************************//** | ||
| 158 | + * @brief Delete class members | ||
| 159 | + ***************************************************************************/ | ||
| 160 | +void GHealpix::free_members(void) | ||
| 161 | +{ | ||
| 162 | + // Free memory | ||
| 163 | + | ||
| 164 | + // Mark memory as free | ||
| 165 | + | ||
| 166 | + // Return | ||
| 167 | + return; | ||
| 168 | +} | ||
| 169 | + | ||
| 170 | + | ||
| 171 | +/*========================================================================== | ||
| 172 | + = = | ||
| 173 | + = GHealpix friends = | ||
| 174 | + = = | ||
| 175 | + ==========================================================================*/ | ||
| 176 | + | ||
| 177 | + | ||
| 178 | +/*========================================================================== | ||
| 179 | + = = | ||
| 180 | + = Other functions used by GHealpix = | ||
| 181 | + = = | ||
| 182 | + ==========================================================================*/ |
src/GImage.cpp
| @@ -55,7 +55,7 @@ GImage::GImage() | @@ -55,7 +55,7 @@ GImage::GImage() | ||
| 55 | /***********************************************************************//** | 55 | /***********************************************************************//** |
| 56 | * @brief Copy constructor | 56 | * @brief Copy constructor |
| 57 | * | 57 | * |
| 58 | - * @param data GImage instance which should be used for construction | 58 | + * @param image GImage instance which should be used for construction |
| 59 | ***************************************************************************/ | 59 | ***************************************************************************/ |
| 60 | GImage::GImage(const GImage& image) | 60 | GImage::GImage(const GImage& image) |
| 61 | { | 61 | { |
src/Makefile.am
| @@ -13,6 +13,7 @@ files = GException.cpp \ | @@ -13,6 +13,7 @@ files = GException.cpp \ | ||
| 13 | GSkyDir.cpp \ | 13 | GSkyDir.cpp \ |
| 14 | GNodeArray.cpp \ | 14 | GNodeArray.cpp \ |
| 15 | GImage.cpp \ | 15 | GImage.cpp \ |
| 16 | + GHealpix.cpp \ | ||
| 16 | data/GData.cpp \ | 17 | data/GData.cpp \ |
| 17 | rsp/GResponse.cpp \ | 18 | rsp/GResponse.cpp \ |
| 18 | rsp/GLATResponse.cpp \ | 19 | rsp/GLATResponse.cpp \ |
src/Makefile.in
| @@ -118,6 +118,7 @@ files = GException.cpp \ | @@ -118,6 +118,7 @@ files = GException.cpp \ | ||
| 118 | GSkyDir.cpp \ | 118 | GSkyDir.cpp \ |
| 119 | GNodeArray.cpp \ | 119 | GNodeArray.cpp \ |
| 120 | GImage.cpp \ | 120 | GImage.cpp \ |
| 121 | + GHealpix.cpp \ | ||
| 121 | data/GData.cpp \ | 122 | data/GData.cpp \ |
| 122 | rsp/GResponse.cpp \ | 123 | rsp/GResponse.cpp \ |
| 123 | rsp/GLATResponse.cpp \ | 124 | rsp/GLATResponse.cpp \ |
| @@ -166,7 +167,7 @@ LTLIBRARIES = $(lib_LTLIBRARIES) | @@ -166,7 +167,7 @@ LTLIBRARIES = $(lib_LTLIBRARIES) | ||
| 166 | 167 | ||
| 167 | libgamma_la_LIBADD = | 168 | libgamma_la_LIBADD = |
| 168 | am__objects_1 = GException.lo GTools.lo GSkyDir.lo GNodeArray.lo \ | 169 | am__objects_1 = GException.lo GTools.lo GSkyDir.lo GNodeArray.lo \ |
| 169 | - GImage.lo GData.lo GResponse.lo GLATResponse.lo \ | 170 | + GImage.lo GHealpix.lo GData.lo GResponse.lo GLATResponse.lo \ |
| 170 | GLATResponseTable.lo GLATAeff.lo GLATPsf.lo GLATEdisp.lo \ | 171 | GLATResponseTable.lo GLATAeff.lo GLATPsf.lo GLATEdisp.lo \ |
| 171 | GObservation.lo GLATObservation.lo GFitsHeaderCard.lo \ | 172 | GObservation.lo GLATObservation.lo GFitsHeaderCard.lo \ |
| 172 | GFitsHeader.lo GFitsData.lo GFitsImage.lo GFitsDblImage.lo \ | 173 | GFitsHeader.lo GFitsData.lo GFitsImage.lo GFitsDblImage.lo \ |