healpy.pixelfunc.nside2npix

healpy.pixelfunc.nside2npix(nside)

Give the number of pixels for the given nside.

Parameters
nsideint

healpix nside parameter; an exception is raised if nside is not valid (nside must be a power of 2, less than 2**30)

Returns
npixint

corresponding number of pixels

Notes

Raise a ValueError exception if nside is not valid.

Examples

>>> import healpy as hp
>>> import numpy as np
>>> 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)
588