Healpix C++  3.82
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
T_Healpix_Base< I > Class Template Reference

#include <healpix_base.h>

Inheritance diagram for T_Healpix_Base< I >:
Healpix_Map< T > Healpix_Map< double >

Public Member Functions

 T_Healpix_Base ()
 
 T_Healpix_Base (int order, Healpix_Ordering_Scheme scheme)
 
 T_Healpix_Base (I nside, Healpix_Ordering_Scheme scheme, const nside_dummy)
 
void Set (int order, Healpix_Ordering_Scheme scheme)
 
void SetNside (I nside, Healpix_Ordering_Scheme scheme)
 
double ring2z (I ring) const
 
pix2ring (I pix) const
 
nest2ring (I pix) const
 
ring2nest (I pix) const
 
nest2peano (I pix) const
 
peano2nest (I pix) const
 
zphi2pix (double z, double phi) const
 
ang2pix (const pointing &ang) const
 
vec2pix (const vec3 &vec) const
 
void pix2zphi (I pix, double &z, double &phi) const
 
pointing pix2ang (I pix) const
 
vec3 pix2vec (I pix) const
 
pixel_import (I pix, const T_Healpix_Base &b) const
 
void query_disc (pointing ptg, double radius, rangeset< I > &pixset) const
 
rangeset< I > query_disc (pointing ptg, double radius) const
 
void query_disc_inclusive (pointing ptg, double radius, rangeset< I > &pixset, int fact=1) const
 
rangeset< I > query_disc_inclusive (pointing ptg, double radius, int fact=1) const
 
void query_disc (const pointing &dir, double radius, std::vector< I > &listpix) const
 
void query_disc_inclusive (const pointing &dir, double radius, std::vector< I > &listpix, int fact=1) const
 
void query_polygon (const std::vector< pointing > &vertex, rangeset< I > &pixset) const
 
rangeset< I > query_polygon (const std::vector< pointing > &vertex) const
 
void query_polygon_inclusive (const std::vector< pointing > &vertex, rangeset< I > &pixset, int fact=1) const
 
rangeset< I > query_polygon_inclusive (const std::vector< pointing > &vertex, int fact=1) const
 
void query_strip (double theta1, double theta2, bool inclusive, rangeset< I > &pixset) const
 
rangeset< I > query_strip (double theta1, double theta2, bool inclusive) const
 
void get_ring_info (I ring, I &startpix, I &ringpix, double &costheta, double &sintheta, bool &shifted) const
 
void get_ring_info2 (I ring, I &startpix, I &ringpix, double &theta, bool &shifted) const
 
void get_ring_info_small (I ring, I &startpix, I &ringpix, bool &shifted) const
 
void neighbors (I pix, fix_arr< I, 8 > &result) const
 
void get_interpol (const pointing &ptg, fix_arr< I, 4 > &pix, fix_arr< double, 4 > &wgt) const
 
int Order () const
 
Nside () const
 
Npix () const
 
Healpix_Ordering_Scheme Scheme () const
 
bool conformable (const T_Healpix_Base &other) const
 
void swap (T_Healpix_Base &other)
 
double max_pixrad () const
 
double max_pixrad (I ring) const
 
void boundaries (I pix, tsize step, std::vector< vec3 > &out) const
 

Static Public Member Functions

static int nside2order (I nside)
 
static I npix2nside (I npix)
 

Protected Member Functions

ring_above (double z) const
 

Protected Attributes

int order_
 
nside_
 
Healpix_Ordering_Scheme scheme_
 

Detailed Description

template<typename I>
class T_Healpix_Base< I >

Functionality related to the HEALPix pixelisation.

Definition at line 46 of file healpix_base.h.

Constructor & Destructor Documentation

◆ T_Healpix_Base() [1/3]

template<typename I >
T_Healpix_Base< I >::T_Healpix_Base ( )

Constructs an unallocated object.

Definition at line 724 of file healpix_base.cc.

◆ T_Healpix_Base() [2/3]

template<typename I>
T_Healpix_Base< I >::T_Healpix_Base ( int  order,
Healpix_Ordering_Scheme  scheme 
)
inline

Constructs an object with a given order and the ordering scheme scheme.

Definition at line 105 of file healpix_base.h.

◆ T_Healpix_Base() [3/3]

template<typename I>
T_Healpix_Base< I >::T_Healpix_Base ( nside,
Healpix_Ordering_Scheme  scheme,
const nside_dummy   
)
inline

