The SKIRT project
advanced radiative transfer for astrophysics
Classes | Functions
pts.simulation.healpix Namespace Reference

Handling of HEALPix grids. More...

Classes

class  HEALPixGrid
 This class represents a HEALPix grid. More...
 

Functions

def getDistanceOnSky (thetaA, phiA, thetaB, phiB)
 Get the shortest distance (in radians) between two points (A, B) on the celestial sphere with the given zenith and azimuth. More...
 
def getEmptyHEALPixGrid (order, numValuesPerPixel=1)
 Construct a new, empty HEALPixGrid of the given order and with the given number of values per pixel. More...
 

Detailed Description

Handling of HEALPix grids.

This module offers functionality to work with HEALPix grids output by the HEALPixSkyInstrument.

Function Documentation

◆ getDistanceOnSky()

def pts.simulation.healpix.getDistanceOnSky (   thetaA,
  phiA,
  thetaB,
  phiB 
)

Get the shortest distance (in radians) between two points (A, B) on the celestial sphere with the given zenith and azimuth.

The distance can easily be derived by realizing that the angle between the unit vectors pointing to A and B is given by

\[ \delta{} = \arccos{\vec{r}_A \dot{} \vec{r}_B}. \]

In spherical coordinates, the dot product of the two unit vectors with sky coordinates \((\theta{}_A,\phi{}_A)\) and \((\theta{}_B,\phi{}_B)\) yields

\[ \vec{r}_A \dot{} \vec{r}_B = \sin{\theta{}_A}\sin{\theta{}_B} \left( \cos{\phi{}_A}\cos{\phi{}_B} + \sin{\phi{}_A}\sin{\phi{}_B} \right) + \cos{\theta{}_A}\cos{\theta{}_B} = \sin{\theta{}_A}\sin{\theta{}_B} \cos{(\phi{}_A-\phi{}_B)} + \cos{\theta{}_A}\cos{\theta{}_B} = \frac{1}{2} \left[ \cos{(\theta{}_A-\theta{}_B)} - \cos{(\theta{}_A+\theta{}_B)} \right] \cos{(\phi{}_A-\phi{}_B)} + \frac{1}{2} \left[ \cos{(\theta{}_A-\theta{}_B)} + \cos{(\theta{}_A+\theta{}_B)} \right]. \]

◆ getEmptyHEALPixGrid()

def pts.simulation.healpix.getEmptyHEALPixGrid (   order,
  numValuesPerPixel = 1 
)

Construct a new, empty HEALPixGrid of the given order and with the given number of values per pixel.

The order \(k\) relates to the HEALPix parameter \(N_{side} = 2^k\), which gives the number of pixels along one axis of the 12 HEALPix base pixels. The total number of pixels is then given by \(12N_{side}^2\). Each pixel has the exact same size, \(\frac{\pi{}}{3N_{side}^2}\). Assuming square pixels (which is approximately true), the angular resolution \(R\) can be computed from

\[ R \approx{} \sqrt{\frac{\pi{}}{3N_{side}^2}} = \frac{1}{N_{side}} \left(\frac{10800}{\sqrt{3\pi{}}}\right) ' \approx{} \left(\frac{3520}{N_{side}}\right) ' \]

For example, most Planck maps are published with an order \(k=10\), which corresponds to a resolution of \(\approx{}3.4'\) (nominally \(5'\)). \(k=6\) would correspond to a resolution of \(\approx{}1^\circ{}\).