healpy.pixelfunc.nside2npix

healpy.pixelfunc.nside2npix(nside)

Give the number of pixel for the given nside.

Parameters :

nside : int

healpix nside parameter; an exception is raised if nside is not valid (nside must be a power of 2)

Returns :

npix : int

corresponding number of pixels

Notes

Raise a ValueError exception if nside is not valid.

Examples

>>> import healpy as hp
>>> hp.nside2npix(8)
768
>>> np.all([hp.nside2npix(nside) == 12 * nside**2 for nside in [2**n for n in range(12)]])
True
>>> hp.nside2npix(7)
Traceback (most recent call last):
   ...
ValueError: Given number is not a valid nside parameter (must be a power of 2)

Project Versions

Previous topic

healpy.pixelfunc.reorder

Next topic

healpy.pixelfunc.npix2nside

This Page