def test_pix2world():
 filename = get_pkg_data_filename(u'data/sip2.fits')
 with catch_warnings(wcs.wcs.FITSFixedWarning) as caught_warnings:
  ww = wcs.WCS(filename)
  assert (len(caught_warnings) == 1)
 n = 3
 pixels = (np.arange(n) * np.ones((2, n))).T
 result = ww.wcs_pix2world(pixels, 0, ra_dec_order=True)
 ww.wcs_pix2world(pixels[..., 0], pixels[..., 1], 0, ra_dec_order=True)
 close_enough = 1e-08
 answer = np.array([[0.00024976, 0.00023018], [0.00023043, (-0.00024997)]])
 assert np.all((np.abs((ww.wcs.pc - answer)) < close_enough))
 answer = np.array([[202.39265216, 47.17756518], [202.39335826, 47.17754619], [202.39406436, 47.1775272]])
 assert np.all((np.abs((result - answer)) < close_enough))

def test_pix2world ( ) : filename = get_pkg_data_filename ( u'data/sip2.fits' ) with catch_warnings ( wcs . wcs . FITSFixedWarning ) as caught_warnings : ww = wcs . WCS ( filename ) assert ( len ( caught_warnings ) == 1 ) n = 3 pixels = ( np . arange ( n ) * np . ones ( ( 2 , n ) ) ) . T result = ww . wcs_pix2world ( pixels , 0 , ra_dec_order = True ) ww . wcs_pix2world ( pixels [ ... , 0 ] , pixels [ ... , 1 ] , 0 , ra_dec_order = True ) close_enough = 1e-08 answer = np . array ( [ [ 0.00024976 , 0.00023018 ] , [ 0.00023043 , ( - 0.00024997 ) ] ] ) assert np . all ( ( np . abs ( ( ww . wcs . pc - answer ) ) < close_enough ) ) answer = np . array ( [ [ 202.39265216 , 47.17756518 ] , [ 202.39335826 , 47.17754619 ] , [ 202.39406436 , 47.1775272 ] ] ) assert np . all ( ( np . abs ( ( result - answer ) ) < close_enough ) )
from github issue #1463 .