moc2array¶
- 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: http://ivoa.net/documents/MOC/20190404/PR-MOC-1.1-20190404.pdf
- Parameters:
- datanp.array
Data values for the MOC map
- uniqnp.array
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.
- Returns:
- np.arrayHEALpy array of nside. Units should be the same as the input map as processed by reduce_func.