def test_no_truncate_crval_p17():
 w = wcs.WCS(naxis=2)
 w.wcs.crval = [50.123456789012344, 50.123456789012344]
 w.wcs.cdelt = [0.001, 0.001]
 w.wcs.ctype = [u'RA---TAN', u'DEC--TAN']
 w.wcs.set()
 header = w.to_header()
 assert (header[u'CRVAL1'] != w.wcs.crval[0])
 assert (header[u'CRVAL2'] != w.wcs.crval[1])
 header = w.to_header(relax=wcs.WCSHDO_P17)
 assert (header[u'CRVAL1'] == w.wcs.crval[0])
 assert (header[u'CRVAL2'] == w.wcs.crval[1])

def test_no_truncate_crval_p17 ( ) : w = wcs . WCS ( naxis = 2 ) w . wcs . crval = [ 50.123456789012344 , 50.123456789012344 ] w . wcs . cdelt = [ 0.001 , 0.001 ] w . wcs . ctype = [ u'RA---TAN' , u'DEC--TAN' ] w . wcs . set ( ) header = w . to_header ( ) assert ( header [ u'CRVAL1' ] != w . wcs . crval [ 0 ] ) assert ( header [ u'CRVAL2' ] != w . wcs . crval [ 1 ] ) header = w . to_header ( relax = wcs . WCSHDO_P17 ) assert ( header [ u'CRVAL1' ] == w . wcs . crval [ 0 ] ) assert ( header [ u'CRVAL2' ] == w . wcs . crval [ 1 ] )
regression test for URL .