Commit e4bb6c9f886f60e429ca4cefdf6e95d6ce42d5b0

Authored by Jürgen Knödlseder
1 parent e0123432

Add GSkyMap FITS HDU constructor

ChangeLog
... ... @@ -3,6 +3,7 @@
3 3 * Version 1.2.0 released
4 4 =========================
5 5  
  6 + Add GSkyMap FITS HDU constructor
6 7 Add leap second for 1-1-2017 (#1887)
7 8 Add region() method to GModelSpatial (#1764)
8 9 Add composite spatial and spectral models (#1706)
... ...
... ... @@ -58,6 +58,7 @@ The following methods have been added:
58 58 - gammalib::rstrip_chars()
59 59 - GObservations::save_covmat()
60 60 - GModelSpatial::region()
  61 +- GSkyMap(const GFitsHDU&)
61 62  
62 63 The following methods have been removed:
63 64 - <all classes>::eval_gradients()
... ... @@ -214,6 +215,9 @@ detect the NONE value and will do nothing if no sky map exists (#1835).
214 215 The GSkyMap::is_empty() method signals whether a sky map contains no pixels
215 216 or no maps (#1828).
216 217  
  218 +A FITS HDU constructor was added to the GSkyMap class that allows constructing
  219 +a sky map from a FITS HDU.
  220 +
217 221  
218 222 13. Support module
219 223 ------------------
... ...
include/GSkyMap.hpp
... ... @@ -90,6 +90,7 @@ public:
90 90 // Constructors and destructors
91 91 GSkyMap(void);
92 92 explicit GSkyMap(const GFilename& filename);
  93 + explicit GSkyMap(const GFitsHDU& hdu);
93 94 GSkyMap(const std::string& coords,
94 95 const int& nside,
95 96 const std::string& order,
... ...
pyext/GSkyMap.i
... ... @@ -111,6 +111,7 @@ public:
111 111 // Constructors and destructors
112 112 GSkyMap(void);
113 113 explicit GSkyMap(const GFilename& filename);
  114 + explicit GSkyMap(const GFitsHDU& hdu);
114 115 GSkyMap(const std::string& coords,
115 116 const int& nside,
116 117 const std::string& order,
... ...
src/sky/GSkyMap.cpp
... ... @@ -131,6 +131,27 @@ GSkyMap::GSkyMap(const GFilename&amp; filename)
131 131  
132 132  
133 133 /***********************************************************************//**
  134 + * @brief FITS HDU constructor
  135 + *
  136 + * @param[in] hdu FITS HDU.
  137 + *
  138 + * Constructs a sky map by fetching data from a FITS HDU. See the read()
  139 + * method for more information.
  140 + ***************************************************************************/
  141 +GSkyMap::GSkyMap(const GFitsHDU& hdu)
  142 +{
  143 + // Initialise class members for clean destruction
  144 + init_members();
  145 +
  146 + // Read skymap from HDU
  147 + read(hdu);
  148 +
  149 + // Return
  150 + return;
  151 +}
  152 +
  153 +
  154 +/***********************************************************************//**
134 155 * @brief Healpix sky map constructor
135 156 *
136 157 * @param[in] coords Coordinate System (CEL or GAL).
... ...