Commit 4d0d96aba2dc22a6eea023d6a94c467b8d634638

Authored by Pierrick Martin
1 parent 6b89b8ff

Created header file for GSkyRegionMap class.

Showing 1 changed file with 97 additions and 0 deletions
include/GSkyRegionMap.hpp 0 → 100644
  1 +/***************************************************************************
  2 + * GSkyRegionMap.hpp - sky map region class *
  3 + * ----------------------------------------------------------------------- *
  4 + * copyright (C) 2013 by Michael Mayer *
  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 3 of the License, or *
  10 + * (at your option) any later version. *
  11 + * *
  12 + * This program is distributed in the hope that it will be useful, *
  13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  15 + * GNU General Public License for more details. *
  16 + * *
  17 + * You should have received a copy of the GNU General Public License *
  18 + * along with this program. If not, see <http://www.gnu.org/licenses/>. *
  19 + * *
  20 + ***************************************************************************/
  21 +/**
  22 + * @file GSkyRegionMap.hpp
  23 + * @brief Circular sky region class interface definition
  24 + * @author Pierrick Martin and Anneli Schulz
  25 + */
  26 +
  27 +#ifndef GSKYREGIONMAP_HPP
  28 +#define GSKYREGIONMAP_HPP
  29 +
  30 +/* __ Includes ___________________________________________________________ */
  31 +#include <vector>
  32 +#include <string>
  33 +#include "GMath.hpp"
  34 +#include "GSkyDir.hpp"
  35 +#include "GSkyRegion.hpp"
  36 +
  37 +
  38 +/***********************************************************************//**
  39 + * @class GSkyRegionMap
  40 + *
  41 + * @brief Interface for a sky region in the form of a map
  42 + *
  43 + * This class provides an implementation for a sky region defined by a skymap.
  44 + * The map is provided as a FITS file filled with 0 and 1 (or non-zero) values.
  45 + *
  46 + ***************************************************************************/
  47 +class GSkyRegionMap : public GSkyRegion {
  48 +
  49 +public:
  50 + // Constructors and destructors
  51 + GSkyRegionMap(void);
  52 + GSkyRegionMap(const GFits& file);
  53 + GSkyRegionMap(const GFitsHDU& hdu);
  54 + GSkyRegionMap(const GSkyRegionMap& map);
  55 + virtual ~GSkyRegionMap(void);
  56 +
  57 + // Operators
  58 + GSkyRegionMap& operator=(const GSkyRegionMap& map);
  59 +
  60 + // Implemented methods
  61 + void clear(void);
  62 + GSkyRegionMap* clone(void) const;
  63 + void load(const GFits& file);
  64 + void read(const GFitsHDU& hdu);
  65 + const GSkymap* map(void) const;
  66 + bool contains(const GSkyDir& dir) const;
  67 + bool contains(const GSkyRegion& reg) const;
  68 + bool overlaps(const GSkyRegion& reg) const;
  69 + std::string print(const GChatter& chatter = NORMAL) const;
  70 +
  71 +protected:
  72 + // Protected methods
  73 + void init_members(void);
  74 + void copy_members(const GSkyRegionMap& region);
  75 + void free_members(void);
  76 + void compute_solid_angle(void);
  77 +
  78 + // Protected members
  79 + GSkymap m_map; //!< The map
  80 +
  81 +};
  82 +
  83 +
  84 +/***********************************************************************//**
  85 + * @brief Return the map
  86 + *
  87 + * @return GSkymap object.
  88 + *
  89 + * Returns the map.
  90 + ***************************************************************************/
  91 +inline
  92 +double GSkyRegionMap::dec(void) const
  93 +{
  94 + return (m_map);
  95 +}
  96 +
  97 +#endif /* GSKYREGIONMAP_HPP */
... ...