rubin_sim.utils.moc2array(data, uniq, nside=128, reduce_func=<function sum>, density=True, fill_val=0.0)

Convert a Multi-Order Coverage Map to a single nside HEALPix array. Useful for converting maps output by LIGO alerts. Expect that future versions of healpy or astropy will be able to replace this functionality. Note that this is a convienence function that will probably degrade portions of the MOC that are sampled at high resolution.

Details of HEALPix Mulit-Order Coverage map:


Data values for the MOC map


The UNIQ values for the MOC map

nsideint (128)

The output map nside

reduce_funcfunction (np.sum)

The function to use to combine data into single healpixels.

densitybool (True)

If True, multiplies data values by pixel area before applying reduce_func, and divides the final array by the output pixel area. Should be True if working on a probability density MOC.

fill_valfloat (0.)

Value to fill empty HEALPixels with. Good choices include 0 (default), hp.UNSEEN, and np.nan.

np.arrayHEALpy array of nside. Units should be the same as the input map as processed by reduce_func.