Commit e4bb6c9f886f60e429ca4cefdf6e95d6ce42d5b0
1 parent
e0123432
Add GSkyMap FITS HDU constructor
Showing
5 changed files
with
28 additions
and
0 deletions
ChangeLog
NEWS
| ... | ... | @@ -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
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& 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). | ... | ... |