FUNCTION read_four1 ; --------- ; Open file ; --------- OPENR, 1, 'four1_output.dat' ; ------------------------------------------- ; Determine array size (assumes 4-byte reals) ; ------------------------------------------- file_info = FSTAT( 1 ) n = ( file_info.size / 4 ) / 2 MESSAGE, STRING( n ) + ' real and imaginary points to be read', /INFO ; -------------------------------- ; Declare arrays and read the data ; -------------------------------- four1_real_data = FLTARR( n ) four1_imag_data = FLTARR( n ) READU, 1, four1_real_data, four1_imag_data CLOSE, 1 ; --------------- ; Return the data ; --------------- RETURN, COMPLEX( four1_real_data, four1_imag_data ) END