ericmandel/pyds9

Pyfits and astropy.io.fits

Closed this issue · 2 comments

Hello,

I can see on the top of the file, it's importing from astropy.io the fits module, but later on in the code there are references to pyfits module, and two methods that uses it.

Shouldn't this be refactored?

pyds9/pyds9/pyds9.py

Lines 121 to 130 in c1bf67a

# load pyfits, if available
try:
import pyfits
if pyfits.__version__ >= '2.2':
ds9Globals["pyfits"] = True
else:
warnings.warn('Pytest<2.2 is not supported')
ds9Globals["pyfits"] = False
except ImportError:
ds9Globals["pyfits"] = False

Cheers,

Florian

This is more or less legacy code for the time before astropy.io.fits exists. The get_pyfits and set_pyfits methods uses pyfits if found, otherwise fall back to astropy's fits.

I think that the refactoring will be to eventually remove pyfits

Closed by #87