GWcsHPX.hpp
3.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/***************************************************************************
* GWcsHPX.hpp - Healpix projection class *
* ----------------------------------------------------------------------- *
* copyright (C) 2010 by Jurgen Knodlseder *
* ----------------------------------------------------------------------- *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
/**
* @file GWcsHPX.hpp
* @brief GWcsHPX class definition.
* @author J. Knodlseder
*/
#ifndef GWCSHPX_HPP
#define GWCSHPX_HPP
/* __ Includes ___________________________________________________________ */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "GWcs.hpp"
#include "GSkyDir.hpp"
#include "GSkyPixel.hpp"
/***********************************************************************//**
* @class GWcsHPX
*
* @brief GWcsHPX class interface defintion
***************************************************************************/
class GWcsHPX : public GWcs {
// I/O friends
friend std::ostream& operator<< (std::ostream& os, const GWcsHPX& wcs);
public:
// Constructors and destructors
GWcsHPX(void);
GWcsHPX(const int& nside, const std::string& ordering = "NESTED",
const std::string& coordsys = "GAL");
explicit GWcsHPX(const GFitsHDU* hdu);
GWcsHPX(const GWcsHPX& wcs);
virtual ~GWcsHPX(void);
// Operators
GWcsHPX& operator= (const GWcsHPX& wcs);
// Implemented pure virtual methods
void read(const GFitsHDU* hdu);
void write(GFitsHDU* hdu) const;
// Overloaded base class methods
double omega(const int& pix) const;
GSkyDir pix2dir(const int& pix);
int dir2pix(GSkyDir dir) const;
// Class specific methods
int npix(void) const;
int nside(void) const;
std::string ordering(void) const;
void ordering(const std::string& ordering);
private:
// Private methods
void init_members(void);
void copy_members(const GWcsHPX& wcs);
void free_members(void);
GWcsHPX* clone(void) const;
int nside2order(int nside);
void pix2xy(const int& ipix, int* x, int* y);
int xy2pix(int x, int y) const;
void pix2ang_ring(int ipix, double* theta, double* phi);
void pix2ang_nest(int ipix, double* theta, double* phi);
int ang2pix_z_phi_ring(double z, double phi) const;
int ang2pix_z_phi_nest(double z, double phi) const;
unsigned int isqrt(unsigned int arg);
// Private data area
int m_nside; //!< Number of divisions of each base pixel (1-8192)
int m_npface; //!<
int m_ncap; //!<
int m_order; //!< Order
int m_ordering; //!< Pixel ordering (0=ring, 1=nested, -1=?)
int m_num_pixels; //!< Number of pixels
double m_fact1; //!<
double m_fact2; //!<
double m_omega; //!< Solid angle of pixel
};
#endif /* GWCSHPX_HPP */