Constructs an object with a given nside and the ordering scheme scheme. The nside_dummy parameter must be set to SET_NSIDE.

Definition at line 110 of file healpix_base.h.

Member Function Documentation

◆ ring_above()

template<typename I >
I T_Healpix_Base< I >::ring_above ( double  z) const
inlineprotected

Returns the number of the next ring to the north of z=cos(theta). It may return 0; in this case z lies north of all rings.

Definition at line 50 of file healpix_base.cc.

◆ nside2order()

template<typename I >
int T_Healpix_Base< I >::nside2order ( nside)
static

Calculates the map order from its N_side parameter. Returns -1 if nside is not a power of 2.

Parameters
nsidethe N_side parameter

Definition at line 38 of file healpix_base.cc.

◆ npix2nside()

template<typename I >
I T_Healpix_Base< I >::npix2nside ( npix)
static

Calculates the N_side parameter from the number of pixels.

Parameters
npixthe number of pixels

Definition at line 43 of file healpix_base.cc.

◆ Set()

template<typename I >
void T_Healpix_Base< I >::Set ( int  order,
Healpix_Ordering_Scheme  scheme 
)

Adjusts the object to order and scheme.

Definition at line 728 of file healpix_base.cc.

◆ SetNside()

template<typename I >
void T_Healpix_Base< I >::SetNside ( nside,
Healpix_Ordering_Scheme  scheme 
)

Adjusts the object to nside and scheme.

Definition at line 741 of file healpix_base.cc.

◆ ring2z()

template<typename I >
double T_Healpix_Base< I >::ring2z ( ring) const

Returns the z-coordinate of the ring ring. This also works for the (not really existing) rings 0 and 4*nside.

Definition at line 756 of file healpix_base.cc.

◆ pix2ring()

template<typename I >
I T_Healpix_Base< I >::pix2ring ( pix) const

Returns the number of the ring in which pix lies.

Definition at line 766 of file healpix_base.cc.

◆ nest2ring()

template<typename I >
I T_Healpix_Base< I >::nest2ring ( pix) const

Translates a pixel number from NEST to RING.

Definition at line 785 of file healpix_base.cc.

◆ ring2nest()

template<typename I >
I T_Healpix_Base< I >::ring2nest ( pix) const

Translates a pixel number from RING to NEST.

Definition at line 793 of file healpix_base.cc.

◆ nest2peano()

template<typename I >
I T_Healpix_Base< I >::nest2peano ( pix) const

Translates a pixel number from NEST to its Peano index.

Definition at line 822 of file healpix_base.cc.

◆ peano2nest()

template<typename I >
I T_Healpix_Base< I >::peano2nest ( pix) const

Translates a pixel number from its Peano index to NEST.

Definition at line 825 of file healpix_base.cc.

◆ zphi2pix()

template<typename I>
I T_Healpix_Base< I >::zphi2pix ( double  z,
double  phi 
) const
inline

Returns the number of the pixel which contains the angular coordinates (z:=cos(theta), phi).

Note
This method is inaccurate near the poles at high resolutions.

Definition at line 147 of file healpix_base.h.

◆ ang2pix()

template<typename I>
I T_Healpix_Base< I >::ang2pix ( const pointing &  ang) const
inline

Returns the number of the pixel which contains the angular coordinates ang.

Definition at line 152 of file healpix_base.h.

◆ vec2pix()

template<typename I>
I T_Healpix_Base< I >::vec2pix ( const vec3 &  vec) const
inline

Returns the number of the pixel which contains the vector vec (vec is normalized if necessary).

Definition at line 162 of file healpix_base.h.

◆ pix2zphi()

template<typename I>
void T_Healpix_Base< I >::pix2zphi ( pix,
double &  z,
double &  phi 
) const
inline

Returns the angular coordinates (z:=cos(theta), phi) of the center of the pixel with number pix.

Note
This method is inaccurate near the poles at high resolutions.

Definition at line 176 of file healpix_base.h.

◆ pix2ang()

template<typename I>
pointing T_Healpix_Base< I >::pix2ang ( pix) const
inline

Returns the angular coordinates of the center of the pixel with number pix.

Definition at line 185 of file healpix_base.h.

◆ pix2vec()

template<typename I>
vec3 T_Healpix_Base< I >::pix2vec ( pix) const
inline

Returns the vector to the center of the pixel with number pix.

Definition at line 193 of file healpix_base.h.

