Incompatibility with healpy in 0.5.0
Trying to read a FITS skymap produced by ligo.skymap 0.5.0 with healpy leads to the following error.
In [1]: import healpy as hp
In [2]: hp.__version__
Out[2]: '1.14.0'
In [3]: x = hp.read_map('test.fits.gz')
/Users/tito/anaconda3/lib/python3.7/site-packages/healpy/fitsfunc.py:369: UserWarning: If you are not specifying the input dtype and using the default np.float64 dtype of read_map(), please consider that it will change in a future version to None as to keep the same dtype of the input file: please explicitly set the dtype if it is important to you.
"If you are not specifying the input dtype and using the default "
/Users/tito/anaconda3/lib/python3.7/site-packages/healpy/fitsfunc.py:391: UserWarning: NSIDE = 256
warnings.warn("NSIDE = {0:d}".format(nside))
/Users/tito/anaconda3/lib/python3.7/site-packages/healpy/fitsfunc.py:400: UserWarning: ORDERING = NESTED in fits file
warnings.warn("ORDERING = {0:s} in fits file".format(ordering))
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-3-81c33a5c1363> in <module>
----> 1 x = hp.read_map('test.fits.gz')
~/anaconda3/lib/python3.7/site-packages/healpy/fitsfunc.py in read_map(filename, field, dtype, nest, partial, hdu, h, verbose, memmap)
404
405 # partial sky: check OBJECT, then INDXSCHM
--> 406 obj = fits_hdu.header.get("OBJECT", "UNDEF").strip()
407 if obj != "UNDEF":
408 if obj == "PARTIAL":
AttributeError: 'int' object has no attribute 'strip'
The issue seems to be that ligo.skymap sets the OBJECT
header field to an integer, while healpy assumes it is a string-like type.
Would it be a problem to simply convert the integer to a string?