healpy.pixelfunc.ud_grade

healpy.pixelfunc.ud_grade(map_in, nside_out, pess=False, order_in='RING', order_out=None, power=None, dtype=None)

Upgrade or degrade resolution of a map (or list of maps).

in degrading the resolution, ud_grade sets the value of the superpixel as the mean of the children pixels.

Parameters:
map_inarray-like or sequence of array-like

the input map(s) (if a sequence of maps, all must have same size)

nside_outint

the desired nside of the output map(s)

pessbool

if True, in degrading, reject pixels which contains a bad sub_pixel. Otherwise, estimate average with good pixels

order_in, order_outstr

pixel ordering of input and output (‘RING’ or ‘NESTED’)

powerfloat

if non-zero, divide the result by (nside_in/nside_out)**power Examples: power=-2 keeps the sum of the map invariant (useful for hitmaps), power=2 divides the mean by another factor of (nside_in/nside_out)**2 (useful for variance maps)

dtypetype

the type of the output map

Returns:
map_outarray-like or sequence of array-like

the upgraded or degraded map(s)

Examples

>>> import healpy as hp
>>> hp.ud_grade(np.arange(48.), 1)
array([  5.5 ,   7.25,   9.  ,  10.75,  21.75,  21.75,  23.75,  25.75,
        36.5 ,  38.25,  40.  ,  41.75])