def test_dict_init():
 w = wcs.WCS({})
 (xp, yp) = w.wcs_world2pix(41.0, 2.0, 1)
 assert_array_almost_equal_nulp(xp, 41.0, 10)
 assert_array_almost_equal_nulp(yp, 2.0, 10)
 w = wcs.WCS({u'CTYPE1': u'GLON-CAR', u'CTYPE2': u'GLAT-CAR', u'CUNIT1': u'deg', u'CUNIT2': u'deg', u'CRPIX1': 1, u'CRPIX2': 1, u'CRVAL1': 40.0, u'CRVAL2': 0.0, u'CDELT1': (-0.1), u'CDELT2': 0.1})
 (xp, yp) = w.wcs_world2pix(41.0, 2.0, 0)
 assert_array_almost_equal_nulp(xp, (-10.0), 10)
 assert_array_almost_equal_nulp(yp, 20.0, 10)

def test_dict_init ( ) : w = wcs . WCS ( { } ) ( xp , yp ) = w . wcs_world2pix ( 41.0 , 2.0 , 1 ) assert_array_almost_equal_nulp ( xp , 41.0 , 10 ) assert_array_almost_equal_nulp ( yp , 2.0 , 10 ) w = wcs . WCS ( { u'CTYPE1' : u'GLON-CAR' , u'CTYPE2' : u'GLAT-CAR' , u'CUNIT1' : u'deg' , u'CUNIT2' : u'deg' , u'CRPIX1' : 1 , u'CRPIX2' : 1 , u'CRVAL1' : 40.0 , u'CRVAL2' : 0.0 , u'CDELT1' : ( - 0.1 ) , u'CDELT2' : 0.1 } ) ( xp , yp ) = w . wcs_world2pix ( 41.0 , 2.0 , 0 ) assert_array_almost_equal_nulp ( xp , ( - 10.0 ) , 10 ) assert_array_almost_equal_nulp ( yp , 20.0 , 10 )
test that wcs can be initialized with a dict-like object .