FUNCTION read_fft_input ; --------- ; Open file ; --------- OPENR, 1, 'fft_input.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 ; -------------------------------- real_data = FLTARR( n ) imag_data = FLTARR( n ) READU, 1, real_data, imag_data CLOSE, 1 ; --------------- ; Return the data ; --------------- RETURN, COMPLEX( real_data, imag_data ) END