def test_passing_ImageHDU():
 path = get_pkg_data_filename(u'data/validate.fits')
 hdulist = fits.open(path)
 wcs_hdu = wcs.WCS(hdulist[0])
 wcs_header = wcs.WCS(hdulist[0].header)
 assert wcs_hdu.wcs.compare(wcs_header.wcs)
 wcs_hdu = wcs.WCS(hdulist[1])
 wcs_header = wcs.WCS(hdulist[1].header)
 assert wcs_hdu.wcs.compare(wcs_header.wcs)
 hdulist.close()

def test_passing_ImageHDU ( ) : path = get_pkg_data_filename ( u'data/validate.fits' ) hdulist = fits . open ( path ) wcs_hdu = wcs . WCS ( hdulist [ 0 ] ) wcs_header = wcs . WCS ( hdulist [ 0 ] . header ) assert wcs_hdu . wcs . compare ( wcs_header . wcs ) wcs_hdu = wcs . WCS ( hdulist [ 1 ] ) wcs_header = wcs . WCS ( hdulist [ 1 ] . header ) assert wcs_hdu . wcs . compare ( wcs_header . wcs ) hdulist . close ( )
passing imagehdu or primaryhdu and comparing it with wcs initialized from header .