GammaLib 2.1.0.dev
Loading...
Searching...
No Matches
GSkyMap.hpp
Go to the documentation of this file.
1/***************************************************************************
2 * GSkyMap.hpp - Sky map class *
3 * ----------------------------------------------------------------------- *
4 * copyright (C) 2010-2024 by Juergen Knoedlseder *
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 GSkyMap.hpp
23 * @brief Sky map class definition
24 * @author Juergen Knoedlseder
25 */
26
27#ifndef GSKYMAP_HPP
28#define GSKYMAP_HPP
29
30/* __ Includes ___________________________________________________________ */
31#include <string>
32#include <vector>
33#include "GBase.hpp"
34#include "GSkyDir.hpp"
35#include "GSkyPixel.hpp"
36#include "GSkyProjection.hpp"
37#include "GBilinear.hpp"
38#include "GNdarray.hpp"
39
40/* __ Forward declarations _______________________________________________ */
41class GFilename;
42class GFits;
43class GFitsHDU;
44class GFitsTable;
45class GFitsBinTable;
46class GFitsImage;
48class GMatrix;
49class GVector;
50class GSkyRegion;
52class GSkyRegions;
53
54
55/***********************************************************************//**
56 * @class GSkyMap
57 *
58 * @brief Sky map class
59 *
60 * This class implements a sky maps. Sky maps are collections of pixels that
61 * define a quantity as function of pixel location. Typical quantities are
62 * gamma-ray intensities, but may also be the number of measured counts.
63 *
64 * Sky map pixels may be arranged in a 2-dimensional grid or in a linear
65 * 1-dimensional sequence. The link between pixel index and sky direction
66 * on the celestial sphere is established using a projection, implemented
67 * by the GSkyProjection class. 2-dimensional grids are represented by
68 * World Coordinate Systems. All World Coordinate Systems derive from GWcs
69 * and are registered in GWcsRegistry. The Healpix pixelisation, implemented
70 * by the GHealpix class, is the only 1-dimensional grid that is so far
71 * available.
72 *
73 * Sky map pixels may be accessed by their linear index, by pixel or by
74 * sky direction. While the index and pixel access return the sky map value
75 * at the pixel centre, the sky direction access operator performs an
76 * interpolation to the exact sky direction.
77 *
78 * Conversion methods exist to convert between the linear index, the pixel
79 * and the sky direction:
80 *
81 * GSkyPixel pixel = map.inx2pix(index); // Index to pixel
82 * GSkyDir dir = map.inx2dir(index); // Index to sky direction
83 * GSkyDir dir = map.pix2dir(pixel); // Pixel to sky direction
84 * int index = map.pix2inx(pixel); // Pixel to index
85 * int index = map.dir2inx(dir); // Sky direction to index
86 * GSkyPixel pixel = map.dir2pix(dir); // Sky direction to pixel
87 *
88 ***************************************************************************/
89class GSkyMap : public GBase {
90
91 friend GSkyMap sqrt(const GSkyMap& map);
92 friend GSkyMap log(const GSkyMap& map);
93 friend GSkyMap log10(const GSkyMap& map);
94 friend GSkyMap abs(const GSkyMap& map);
95 friend GSkyMap sign(const GSkyMap& map);
96 friend GSkyMap clip(const GSkyMap& map, const double& thresh);
97 friend bool operator==(const GSkyMap &a, const GSkyMap &b);
98 friend bool operator!=(const GSkyMap &a, const GSkyMap &b);
99
100public:
101 // Constructors and destructors
102 GSkyMap(void);
103 explicit GSkyMap(const GFilename& filename);
104 explicit GSkyMap(const GFitsHDU& hdu);
105 GSkyMap(const std::string& coords,
106 const int& nside,
107 const std::string& order,
108 const int& nmaps = 1);
109 GSkyMap(const std::string& wcs,
110 const std::string& coords,
111 const double& x,
112 const double& y,
113 const double& dx,
114 const double& dy,
115 const int& nx,
116 const int& ny,
117 const int& nmaps = 1);
118 GSkyMap(const GSkyMap& map);
119 virtual ~GSkyMap(void);
120
121 // Operators
122 GSkyMap& operator=(const GSkyMap& map);
123 GSkyMap& operator=(const double& value);
124 GSkyMap& operator+=(const GSkyMap& map);
125 GSkyMap& operator+=(const double& value);
126 GSkyMap& operator-=(const GSkyMap& map);
127 GSkyMap& operator-=(const double& value);
128 GSkyMap& operator*=(const GSkyMap& map);
129 GSkyMap& operator*=(const double& factor);
130 GSkyMap& operator/=(const GSkyMap& map);
131 GSkyMap& operator/=(const double& factor);
132 GSkyMap operator+(const GSkyMap& map) const;
133 GSkyMap operator-(const GSkyMap& map) const;
134 GSkyMap operator*(const GSkyMap& map) const;
135 GSkyMap operator*(const double& factor) const;
136 GSkyMap operator/(const GSkyMap& map) const;
137 GSkyMap operator/(const double& factor) const;
138 double& operator()(const int& index, const int& map = 0);
139 const double& operator()(const int& index, const int& map = 0) const;
140 double& operator()(const GSkyPixel& pixel, const int& map = 0);
141 const double& operator()(const GSkyPixel& pixel, const int& map = 0) const;
142 double operator()(const GSkyDir& dir, const int& map = 0) const;
143
144 // Methods
145 void clear(void);
146 GSkyMap* clone(void) const;
147 std::string classname(void) const;
148 bool is_empty(void) const;
149 const int& npix(void) const;
150 const int& nx(void) const;
151 const int& ny(void) const;
152 const int& nmaps(void) const;
153 void nmaps(const int& nmaps);
154 const std::vector<int>& shape(void) const;
155 void shape(const int& s1);
156 void shape(const int& s1, const int& s2);
157 void shape(const int& s1, const int& s2, const int& s3);
158 void shape(const std::vector<int>& shape);
159 int ndim(void) const;
160 GSkyPixel inx2pix(const int& index) const;
161 GSkyDir inx2dir(const int& index) const;
162 GSkyDir pix2dir(const GSkyPixel& pixel) const;
163 int pix2inx(const GSkyPixel& pixel) const;
164 int dir2inx(const GSkyDir& dir) const;
165 GSkyPixel dir2pix(const GSkyDir& dir) const;
166 GNdarray counts(void) const;
167 double flux(const int& index, const int& map = 0) const;
168 double flux(const GSkyPixel& pixel, const int& map = 0) const;
169 double flux(const GSkyRegion& region, const int& map = 0) const;
170 double flux(const GSkyRegions& regions, const int& map = 0) const;
171 GNdarray flux(void) const;
172 double solidangle(const int& index) const;
173 double solidangle(const GSkyPixel& pixel) const;
174 double solidangle(const GSkyRegion& region) const;
175 double solidangle(const GSkyRegions& regions) const;
176 bool contains(const GSkyDir& dir) const;
177 bool contains(const GSkyPixel& pixel) const;
178 bool overlaps(const GSkyRegion& region) const;
179 void smooth(const std::string& kernel,
180 const double& par);
181 void correlate(const std::string& kernel,
182 const double& par);
183 const GSkyProjection* projection(void) const;
184 void projection(const GSkyProjection& proj);
185 const double* pixels(void) const;
186 GSkyMap extract(const int& map, const int& nmaps = 1) const;
187 GSkyMap extract(const int& startx, const int& stopx,
188 const int& starty, const int& stopy) const;
189 GSkyMap extract(const GSkyRegions& inclusions) const;
190 void stack_maps(void);
192 void load(const GFilename& filename);
193 void save(const GFilename& filename,
194 const bool& clobber = false) const;
195 void read(const GFitsHDU& hdu);
196 GFitsHDU* write(GFits& file,
197 const std::string& extname = "") const;
198 void publish(const std::string& name = "") const;
199 std::string print(const GChatter& chatter = NORMAL) const;
200
201private:
202 // Private methods
203 void init_members(void);
204 void copy_members(const GSkyMap& map);
205 void free_members(void);
206 void set_wcs(const std::string& wcs, const std::string& coords,
207 const double& crval1, const double& crval2,
208 const double& crpix1, const double& crpix2,
209 const double& cdelt1, const double& cdelt2);
210 void read_healpix(const GFitsTable& table);
211 void read_wcs(const GFitsImage& image);
212 void alloc_wcs(const GFitsImage& image);
214 GFitsImageDouble* create_wcs_hdu(void) const;
215 double solidangle(const GSkyDir& dir1, const GSkyDir& dir2,
216 const GSkyDir& dir3) const;
217 double solidangle(const GSkyDir& dir1, const GSkyDir& dir2,
218 const GSkyDir& dir3, const GSkyDir& dir4) const;
219 bool overlaps_circle(const GSkyRegionCircle& region) const;
220 bool is_healpix(const GFitsHDU& hdu) const;
221 bool is_wcs(const GFitsHDU& hdu) const;
222 bool is_same(const GSkyMap& map) const;
223 void convolve(const std::string& kernel,
224 const double& par,
225 const bool& normalise);
226 GNdarray convolution_kernel(const std::string& kernel,
227 const double& par,
228 const bool& normalise) const;
229
230 // Private data area
231 int m_num_pixels; //!< Number of pixels (used for pixel allocation)
232 int m_num_maps; //!< Number of maps (used for pixel allocation)
233 int m_num_x; //!< Number of pixels in x direction (only 2D)
234 int m_num_y; //!< Number of pixels in y direction (only 2D)
235 std::vector<int> m_shape; //!< Shape of the maps
236 GSkyProjection* m_proj; //!< Pointer to sky projection
237 GNdarray m_pixels; //!< Skymap pixels
238
239 // Computation cache
240 mutable bool m_hascache; //!< Cache is valid
241 mutable bool m_contained; //!< Sky direction is contained in map
242 mutable GSkyDir m_last_dir; //!< Last sky direction
243 mutable GBilinear m_interpol; //!< Bilinear interpolator
244};
245
246
247/***********************************************************************//**
248 * @brief Binary sky map addition
249 *
250 * @param[in] map Sky map.
251 * @return Sky map to which @p map was added.
252 *
253 * Returns the sum of two sky maps.
254 ***************************************************************************/
255inline
257{
258 GSkyMap result = *this;
259 result += map;
260 return result;
261}
262
263
264/***********************************************************************//**
265 * @brief Binary sky map subtraction
266 *
267 * @param[in] map Sky map.
268 * @return Sky map to which @p map was added.
269 *
270 * Returns the difference of two sky maps.
271 ***************************************************************************/
272inline
274{
275 GSkyMap result = *this;
276 result -= map;
277 return result;
278}
279
280
281/***********************************************************************//**
282 * @brief Binary sky map multiplication
283 *
284 * @param[in] map Sky map.
285 * @return Sky map multiplied by @p map.
286 *
287 * Returns the product of two sky maps.
288 ***************************************************************************/
289inline
291{
292 GSkyMap result = *this;
293 result *= map;
294 return result;
295}
296
297
298/***********************************************************************//**
299 * @brief Sky map scalar multiplication
300 *
301 * @param[in] factor Scalar.
302 * @return Sky map multiplied by @p factor.
303 *
304 * Returns the product of a sky map with a factor.
305 ***************************************************************************/
306inline
307GSkyMap GSkyMap::operator*(const double& factor) const
308{
309 GSkyMap result = *this;
310 result *= factor;
311 return result;
312}
313
314
315/***********************************************************************//**
316 * @brief Binary sky map division
317 *
318 * @param[in] map Sky map.
319 * @return Sky map divided by @p map.
320 *
321 * Returns the ratio of two sky maps.
322 ***************************************************************************/
323inline
325{
326 GSkyMap result = *this;
327 result /= map;
328 return result;
329}
330
331
332/***********************************************************************//**
333 * @brief Sky map scalar division
334 *
335 * @param[in] factor Scalar.
336 * @return Sky map divided by @p factor.
337 *
338 * Divides a sky map by a factor.
339 ***************************************************************************/
340inline
341GSkyMap GSkyMap::operator/(const double& factor) const
342{
343 GSkyMap result = *this;
344 result /= factor;
345 return result;
346}
347
348
349/***********************************************************************//**
350 * @brief Return class name
351 *
352 * @return String containing the class name ("GSkyMap").
353 ***************************************************************************/
354inline
355std::string GSkyMap::classname(void) const
356{
357 return ("GSkyMap");
358}
359
360
361/***********************************************************************//**
362 * @brief Signals if sky map is empty
363 *
364 * @return True if sky map is empty, false otherwise.
365 *
366 * Signals if a sky map has no pixels or maps.
367 ***************************************************************************/
368inline
369bool GSkyMap::is_empty(void) const
370{
371 return ((m_num_pixels == 0) || (m_num_maps == 0));
372}
373
374
375/***********************************************************************//**
376 * @brief Returns number of pixels
377 *
378 * @return Number of pixels in one sky map.
379 *
380 * Returns the number of pixels in one sky map.
381 ***************************************************************************/
382inline
383const int& GSkyMap::npix(void) const
384{
385 return m_num_pixels;
386}
387
388
389/***********************************************************************//**
390 * @brief Returns number of pixels in x coordinate
391 *
392 * @return Number of pixels in the X direction.
393 *
394 * Returns the number of pixels in the X direction. If the sky map is a
395 * one dimensional array (which is the case for the Healpix projection),
396 * the method returns 0.
397 ***************************************************************************/
398inline
399const int& GSkyMap::nx(void) const
400{
401 return m_num_x;
402}
403
404
405/***********************************************************************//**
406 * @brief Returns number of pixels in y coordinate
407 *
408 * @return Number of pixels in the Y direction.
409 *
410 * Returns the number of pixels in the Y direction. If the sky map is a
411 * one dimensional array (which is the case for the Healpix projection),
412 * the method returns 0.
413 ***************************************************************************/
414inline
415const int& GSkyMap::ny(void) const
416{
417 return m_num_y;
418}
419
420
421/***********************************************************************//**
422 * @brief Returns number of maps
423 *
424 * @return Number of maps in the sky map object.
425 ***************************************************************************/
426inline
427const int& GSkyMap::nmaps(void) const
428{
429 return m_num_maps;
430}
431
432
433/***********************************************************************//**
434 * @brief Returns shape of maps
435 *
436 * @return Shape of maps in the sky map object.
437 ***************************************************************************/
438inline
439const std::vector<int>& GSkyMap::shape(void) const
440{
441 return m_shape;
442}
443
444
445/***********************************************************************//**
446 * @brief Returns dimension of maps
447 *
448 * @return Number of map dimensions.
449 ***************************************************************************/
450inline
451int GSkyMap::ndim(void) const
452{
453 return (int)m_shape.size();
454}
455
456
457/***********************************************************************//**
458 * @brief Smooth sky map
459 *
460 * @param[in] kernel Smoothing kernel type ("DISK", "GAUSSIAN").
461 * @param[in] par Smoothing parameter.
462 *
463 * Smoothes all sky maps using the specified @p kernel and a smoothing
464 * parameter. For the "DISK" kernel the smoothing parameter is the disk
465 * radius in degrees. For the "GAUSSIAN" kernel the smoothing parameter is
466 * the Gaussian sigma in degrees.
467 ***************************************************************************/
468inline
469void GSkyMap::smooth(const std::string& kernel, const double& par)
470{
471 convolve(kernel, par, true);
472 return;
473}
474
475
476/***********************************************************************//**
477 * @brief Correlates sky map
478 *
479 * @param[in] kernel Correlation kernel type ("DISK", "GAUSSIAN").
480 * @param[in] par Correlation parameter.
481 *
482 * Correlates all sky maps using the specified @p kernel and a correlation
483 * parameter. For the "DISK" kernel the correlation parameter is the disk
484 * radius in degrees. For the "GAUSSIAN" kernel the correlation parameter is
485 * the Gaussian sigma in degrees.
486 ***************************************************************************/
487inline
488void GSkyMap::correlate(const std::string& kernel, const double& par)
489{
490 convolve(kernel, par, false);
491 return;
492}
493
494
495/***********************************************************************//**
496 * @brief Returns pointer to sky projection
497 *
498 * @return Pointer to sky projection (NULL if no projection is defined).
499 ***************************************************************************/
500inline
502{
503 return m_proj;
504}
505
506
507/***********************************************************************//**
508 * @brief Returns pointer to pixel data
509 *
510 * @return Pointer to pixel data.
511 ***************************************************************************/
512inline
513const double* GSkyMap::pixels(void) const
514{
515 return (m_pixels.data());
516}
517
518#endif /* GSKYMAP_HPP */
Definition of interface for all GammaLib classes.
Bilinear interpolator class interface definition.
N-dimensional array class interface definition.
Sky direction class interface definition.
Sky map pixel class definition.
Abstract sky projection base class definition.
GChatter
Definition GTypemaps.hpp:33
@ NORMAL
Definition GTypemaps.hpp:36
Interface class for all GammaLib classes.
Definition GBase.hpp:52
Bilinear interpolator class.
Definition GBilinear.hpp:40
Filename class.
Definition GFilename.hpp:62
FITS binary table class.
Abstract FITS extension base class.
Definition GFitsHDU.hpp:51
Double precision FITS image class.
Abstract FITS image base class.
Abstract interface for FITS table.
FITS file class.
Definition GFits.hpp:63
Generic matrix class definition.
Definition GMatrix.hpp:79
N-dimensional array class.
Definition GNdarray.hpp:44
const double * data(void) const
Data access method (const version)
Definition GNdarray.hpp:389
Sky direction class.
Definition GSkyDir.hpp:62
Sky map class.
Definition GSkyMap.hpp:89
friend bool operator!=(const GSkyMap &a, const GSkyMap &b)
Non-equality operator.
Definition GSkyMap.cpp:4196
GSkyMap & operator*=(const GSkyMap &map)
Multiplication operator.
Definition GSkyMap.cpp:578
friend GSkyMap sqrt(const GSkyMap &map)
Computes square root of sky map elements.
Definition GSkyMap.cpp:3930
friend GSkyMap clip(const GSkyMap &map, const double &thresh)
Clips map at given value.
Definition GSkyMap.cpp:4128
GSkyMap operator-(const GSkyMap &map) const
Binary sky map subtraction.
Definition GSkyMap.hpp:273
void smooth(const std::string &kernel, const double &par)
Smooth sky map.
Definition GSkyMap.hpp:469
GSkyDir m_last_dir
Last sky direction.
Definition GSkyMap.hpp:242
void 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)
Set World Coordinate System.
Definition GSkyMap.cpp:2946
double solidangle(const int &index) const
Returns solid angle of pixel.
Definition GSkyMap.cpp:1858
int ndim(void) const
Returns dimension of maps.
Definition GSkyMap.hpp:451
const int & nmaps(void) const
Returns number of maps.
Definition GSkyMap.hpp:427
void read_healpix(const GFitsTable &table)
Read Healpix data from FITS table.
Definition GSkyMap.cpp:3008
GSkyMap & operator+=(const GSkyMap &map)
Map addition operator.
Definition GSkyMap.cpp:398
int m_num_maps
Number of maps (used for pixel allocation)
Definition GSkyMap.hpp:232
void clear(void)
Clear instance.
Definition GSkyMap.cpp:1100
void stack_maps(void)
Stack all maps into a single map.
Definition GSkyMap.cpp:2341
bool is_same(const GSkyMap &map) const
Check if map is the same.
Definition GSkyMap.cpp:3675
GBilinear m_interpol
Bilinear interpolator.
Definition GSkyMap.hpp:243
GSkyRegionCircle region_circle(void) const
Return sky region circle that encloses the sky map.
Definition GSkyMap.cpp:2401
GSkyDir inx2dir(const int &index) const
Returns sky direction of pixel.
Definition GSkyMap.cpp:1331
void alloc_wcs(const GFitsImage &image)
Allocate WCS class.
Definition GSkyMap.cpp:3228
GSkyMap operator+(const GSkyMap &map) const
Binary sky map addition.
Definition GSkyMap.hpp:256
GSkyProjection * m_proj
Pointer to sky projection.
Definition GSkyMap.hpp:236
GNdarray convolution_kernel(const std::string &kernel, const double &par, const bool &normalise) const
Return convolution kernel.
Definition GSkyMap.cpp:3813
bool is_empty(void) const
Signals if sky map is empty.
Definition GSkyMap.hpp:369
void read_wcs(const GFitsImage &image)
Read WCS image from FITS HDU.
Definition GSkyMap.cpp:3140
int m_num_y
Number of pixels in y direction (only 2D)
Definition GSkyMap.hpp:234
double & operator()(const int &index, const int &map=0)
Pixel index access operator.
Definition GSkyMap.cpp:789
void save(const GFilename &filename, const bool &clobber=false) const
Save sky map into FITS file.
Definition GSkyMap.cpp:2611
void correlate(const std::string &kernel, const double &par)
Correlates sky map.
Definition GSkyMap.hpp:488
friend bool operator==(const GSkyMap &a, const GSkyMap &b)
Equality operator.
Definition GSkyMap.cpp:4178
int dir2inx(const GSkyDir &dir) const
Returns pixel index for a given sky direction.
Definition GSkyMap.cpp:1445
GSkyMap extract(const int &map, const int &nmaps=1) const
Extract maps into a new sky map object.
Definition GSkyMap.cpp:2139
bool is_healpix(const GFitsHDU &hdu) const
Check if HDU contains HEALPix data.
Definition GSkyMap.cpp:3624
const int & nx(void) const
Returns number of pixels in x coordinate.
Definition GSkyMap.hpp:399
void read(const GFitsHDU &hdu)
Read skymap from FITS HDU.
Definition GSkyMap.cpp:2664
void copy_members(const GSkyMap &map)
Copy class members.
Definition GSkyMap.cpp:2884
void convolve(const std::string &kernel, const double &par, const bool &normalise)
Convolve sky map.
Definition GSkyMap.cpp:3756
friend GSkyMap log(const GSkyMap &map)
Computes the natural logarithm of sky map elements.
Definition GSkyMap.cpp:3970
const int & npix(void) const
Returns number of pixels.
Definition GSkyMap.hpp:383
GSkyMap & operator/=(const GSkyMap &map)
Division operator.
Definition GSkyMap.cpp:672
friend GSkyMap log10(const GSkyMap &map)
Computes the base 10 logarithm of sky map elements.
Definition GSkyMap.cpp:4010
GNdarray counts(void) const
Returns array with total number of counts for count maps.
Definition GSkyMap.cpp:1496
GSkyMap * clone(void) const
Clone sky map.
Definition GSkyMap.cpp:1118
GNdarray flux(void) const
Returns array with total flux for sky maps.
Definition GSkyMap.cpp:1820
const int & ny(void) const
Returns number of pixels in y coordinate.
Definition GSkyMap.hpp:415
GSkyMap operator/(const GSkyMap &map) const
Binary sky map division.
Definition GSkyMap.hpp:324
int m_num_x
Number of pixels in x direction (only 2D)
Definition GSkyMap.hpp:233
const GSkyProjection * projection(void) const
Returns pointer to sky projection.
Definition GSkyMap.hpp:501
GFitsHDU * write(GFits &file, const std::string &extname="") const
Write sky map into FITS file.
Definition GSkyMap.cpp:2697
int m_num_pixels
Number of pixels (used for pixel allocation)
Definition GSkyMap.hpp:231
bool m_contained
Sky direction is contained in map.
Definition GSkyMap.hpp:241
GSkyDir pix2dir(const GSkyPixel &pixel) const
Returns sky direction of pixel.
Definition GSkyMap.cpp:1360
friend GSkyMap sign(const GSkyMap &map)
Computes the sign value of sky map elements.
Definition GSkyMap.cpp:4086
GSkyMap(void)
Void constructor.
Definition GSkyMap.cpp:116
const std::vector< int > & shape(void) const
Returns shape of maps.
Definition GSkyMap.hpp:439
void free_members(void)
Delete class members.
Definition GSkyMap.cpp:2911
GSkyMap & operator-=(const GSkyMap &map)
Map subtraction operator.
Definition GSkyMap.cpp:488
bool is_wcs(const GFitsHDU &hdu) const
Check if HDU contains WCS data.
Definition GSkyMap.cpp:3650
GSkyMap & operator=(const GSkyMap &map)
Assignment operator.
Definition GSkyMap.cpp:337
void publish(const std::string &name="") const
Publish sky map.
Definition GSkyMap.cpp:2750
std::string classname(void) const
Return class name.
Definition GSkyMap.hpp:355
GSkyMap operator*(const GSkyMap &map) const
Binary sky map multiplication.
Definition GSkyMap.hpp:290
virtual ~GSkyMap(void)
Destructor.
Definition GSkyMap.cpp:313
void load(const GFilename &filename)
Load skymap from FITS file.
Definition GSkyMap.cpp:2511
friend GSkyMap abs(const GSkyMap &map)
Computes the absolute value of sky map elements.
Definition GSkyMap.cpp:4050
GFitsImageDouble * create_wcs_hdu(void) const
Create FITS HDU containing WCS image.
Definition GSkyMap.cpp:3332
bool overlaps_circle(const GSkyRegionCircle &region) const
Checks whether a circular region overlaps with this map.
Definition GSkyMap.cpp:3561
std::vector< int > m_shape
Shape of the maps.
Definition GSkyMap.hpp:235
bool contains(const GSkyDir &dir) const
Checks if sky direction falls in map.
Definition GSkyMap.cpp:2023
bool m_hascache
Cache is valid.
Definition GSkyMap.hpp:240
GFitsBinTable * create_healpix_hdu(void) const
Create FITS HDU containing Healpix data.
Definition GSkyMap.cpp:3271
const double * pixels(void) const
Returns pointer to pixel data.
Definition GSkyMap.hpp:513
GSkyPixel inx2pix(const int &index) const
Converts pixel index into sky map pixel.
Definition GSkyMap.cpp:1301
int pix2inx(const GSkyPixel &pixel) const
Converts sky map pixel into pixel index.
Definition GSkyMap.cpp:1407
GNdarray m_pixels
Skymap pixels.
Definition GSkyMap.hpp:237
void init_members(void)
Initialise class members.
Definition GSkyMap.cpp:2857
GSkyPixel dir2pix(const GSkyDir &dir) const
Returns sky map pixel for a given sky direction.
Definition GSkyMap.cpp:1472
bool overlaps(const GSkyRegion &region) const
Checks whether a region overlaps with this map.
Definition GSkyMap.cpp:2102
std::string print(const GChatter &chatter=NORMAL) const
Print sky map.
Definition GSkyMap.cpp:2787
Sky map pixel class.
Definition GSkyPixel.hpp:74
Abstract sky projection base class.
Interface for the circular sky region class.
Abstract interface for the sky region class.
Sky region container class.
Vector class.
Definition GVector.hpp:46