GammaLib  2.1.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GSkyMap.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GSkyMap.hpp - Sky map class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2010-2023 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 _______________________________________________ */
41 class GFilename;
42 class GFits;
43 class GFitsHDU;
44 class GFitsTable;
45 class GFitsBinTable;
46 class GFitsImage;
47 class GFitsImageDouble;
48 class GMatrix;
49 class GVector;
50 class GSkyRegion;
51 class GSkyRegionCircle;
52 class 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  ***************************************************************************/
89 class 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 
100 public:
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 GSkyMap& map) const;
136  double& operator()(const int& index, const int& map = 0);
137  const double& operator()(const int& index, const int& map = 0) const;
138  double& operator()(const GSkyPixel& pixel, const int& map = 0);
139  const double& operator()(const GSkyPixel& pixel, const int& map = 0) const;
140  double operator()(const GSkyDir& dir, const int& map = 0) const;
141 
142  // Methods
143  void clear(void);
144  GSkyMap* clone(void) const;
145  std::string classname(void) const;
146  bool is_empty(void) const;
147  const int& npix(void) const;
148  const int& nx(void) const;
149  const int& ny(void) const;
150  const int& nmaps(void) const;
151  void nmaps(const int& nmaps);
152  const std::vector<int>& shape(void) const;
153  void shape(const int& s1);
154  void shape(const int& s1, const int& s2);
155  void shape(const int& s1, const int& s2, const int& s3);
156  void shape(const std::vector<int>& shape);
157  int ndim(void) const;
158  GSkyPixel inx2pix(const int& index) const;
159  GSkyDir inx2dir(const int& index) const;
160  GSkyDir pix2dir(const GSkyPixel& pixel) const;
161  int pix2inx(const GSkyPixel& pixel) const;
162  int dir2inx(const GSkyDir& dir) const;
163  GSkyPixel dir2pix(const GSkyDir& dir) const;
164  GNdarray counts(void) const;
165  double flux(const int& index, const int& map = 0) const;
166  double flux(const GSkyPixel& pixel, const int& map = 0) const;
167  double flux(const GSkyRegion& region, const int& map = 0) const;
168  double flux(const GSkyRegions& regions, const int& map = 0) const;
169  GNdarray flux(void) const;
170  double solidangle(const int& index) const;
171  double solidangle(const GSkyPixel& pixel) const;
172  double solidangle(const GSkyRegion& region) const;
173  double solidangle(const GSkyRegions& regions) const;
174  bool contains(const GSkyDir& dir) const;
175  bool contains(const GSkyPixel& pixel) const;
176  bool overlaps(const GSkyRegion& region) const;
177  void smooth(const std::string& kernel,
178  const double& par);
179  void correlate(const std::string& kernel,
180  const double& par);
181  const GSkyProjection* projection(void) const;
182  void projection(const GSkyProjection& proj);
183  const double* pixels(void) const;
184  GSkyMap extract(const int& map, const int& nmaps = 1) const;
185  GSkyMap extract(const int& startx, const int& stopx,
186  const int& starty, const int& stopy) const;
187  GSkyMap extract(const GSkyRegions& inclusions) const;
188  void stack_maps(void);
189  GSkyRegionCircle region_circle(void) const;
190  void load(const GFilename& filename);
191  void save(const GFilename& filename,
192  const bool& clobber = false) const;
193  void read(const GFitsHDU& hdu);
194  GFitsHDU* write(GFits& file,
195  const std::string& extname = "") const;
196  void publish(const std::string& name = "") const;
197  std::string print(const GChatter& chatter = NORMAL) const;
198 
199 private:
200  // Private methods
201  void init_members(void);
202  void copy_members(const GSkyMap& map);
203  void free_members(void);
204  void set_wcs(const std::string& wcs, const std::string& coords,
205  const double& crval1, const double& crval2,
206  const double& crpix1, const double& crpix2,
207  const double& cdelt1, const double& cdelt2);
208  void read_healpix(const GFitsTable& table);
209  void read_wcs(const GFitsImage& image);
210  void alloc_wcs(const GFitsImage& image);
211  GFitsBinTable* create_healpix_hdu(void) const;
212  GFitsImageDouble* create_wcs_hdu(void) const;
213  double solidangle(const GSkyDir& dir1, const GSkyDir& dir2,
214  const GSkyDir& dir3) const;
215  double solidangle(const GSkyDir& dir1, const GSkyDir& dir2,
216  const GSkyDir& dir3, const GSkyDir& dir4) const;
217  bool overlaps_circle(const GSkyRegionCircle& region) const;
218  bool is_healpix(const GFitsHDU& hdu) const;
219  bool is_wcs(const GFitsHDU& hdu) const;
220  bool is_same(const GSkyMap& map) const;
221  void convolve(const std::string& kernel,
222  const double& par,
223  const bool& normalise);
224  GNdarray convolution_kernel(const std::string& kernel,
225  const double& par,
226  const bool& normalise) const;
227 
228  // Private data area
229  int m_num_pixels; //!< Number of pixels (used for pixel allocation)
230  int m_num_maps; //!< Number of maps (used for pixel allocation)
231  int m_num_x; //!< Number of pixels in x direction (only 2D)
232  int m_num_y; //!< Number of pixels in y direction (only 2D)
233  std::vector<int> m_shape; //!< Shape of the maps
234  GSkyProjection* m_proj; //!< Pointer to sky projection
235  GNdarray m_pixels; //!< Skymap pixels
236 
237  // Computation cache
238  mutable bool m_hascache; //!< Cache is valid
239  mutable bool m_contained; //!< Sky direction is contained in map
240  mutable GSkyDir m_last_dir; //!< Last sky direction
241  mutable GBilinear m_interpol; //!< Bilinear interpolator
242 };
243 
244 
245 /***********************************************************************//**
246  * @brief Binary sky map addition
247  *
248  * @param[in] map Sky map.
249  * @return Sky map to which @p map was added.
250  *
251  * Returns the sum of two sky maps.
252  ***************************************************************************/
253 inline
255 {
256  GSkyMap result = *this;
257  result += map;
258  return result;
259 }
260 
261 
262 /***********************************************************************//**
263  * @brief Binary sky map subtraction
264  *
265  * @param[in] map Sky map.
266  * @return Sky map to which @p map was added.
267  *
268  * Returns the difference of two sky maps.
269  ***************************************************************************/
270 inline
272 {
273  GSkyMap result = *this;
274  result -= map;
275  return result;
276 }
277 
278 
279 /***********************************************************************//**
280  * @brief Binary sky map multiplication
281  *
282  * @param[in] map Sky map.
283  * @return Sky map multiplied by @p map.
284  *
285  * Returns the product of two sky maps.
286  ***************************************************************************/
287 inline
289 {
290  GSkyMap result = *this;
291  result *= map;
292  return result;
293 }
294 
295 
296 /***********************************************************************//**
297  * @brief Binary sky map division
298  *
299  * @param[in] map Sky map.
300  * @return Sky map divided by @p map.
301  *
302  * Returns the ratio of two sky maps.
303  ***************************************************************************/
304 inline
306 {
307  GSkyMap result = *this;
308  result /= map;
309  return result;
310 }
311 
312 
313 /***********************************************************************//**
314  * @brief Return class name
315  *
316  * @return String containing the class name ("GSkyMap").
317  ***************************************************************************/
318 inline
319 std::string GSkyMap::classname(void) const
320 {
321  return ("GSkyMap");
322 }
323 
324 
325 /***********************************************************************//**
326  * @brief Signals if sky map is empty
327  *
328  * @return True if sky map is empty, false otherwise.
329  *
330  * Signals if a sky map has no pixels or maps.
331  ***************************************************************************/
332 inline
333 bool GSkyMap::is_empty(void) const
334 {
335  return ((m_num_pixels == 0) || (m_num_maps == 0));
336 }
337 
338 
339 /***********************************************************************//**
340  * @brief Returns number of pixels
341  *
342  * @return Number of pixels in one sky map.
343  *
344  * Returns the number of pixels in one sky map.
345  ***************************************************************************/
346 inline
347 const int& GSkyMap::npix(void) const
348 {
349  return m_num_pixels;
350 }
351 
352 
353 /***********************************************************************//**
354  * @brief Returns number of pixels in x coordinate
355  *
356  * @return Number of pixels in the X direction.
357  *
358  * Returns the number of pixels in the X direction. If the sky map is a
359  * one dimensional array (which is the case for the Healpix projection),
360  * the method returns 0.
361  ***************************************************************************/
362 inline
363 const int& GSkyMap::nx(void) const
364 {
365  return m_num_x;
366 }
367 
368 
369 /***********************************************************************//**
370  * @brief Returns number of pixels in y coordinate
371  *
372  * @return Number of pixels in the Y direction.
373  *
374  * Returns the number of pixels in the Y direction. If the sky map is a
375  * one dimensional array (which is the case for the Healpix projection),
376  * the method returns 0.
377  ***************************************************************************/
378 inline
379 const int& GSkyMap::ny(void) const
380 {
381  return m_num_y;
382 }
383 
384 
385 /***********************************************************************//**
386  * @brief Returns number of maps
387  *
388  * @return Number of maps in the sky map object.
389  ***************************************************************************/
390 inline
391 const int& GSkyMap::nmaps(void) const
392 {
393  return m_num_maps;
394 }
395 
396 
397 /***********************************************************************//**
398  * @brief Returns shape of maps
399  *
400  * @return Shape of maps in the sky map object.
401  ***************************************************************************/
402 inline
403 const std::vector<int>& GSkyMap::shape(void) const
404 {
405  return m_shape;
406 }
407 
408 
409 /***********************************************************************//**
410  * @brief Returns dimension of maps
411  *
412  * @return Number of map dimensions.
413  ***************************************************************************/
414 inline
415 int GSkyMap::ndim(void) const
416 {
417  return (int)m_shape.size();
418 }
419 
420 
421 /***********************************************************************//**
422  * @brief Smooth sky map
423  *
424  * @param[in] kernel Smoothing kernel type ("DISK", "GAUSSIAN").
425  * @param[in] par Smoothing parameter.
426  *
427  * Smoothes all sky maps using the specified @p kernel and a smoothing
428  * parameter. For the "DISK" kernel the smoothing parameter is the disk
429  * radius in degrees. For the "GAUSSIAN" kernel the smoothing parameter is
430  * the Gaussian sigma in degrees.
431  ***************************************************************************/
432 inline
433 void GSkyMap::smooth(const std::string& kernel, const double& par)
434 {
435  convolve(kernel, par, true);
436  return;
437 }
438 
439 
440 /***********************************************************************//**
441  * @brief Correlates sky map
442  *
443  * @param[in] kernel Correlation kernel type ("DISK", "GAUSSIAN").
444  * @param[in] par Correlation parameter.
445  *
446  * Correlates all sky maps using the specified @p kernel and a correlation
447  * parameter. For the "DISK" kernel the correlation parameter is the disk
448  * radius in degrees. For the "GAUSSIAN" kernel the correlation parameter is
449  * the Gaussian sigma in degrees.
450  ***************************************************************************/
451 inline
452 void GSkyMap::correlate(const std::string& kernel, const double& par)
453 {
454  convolve(kernel, par, false);
455  return;
456 }
457 
458 
459 /***********************************************************************//**
460  * @brief Returns pointer to sky projection
461  *
462  * @return Pointer to sky projection (NULL if no projection is defined).
463  ***************************************************************************/
464 inline
466 {
467  return m_proj;
468 }
469 
470 
471 /***********************************************************************//**
472  * @brief Returns pointer to pixel data
473  *
474  * @return Pointer to pixel data.
475  ***************************************************************************/
476 inline
477 const double* GSkyMap::pixels(void) const
478 {
479  return (m_pixels.data());
480 }
481 
482 #endif /* GSKYMAP_HPP */
friend GSkyMap log(const GSkyMap &map)
Computes the natural logarithm of sky map elements.
Definition: GSkyMap.cpp:3970
bool is_same(const GSkyMap &map) const
Check if map is the same.
Definition: GSkyMap.cpp:3675
GSkyMap(void)
Void constructor.
Definition: GSkyMap.cpp:116
void stack_maps(void)
Stack all maps into a single map.
Definition: GSkyMap.cpp:2341
GSkyMap & operator=(const GSkyMap &map)
Assignment operator.
Definition: GSkyMap.cpp:337
Sky map class.
Definition: GSkyMap.hpp:89
Abstract FITS image base class.
Definition: GFitsImage.hpp:43
GSkyMap & operator*=(const GSkyMap &map)
Multiplication operator.
Definition: GSkyMap.cpp:578
const int & ny(void) const
Returns number of pixels in y coordinate.
Definition: GSkyMap.hpp:379
GSkyPixel inx2pix(const int &index) const
Converts pixel index into sky map pixel.
Definition: GSkyMap.cpp:1301
void correlate(const std::string &kernel, const double &par)
Correlates sky map.
Definition: GSkyMap.hpp:452
int pix2inx(const GSkyPixel &pixel) const
Converts sky map pixel into pixel index.
Definition: GSkyMap.cpp:1407
const GSkyProjection * projection(void) const
Returns pointer to sky projection.
Definition: GSkyMap.hpp:465
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
GSkyMap extract(const int &map, const int &nmaps=1) const
Extract maps into a new sky map object.
Definition: GSkyMap.cpp:2139
int m_num_maps
Number of maps (used for pixel allocation)
Definition: GSkyMap.hpp:230
int m_num_pixels
Number of pixels (used for pixel allocation)
Definition: GSkyMap.hpp:229
void read_healpix(const GFitsTable &table)
Read Healpix data from FITS table.
Definition: GSkyMap.cpp:3008
friend bool operator!=(const GSkyMap &a, const GSkyMap &b)
Non-equality operator.
Definition: GSkyMap.cpp:4196
GSkyMap operator+(const GSkyMap &map) const
Binary sky map addition.
Definition: GSkyMap.hpp:254
Sky direction class interface definition.
std::vector< int > m_shape
Shape of the maps.
Definition: GSkyMap.hpp:233
Abstract FITS extension base class.
Definition: GFitsHDU.hpp:51
bool overlaps(const GSkyRegion &region) const
Checks whether a region overlaps with this map.
Definition: GSkyMap.cpp:2102
int m_num_x
Number of pixels in x direction (only 2D)
Definition: GSkyMap.hpp:231
Definition of interface for all GammaLib classes.
GSkyProjection * m_proj
Pointer to sky projection.
Definition: GSkyMap.hpp:234
Abstract sky projection base class definition.
int m_num_y
Number of pixels in y direction (only 2D)
Definition: GSkyMap.hpp:232
GSkyMap & operator+=(const GSkyMap &map)
Map addition operator.
Definition: GSkyMap.cpp:398
friend GSkyMap abs(const GSkyMap &map)
Computes the absolute value of sky map elements.
Definition: GSkyMap.cpp:4050
FITS file class.
Definition: GFits.hpp:63
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
GNdarray convolution_kernel(const std::string &kernel, const double &par, const bool &normalise) const
Return convolution kernel.
Definition: GSkyMap.cpp:3813
Interface for the circular sky region class.
friend GSkyMap log10(const GSkyMap &map)
Computes the base 10 logarithm of sky map elements.
Definition: GSkyMap.cpp:4010
friend bool operator==(const GSkyMap &a, const GSkyMap &b)
Equality operator.
Definition: GSkyMap.cpp:4178
void read(const GFitsHDU &hdu)
Read skymap from FITS HDU.
Definition: GSkyMap.cpp:2664
GSkyMap & operator-=(const GSkyMap &map)
Map subtraction operator.
Definition: GSkyMap.cpp:488
const std::vector< int > & shape(void) const
Returns shape of maps.
Definition: GSkyMap.hpp:403
bool is_empty(void) const
Signals if sky map is empty.
Definition: GSkyMap.hpp:333
void publish(const std::string &name="") const
Publish sky map.
Definition: GSkyMap.cpp:2750
bool is_healpix(const GFitsHDU &hdu) const
Check if HDU contains HEALPix data.
Definition: GSkyMap.cpp:3624
std::string print(const GChatter &chatter=NORMAL) const
Print sky map.
Definition: GSkyMap.cpp:2787
friend GSkyMap sign(const GSkyMap &map)
Computes the sign value of sky map elements.
Definition: GSkyMap.cpp:4086
Sky map pixel class.
Definition: GSkyPixel.hpp:74
void copy_members(const GSkyMap &map)
Copy class members.
Definition: GSkyMap.cpp:2884
GSkyDir pix2dir(const GSkyPixel &pixel) const
Returns sky direction of pixel.
Definition: GSkyMap.cpp:1360
double & operator()(const int &index, const int &map=0)
Pixel index access operator.
Definition: GSkyMap.cpp:789
Abstract interface for the sky region class.
Definition: GSkyRegion.hpp:57
const int & nmaps(void) const
Returns number of maps.
Definition: GSkyMap.hpp:391
GSkyDir inx2dir(const int &index) const
Returns sky direction of pixel.
Definition: GSkyMap.cpp:1331
Double precision FITS image class.
GFitsImageDouble * create_wcs_hdu(void) const
Create FITS HDU containing WCS image.
Definition: GSkyMap.cpp:3332
GFitsHDU * write(GFits &file, const std::string &extname="") const
Write sky map into FITS file.
Definition: GSkyMap.cpp:2697
Filename class.
Definition: GFilename.hpp:62
N-dimensional array class interface definition.
Interface class for all GammaLib classes.
Definition: GBase.hpp:52
GNdarray m_pixels
Skymap pixels.
Definition: GSkyMap.hpp:235
Bilinear interpolator class.
Definition: GBilinear.hpp:40
friend GSkyMap sqrt(const GSkyMap &map)
Computes square root of sky map elements.
Definition: GSkyMap.cpp:3930
bool m_contained
Sky direction is contained in map.
Definition: GSkyMap.hpp:239
bool contains(const GSkyDir &dir) const
Checks if sky direction falls in map.
Definition: GSkyMap.cpp:2023
const double * data(void) const
Data access method (const version)
Definition: GNdarray.hpp:389
Abstract interface for FITS table.
Definition: GFitsTable.hpp:44
GSkyMap operator*(const GSkyMap &map) const
Binary sky map multiplication.
Definition: GSkyMap.hpp:288
GChatter
Definition: GTypemaps.hpp:33
void alloc_wcs(const GFitsImage &image)
Allocate WCS class.
Definition: GSkyMap.cpp:3228
friend GSkyMap clip(const GSkyMap &map, const double &thresh)
Clips map at given value.
Definition: GSkyMap.cpp:4128
void clear(void)
Clear instance.
Definition: GSkyMap.cpp:1100
void convolve(const std::string &kernel, const double &par, const bool &normalise)
Convolve sky map.
Definition: GSkyMap.cpp:3756
N-dimensional array class.
Definition: GNdarray.hpp:44
GSkyMap operator-(const GSkyMap &map) const
Binary sky map subtraction.
Definition: GSkyMap.hpp:271
Sky region container class.
Definition: GSkyRegions.hpp:56
GSkyRegionCircle region_circle(void) const
Return sky region circle that encloses the sky map.
Definition: GSkyMap.cpp:2401
void free_members(void)
Delete class members.
Definition: GSkyMap.cpp:2911
bool m_hascache
Cache is valid.
Definition: GSkyMap.hpp:238
GSkyDir m_last_dir
Last sky direction.
Definition: GSkyMap.hpp:240
GSkyMap & operator/=(const GSkyMap &map)
Division operator.
Definition: GSkyMap.cpp:672
GSkyPixel dir2pix(const GSkyDir &dir) const
Returns sky map pixel for a given sky direction.
Definition: GSkyMap.cpp:1472
GBilinear m_interpol
Bilinear interpolator.
Definition: GSkyMap.hpp:241
GFitsBinTable * create_healpix_hdu(void) const
Create FITS HDU containing Healpix data.
Definition: GSkyMap.cpp:3271
int ndim(void) const
Returns dimension of maps.
Definition: GSkyMap.hpp:415
bool is_wcs(const GFitsHDU &hdu) const
Check if HDU contains WCS data.
Definition: GSkyMap.cpp:3650
void read_wcs(const GFitsImage &image)
Read WCS image from FITS HDU.
Definition: GSkyMap.cpp:3140
Bilinear interpolator class interface definition.
FITS binary table class.
bool overlaps_circle(const GSkyRegionCircle &region) const
Checks whether a circular region overlaps with this map.
Definition: GSkyMap.cpp:3561
const int & nx(void) const
Returns number of pixels in x coordinate.
Definition: GSkyMap.hpp:363
void save(const GFilename &filename, const bool &clobber=false) const
Save sky map into FITS file.
Definition: GSkyMap.cpp:2611
void smooth(const std::string &kernel, const double &par)
Smooth sky map.
Definition: GSkyMap.hpp:433
Generic matrix class definition.
Definition: GMatrix.hpp:79
Vector class.
Definition: GVector.hpp:46
double solidangle(const int &index) const
Returns solid angle of pixel.
Definition: GSkyMap.cpp:1858
Abstract sky projection base class.
virtual ~GSkyMap(void)
Destructor.
Definition: GSkyMap.cpp:313
std::string classname(void) const
Return class name.
Definition: GSkyMap.hpp:319
void load(const GFilename &filename)
Load skymap from FITS file.
Definition: GSkyMap.cpp:2511
const int & npix(void) const
Returns number of pixels.
Definition: GSkyMap.hpp:347
Sky map pixel class definition.
void init_members(void)
Initialise class members.
Definition: GSkyMap.cpp:2857
Sky direction class.
Definition: GSkyDir.hpp:62
int dir2inx(const GSkyDir &dir) const
Returns pixel index for a given sky direction.
Definition: GSkyMap.cpp:1445
GNdarray flux(void) const
Returns array with total flux for sky maps.
Definition: GSkyMap.cpp:1820
const double * pixels(void) const
Returns pointer to pixel data.
Definition: GSkyMap.hpp:477
GSkyMap operator/(const GSkyMap &map) const
Binary sky map division.
Definition: GSkyMap.hpp:305