# healpy.pixelfunc.nside2order¶

healpy.pixelfunc.nside2order(nside)

Give the resolution order for a 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
orderint

corresponding order where nside = 2**(order)

Notes

Raise a ValueError exception if nside is not valid.

Examples

>>> import healpy as hp
>>> import numpy as np
>>> hp.nside2order(128)
7

>>> np.all([hp.nside2order(2**o) == o for o in range(30)])
True

>>> hp.nside2order(7)
Traceback (most recent call last):
...
ValueError: 7 is not a valid nside parameter (must be a power of 2, less than 2**30)