healpy.pixelfunc.ud_grade

healpy.pixelfunc.ud_grade(map_in, *args, **kwds)

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_in : array-like or sequence of array-like

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

nside_out : int

the desired nside of the output map(s)

pess : bool

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

order_in, order_out : str

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

power : float

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)

dtype : type

the type of the output map

Returns:

map_out : array-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])