Here and anywhere else we should use the `astropy` standard:

    from astropy.io import fits

instead of `pyfits`.