;========================================================================= ; IDL program to take praw_re.da and praw_im.da files from Carl Crawford's ; raw program in the crc package and generate real and imaginary time-domain ; arrays, the time-domain complex array, and real, imaginary, and ; phase and magnitude images. ; NOTE: When running the crc raw program, specify the debug=2 option, e.g., ; "raw debug=2 P54272". This will generate the real and imaginary data (as ; well as magnitude and phase image data). For this IDL code, use the ; praw_re.da and praw_im.da files for real and imaginary data, respectively. ; Do not use the *.mi files as input as they are offset by 512 and scaled ; to 0-1024! ; ; Author: e jackson ; Date: 01/27/97 ; Revisions: ; ;========================================================================= PRO P_FILE ;set input and display image size npts1=256 npts2=256 ;initialize and read filenames for the data files REAL_FILE = STRING(0) print, ' ' print, 'Real Channel Datafile:' read, REAL_FILE IMAG_FILE = STRING(0) print, ' ' print, 'Imaginary Channel Datafile:' read, IMAG_FILE ;check to see if user wants to phase-modulate raw data for shifts center_x_flag = FIX(0) center_y_flag = FIX(0) print,' ' print,'Shift along x? (0=no, 1=yes):' read, center_x_flag print,' ' print,'Shift along y? (0=no, 1=yes):' read,center_y_flag ;read in and display the real data OPENR, 1, REAL_FILE A = ASSOC(1,fltARR(npts1,npts2),512) real_data = rotate(rebin(a(0),npts1,npts2),1) close,1 ;read in and display the imaginary data OPENR, 1, IMAG_FILE A = ASSOC(1,fltARR(npts1,npts2),512) imag_data = rotate(rebin(a(0),npts1,npts2),1) close,1 ;display real and imaginary arrays and let user plot individual ;lines with the profiles tool window, 1, XPOS=1, YPOS=613, XSIZE=256, YSIZE=256, $ TITLE='Real' tvscl, real_data<500 profiles,real_data window, 2, XPOS=257, YPOS=613, XSIZE=256, YSIZE=256, $ TITLE='Imaginary' tvscl, imag_data<500 profiles,imag_data ;if necessary, modulate k-space data to shift center-of-FOV to center-of-image if center_y_flag EQ 1 then begin for i=1,255,2 do begin real_data(*,i) = -real_data(*,i) imag_data(*,i) = -imag_data(*,i) end ;i-loop end ;if center_y_flag if center_x_flag EQ 1 then begin for i=1,255,2 do begin real_data(i,*) = -real_data(i,*) imag_data(i,*) = -imag_data(i,*) end ;i-loop end ;if center_x_flag ;combine real and imaginary arrays into complex array real_imag_data = complex(real_data,imag_data) ;display real and imaginary images image = fft(real_imag_data) window, 3, XPOS=1, YPOS=357, XSIZE=256, YSIZE=256, $ TITLE='Real Image' tvscl,float(image) window, 4, XPOS=257, YPOS=357, XSIZE=256, YSIZE=256, $ TITLE='Imaginary Image' tvscl,imaginary(image) ;display phase and magnitude images window, 5, XPOS=1, YPOS=100, XSIZE=256, YSIZE=256, $ TITLE='Phase Image' tvscl,atan(imaginary(image)/float(image)) window, 6, XPOS=257, YPOS=100, XSIZE=256, YSIZE=256, $ TITLE='Magnitude Image' tvscl,abs(image) ;"That's all f-f-f-folks...." end ;P_FILE.pro