def test_sip_with_altkey():
 with fits.open(get_pkg_data_filename(u'data/sip.fits')) as f:
  w = wcs.WCS(f[0].header)
 h1 = w.to_header(relax=True, key=u'A')
 h2 = w.to_header(relax=False)
 h1[u'CTYPE1A'] = u'RA---SIN-SIP'
 h1[u'CTYPE2A'] = u'DEC--SIN-SIP'
 h1.update(h2)
 w = wcs.WCS(h1, key=u'A')
 assert (w.wcs.ctype == np.array([u'RA---SIN-SIP', u'DEC--SIN-SIP'])).all()

def test_sip_with_altkey ( ) : with fits . open ( get_pkg_data_filename ( u'data/sip.fits' ) ) as f : w = wcs . WCS ( f [ 0 ] . header ) h1 = w . to_header ( relax = True , key = u'A' ) h2 = w . to_header ( relax = False ) h1 [ u'CTYPE1A' ] = u'RA---SIN-SIP' h1 [ u'CTYPE2A' ] = u'DEC--SIN-SIP' h1 . update ( h2 ) w = wcs . WCS ( h1 , key = u'A' ) assert ( w . wcs . ctype == np . array ( [ u'RA---SIN-SIP' , u'DEC--SIN-SIP' ] ) ) . all ( )
test that when creating a wcs object using a key .