◆ pixel_import()

template<typename I>
I T_Healpix_Base< I >::pixel_import ( pix,
const T_Healpix_Base< I > &  b 
) const
inline

Returns the pixel number for this T_Healpix_Base corresponding to the pixel number pix in b.

Note
b.Nside()%Nside() must be 0.

Definition at line 210 of file healpix_base.h.

◆ query_disc() [1/3]

template<typename I >
void T_Healpix_Base< I >::query_disc ( pointing  ptg,
double  radius,
rangeset< I > &  pixset 
) const

Returns the range set of all pixels whose centers lie within the disk defined by dir and radius.

Parameters
dirthe angular coordinates of the disk center
radiusthe radius (in radians) of the disk
pixseta rangeset object containing the indices of all pixels whose centers lie inside the disk
Note
This method is more efficient in the RING scheme.

Definition at line 324 of file healpix_base.cc.

◆ query_disc() [2/3]

template<typename I>
rangeset<I> T_Healpix_Base< I >::query_disc ( pointing  ptg,
double  radius 
) const
inline

Returns the range set of all pixels whose centers lie within the disk defined by dir and radius.

Parameters
dirthe angular coordinates of the disk center
radiusthe radius (in radians) of the disk
Note
This method is more efficient in the RING scheme.

Definition at line 236 of file healpix_base.h.

◆ query_disc_inclusive() [1/3]

template<typename I >
void T_Healpix_Base< I >::query_disc_inclusive ( pointing  ptg,
double  radius,
rangeset< I > &  pixset,
int  fact = 1 
) const

Returns the range set of all pixels which overlap with the disk defined by dir and radius.

Parameters
dirthe angular coordinates of the disk center
radiusthe radius (in radians) of the disk
pixseta rangeset object containing the indices of all pixels overlapping with the disk.
factThe overlapping test will be done at the resolution fact*nside. For NESTED ordering, fact must be a power of 2, else it can be any positive integer. A typical choice would be 4.
Note
This method may return some pixels which don't overlap with the disk at all. The higher fact is chosen, the fewer false positives are returned, at the cost of increased run time.
This method is more efficient in the RING scheme.

Definition at line 330 of file healpix_base.cc.

◆ query_disc_inclusive() [2/3]

template<typename I>
rangeset<I> T_Healpix_Base< I >::query_disc_inclusive ( pointing  ptg,
double  radius,
int  fact = 1 
) const
inline

Returns the range set of all pixels which overlap with the disk defined by dir and radius.

Parameters
dirthe angular coordinates of the disk center
radiusthe radius (in radians) of the disk
factThe overlapping test will be done at the resolution fact*nside. For NESTED ordering, fact must be a power of 2, else it can be any positive integer. A typical choice would be 4.
Note
This method may return some pixels which don't overlap with the disk at all. The higher fact is chosen, the fewer false positives are returned, at the cost of increased run time.
This method is more efficient in the RING scheme.

Definition at line 268 of file healpix_base.h.

◆ query_disc() [3/3]

template<typename I>
void T_Healpix_Base< I >::query_disc ( const pointing &  dir,
double  radius,
std::vector< I > &  listpix 
) const
inline
Deprecated:
Please use the version based on rangeset

Definition at line 277 of file healpix_base.h.

◆ query_disc_inclusive() [3/3]

template<typename I>
void T_Healpix_Base< I >::query_disc_inclusive ( const pointing &  dir,
double  radius,
std::vector< I > &  listpix,
int  fact = 1 
) const
inline
Deprecated:
Please use the version based on rangeset

Definition at line 285 of file healpix_base.h.

◆ query_polygon() [1/2]

template<typename I>
void T_Healpix_Base< I >::query_polygon ( const std::vector< pointing > &  vertex,
rangeset< I > &  pixset 
) const

Returns a range set of pixels whose centers lie within the convex polygon defined by the vertex array.

Parameters
vertexarray containing the vertices of the polygon.
pixseta rangeset object containing the indices of all pixels whose centers lie inside the polygon
Note
This method is more efficient in the RING scheme.

◆ query_polygon() [2/2]

template<typename I>
rangeset<I> T_Healpix_Base< I >::query_polygon ( const std::vector< pointing > &  vertex) const
inline

Returns a range set of pixels whose centers lie within the convex polygon defined by the vertex array.

Parameters
vertexarray containing the vertices of the polygon.
Note
This method is more efficient in the RING scheme.

