#NEWLINE# @ attr ( speed = 'slow' ) #NEWLINE# def test_4d( ) : #NEWLINE# #INDENT# ' reading/writing of 4D Varian fid file ' #NEWLINE# ( dic , data ) = ng . varian . read_fid ( os . path . join ( DATA_DIR , 'agilent_4d/fid' ) , shape = ( 8 , 12 , 16 , 1400 ) , torder = 'r' ) #NEWLINE# assert ( dic . shape == ( 8 , 12 , 16 , 1400 ) ) #NEWLINE# assert ( np . abs ( ( data [ ( 0 , 1 , 2 , 3 ) ] . real - 395.11 ) ) <= 0.01 ) #NEWLINE# assert ( np . abs ( ( data [ ( 0 , 1 , 2 , 3 ) ] . imag - 52.72 ) ) <= 0.01 ) #NEWLINE# assert ( np . abs ( ( data [ ( 3 , 10 , 11 , 18 ) ] . real - 51.81 ) ) <= 0.01 ) #NEWLINE# assert ( np . abs ( ( data [ ( 3 , 10 , 11 , 18 ) ] . imag - 16.01 ) ) <= 0.01 ) #NEWLINE# write_fid_readback ( dic , data , ( 8 , 12 , 16 , 1400 ) , 'r' )