For compatibility between astropy and pywcs.

def _create_wcs (fitsheader):
    """For compatibility between astropy and pywcs."""
    wcsmodule = _load_wcs_module ()
    is_pywcs = hasattr (wcsmodule, 'UnitConverter')

    wcs = wcsmodule.WCS (fitsheader)
    wcs.wcs.set ()
    wcs.wcs.fix () # I'm interested in MJD computation via datfix()

    if hasattr (wcs, 'wcs_pix2sky'):
        wcs.wcs_pix2world = wcs.wcs_pix2sky
        wcs.wcs_world2pix = wcs.wcs_sky2pix

    return wcs