healpy.pixelfunc.npix2order

Contents

healpy.pixelfunc.npix2order#

healpy.pixelfunc.npix2order(npix)#

Give the resolution order for the given number of pixels.

Parameters:
npixint

the number of pixels

Returns:
orderint

corresponding resolution order

Notes

A convenience function that successively applies npix2nside then nside2order to npix.

Examples

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