Definition at line 309 of file healpix_base.h.

◆ query_polygon_inclusive() [1/2]

template<typename I>
void T_Healpix_Base< I >::query_polygon_inclusive ( const std::vector< pointing > &  vertex,
rangeset< I > &  pixset,
int  fact = 1 
) const

Returns a range set of pixels which overlap with the convex polygon defined by the vertex array.

Parameters
vertexarray containing the vertices of the polygon.
pixseta rangeset object containing the indices of all pixels overlapping with the polygon.
factThe overlapping test will be done at the resolution fact*nside. For NESTED ordering, fact must be a power of 2, else it can be any positive integer. A typical choice would be 4.
Note
This method may return some pixels which don't overlap with the polygon at all. The higher fact is chosen, the fewer false positives are returned, at the cost of increased run time.
This method is more efficient in the RING scheme.

◆ query_polygon_inclusive() [2/2]

template<typename I>
rangeset<I> T_Healpix_Base< I >::query_polygon_inclusive ( const std::vector< pointing > &  vertex,
int  fact = 1 
) const
inline

Returns a range set of pixels which overlap with the convex polygon defined by the vertex array.

Parameters
vertexarray containing the vertices of the polygon.
factThe overlapping test will be done at the resolution fact*nside. For NESTED ordering, fact must be a power of 2, else it can be any positive integer. A typical choice would be 4.
Note
This method may return some pixels which don't overlap with the polygon at all. The higher fact is chosen, the fewer false positives are returned, at the cost of increased run time.
This method is more efficient in the RING scheme.

Definition at line 340 of file healpix_base.h.

◆ query_strip() [1/2]

template<typename I >
void T_Healpix_Base< I >::query_strip ( double  theta1,
double  theta2,
bool  inclusive,
rangeset< I > &  pixset 
) const

Returns a range set of pixels whose centers lie within the colatitude range defined by theta1 and theta2 (if inclusive==false), or which overlap with this region (if inclusive==true). If theta1<theta2, the region between both angles is considered, otherwise the regions 0<theta<theta2 and theta1<theta<pi.

Parameters
theta1first colatitude
theta2second colatitude
inclusiveif false, return the exact set of pixels whose pixels centers lie within the region; if true, return all pixels that overlap with the region.

Definition at line 1061 of file healpix_base.cc.

◆ query_strip() [2/2]

template<typename I>
rangeset<I> T_Healpix_Base< I >::query_strip ( double  theta1,
double  theta2,
bool  inclusive 
) const
inline

Returns a range set of pixels whose centers lie within the colatitude range defined by theta1 and theta2 (if inclusive==false), or which overlap with this region (if inclusive==true). If theta1<theta2, the region between both angles is considered, otherwise the regions 0<theta<theta2 and theta1<theta<pi.

Parameters
theta1first colatitude
theta2second colatitude
inclusiveif false, return the exact set of pixels whose pixels centers lie within the region; if true, return all pixels that overlap with the region.

Definition at line 370 of file healpix_base.h.

◆ get_ring_info()

template<typename I >
void T_Healpix_Base< I >::get_ring_info ( ring,
I &  startpix,
I &  ringpix,
double &  costheta,
double &  sintheta,
bool &  shifted 
) const

Returns useful information about a given ring of the map.

Parameters
ringthe ring number (the number of the first ring is 1)
startpixthe number of the first pixel in the ring (NOTE: this is always given in the RING numbering scheme!)
ringpixthe number of pixels in the ring
costhetathe cosine of the colatitude of the ring
sinthetathe sine of the colatitude of the ring
shiftedif true, the center of the first pixel is not at phi=0

Definition at line 1101 of file healpix_base.cc.

◆ get_ring_info2()

template<typename I >
void T_Healpix_Base< I >::get_ring_info2 ( ring,
I &  startpix,
I &  ringpix,
double &  theta,
bool &  shifted 
) const

Returns useful information about a given ring of the map.

Parameters
ringthe ring number (the number of the first ring is 1)
startpixthe number of the first pixel in the ring (NOTE: this is always given in the RING numbering scheme!)
ringpixthe number of pixels in the ring
thetathe colatitude (in radians) of the ring
shiftedif true, the center of the first pixel is not at phi=0

Definition at line 1128 of file healpix_base.cc.

◆ get_ring_info_small()

template<typename I >
void T_Healpix_Base< I >::get_ring_info_small ( ring,
I &  startpix,
I &  ringpix,
bool &  shifted 
) const
inline

