pro image_cmpr2,dir1,dir2 ; ;Created by Chuck See ; ;This is the like image_cmpr.pro except it provides a ;hardcopy output, and show3. ;This program accepts two directories where images exist, ;and performs a pixel by pixel subtraction of the images: ; ; image_in_dir1(i) - image_in_dir2(i) ; cd,dir1 files1=findfile('*', count = nfiles1) ;creates file list cd,dir2 files2=findfile('*', count = nfiles2) ;creates file list ; if nfiles1 NE nfiles2 then print,"Not an equal # of images in each directory" ; again: ; nfiles=strcompress(string(nfiles1-1)) ; print, "Which file do you wish to compare? (No. 0 thru " $ ,nfiles,".) To quit enter -1" read,n if n eq -1 then goto, exit ; cd,dir2 d_read,files2(n),h2,p2 cd,dir1 d_read,files1(n),h1,p1 ; p=p1-p2 ; ;window,0 ; print,'First Image' tvscl,p1,0,270 wait,1 ; Print, 'Second Image' tvscl,p2,200,270 wait,1 ; Print, 'First Image - Second Image' tvscl,p ; set_plot,'ps' device,filename = '~/idl.ps',/palatino,/landscape ; tvscl,p1 erase tvscl,p2 erase tvscl,p erase ; !p.title='First Image' show3,p1 ; !p.title='Second Image' show3,p2 ; !p.title='First Image - Second Image' show3,p ; device,/close_file spawn,'lp ~/idl.ps' set_plot,'x' ; goto, again ; exit: ;stop end