Automatically determine whether sky map is MOC or flattened
This can be done similarly to emfollow/gwcelery!1495 (merged)
def is_skymap_moc(skymap_bytes):
with NamedTemporaryFile(content=skymap_bytes) as skymap_file:
# If ordering is EXPLICIT, should be multiordered (MOC)
return getheader(skymap_file.name, ext=1)['INDXSCHM'] == 'EXPLICIT'
Also checks whether the input is an astropy table or 1-D array could work for skymap_overlap_integral
rather supply the UNIQ
columns separately.