healpy.pixelfunc.npix2nside

healpy.pixelfunc.npix2nside(npix)

Give the nside parameter for the given number of pixels.

Parameters :

npix : int

the number of pixels

Returns :

nside : int

the nside parameter corresponding to npix

Notes

Raise a ValueError exception if number of pixel does not correspond to the number of pixel of an healpix map.

Examples

>>> import healpy as hp
>>> hp.npix2nside(768)
8
>>> np.all([hp.npix2nside(12 * nside**2) == nside for nside in [2**n for n in range(12)]])
True
>>> hp.npix2nside(1000)
Traceback (most recent call last):
    ...
ValueError: Wrong pixel number (it is not 12*nside**2)

Project Versions

Previous topic

healpy.pixelfunc.nside2npix

Next topic

healpy.pixelfunc.nside2resol

This Page