Returns useful information about a given ring of the map.

Parameters
ringthe ring number (the number of the first ring is 1)
startpixthe number of the first pixel in the ring (NOTE: this is always given in the RING numbering scheme!)
ringpixthe number of pixels in the ring
shiftedif true, the center of the first pixel is not at phi=0

Definition at line 1078 of file healpix_base.cc.

◆ neighbors()

template<typename I >
void T_Healpix_Base< I >::neighbors ( pix,
fix_arr< I, 8 > &  result 
) const

Returns the neighboring pixels of pix in result. On exit, result contains (in this order) the pixel numbers of the SW, W, NW, N, NE, E, SE and S neighbor of pix. If a neighbor does not exist (this can only be the case for the W, N, E and S neighbors), its entry is set to -1.

Note
This method works in both RING and NEST schemes, but is considerably faster in the NEST scheme.

Definition at line 1156 of file healpix_base.cc.

◆ get_interpol()

template<typename I >
void T_Healpix_Base< I >::get_interpol ( const pointing &  ptg,
fix_arr< I, 4 > &  pix,
fix_arr< double, 4 > &  wgt 
) const

Returns interpolation information for the direction ptg. The surrounding pixels are returned in pix, their corresponding weights in wgt.

Note
This method works in both RING and NEST schemes, but is considerably faster in the RING scheme.

Definition at line 1212 of file healpix_base.cc.

◆ Order()

template<typename I>
int T_Healpix_Base< I >::Order ( ) const
inline

Returns the order parameter of the object.

Definition at line 425 of file healpix_base.h.

◆ Nside()

template<typename I>
I T_Healpix_Base< I >::Nside ( ) const
inline

Returns the N_side parameter of the object.

Definition at line 427 of file healpix_base.h.

◆ Npix()

template<typename I>
I T_Healpix_Base< I >::Npix ( ) const
inline

Returns the number of pixels of the object.

Definition at line 429 of file healpix_base.h.

◆ Scheme()

template<typename I>
Healpix_Ordering_Scheme T_Healpix_Base< I >::Scheme ( ) const
inline

Returns the ordering scheme of the object.

Definition at line 431 of file healpix_base.h.

◆ conformable()

template<typename I>
bool T_Healpix_Base< I >::conformable ( const T_Healpix_Base< I > &  other) const
inline

Returns true, if both objects have the same nside and scheme, else false.

Definition at line 435 of file healpix_base.h.

◆ swap()

template<typename I >
void T_Healpix_Base< I >::swap ( T_Healpix_Base< I > &  other)

Swaps the contents of two Healpix_Base objects.

Definition at line 1280 of file healpix_base.cc.

◆ max_pixrad() [1/2]

template<typename I >
double T_Healpix_Base< I >::max_pixrad ( ) const

Returns the maximum angular distance (in radian) between any pixel center and its corners.

Definition at line 1292 of file healpix_base.cc.

◆ max_pixrad() [2/2]

template<typename I >
double T_Healpix_Base< I >::max_pixrad ( ring) const

Returns the maximum angular distance (in radian) between any pixel center and its corners in a given ring.

Definition at line 1302 of file healpix_base.cc.

◆ boundaries()

template<typename I>
void T_Healpix_Base< I >::boundaries ( pix,
tsize  step,
std::vector< vec3 > &  out 
) const

Returns a set of points along the boundary of the given pixel. step=1 gives 4 points on the corners. The first point corresponds to the northernmost corner, the subsequent points follow the pixel boundary through west, south and east corners.

Parameters
pixpixel index number
stepthe number of returned points is 4*step.

Definition at line 1378 of file healpix_base.cc.

Member Data Documentation

◆ order_

template<typename I>
int T_Healpix_Base< I >::order_
protected

The order of the map; -1 for nonhierarchical map.

Definition at line 50 of file healpix_base.h.

◆ nside_

template<typename I>
I T_Healpix_Base< I >::nside_
protected

The N_side parameter of the map; 0 if not allocated.

Definition at line 52 of file healpix_base.h.

◆ scheme_

template<typename I>
Healpix_Ordering_Scheme T_Healpix_Base< I >::scheme_
protected

The map's ordering scheme.

Definition at line 56 of file healpix_base.h.


The documentation for this class was generated from the following files:

Generated on Thu Jul 28 2022 17:32:07 for Healpix C++