#NEWLINE# def test_scaled_data( self ) : #NEWLINE# #INDENT# with fits . open ( self . data ( 'scale.fits' ) ) as hdul : #NEWLINE# #INDENT# orig_data = hdul [ 0 ] . data . copy ( ) #NEWLINE# hdul [ 0 ] . scale ( 'int16' , 'old' ) #NEWLINE# hdul . writeto ( self . temp ( 'tmp.fits' ) , clobber = True , checksum = True ) #NEWLINE# with fits . open ( self . temp ( 'tmp.fits' ) , checksum = True ) as hdul1 : #NEWLINE# #INDENT# assert ( hdul1 [ 0 ] . data == orig_data ) . all ( ) #NEWLINE# assert ( 'CHECKSUM' in orig_data [ 0 ] . header ) #NEWLINE# assert ( hdul1 [ 0 ] . header [ 'CHECKSUM' ] == 'cUmaeUjZcUjacUjW' ) #NEWLINE# assert ( 'DATASUM' in hdul1 [ 0 ] . header ) #NEWLINE# assert ( hdul1 [ 0 ] . header [ 'DATASUM' ] == '1891563534' )