pro images,log ;pc version, 11/23/04 ;written by csee, sometime during the middle ages... print,'' print,'This program prints images frames from the specified log to the screen.' print,'The default is the current test log.' cd,'',current=cdir & cd,cdir ;the current directory is the default log if n_params() eq 0 then log = cdir ;test for # of input parameters print,'' print,'The operant Test Log is: ',log ;____________________________________________________________________________ ;List Files... ;files=findfile(log+'/DB/Image/*', count = nfiles) ;wont work for many files ;spawn,'lsf '+log+'/DB/Image/*',files ;causes /bin/lsf: Arg list too long. err sometimes cd,log+'\DB2\Image\',current=cdir ;spawn,'lsf ',files files=file_search() cd,cdir s=size(files) nfiles=fix(s(1)) numfiles=sstr(nfiles) ;numfiles=short string (nfiles) if files(0) eq '' then begin & print,'No files found' & goto,exit & endif print,'The number of Images in this log is: ',sstr(nfiles) ;____________________________________________________________________________ ;Initialize... auto=1 ;for auto=1 tvscl min=0 ;the tvscl min setting max=4095 ;the tvscl max setting ilast=0 ;ilast is the previous value of i ff=-1 ;flag for flat fields, 1=>enabled, -1=>disabled menu: ;print,'' ;print,'To quit enter -1, To change minimum enter -2, to change maximum enter -3' ;print,'To autoscale enter -4, to scale from min to 2 x average enter -5' ;print,'To print the current image enter -6, to toggle flat field enter -7' ;print,'To return to this menu enter 0' print,'' print,'Enter to... Enter to... print,' 0 Get this menu -4 Autoscale, min to max print,' -1 Quit the program -5 Scale from min to 2 x average print,' -2 Change minimum -6 Print current image print,' -3 Change maximum -7 Toggle flat field ;____________________________________________________________________________ ;Loop that reads the desires... again: i=0 ;make i an integer print,'Pick a file (from 1 to ',sstr(nfiles),') or choose from menu: ' read,i ;i=file index if i eq 0 then goto,menu ;display menu if i eq -1 then goto, exit ;end of program if i eq -2 then begin ;set minimum of stretch auto=0 read,'Min? ',min i=ilast endif if i eq -3 then begin ;set maximum of stretch auto=0 read,'Max? ',max i=ilast endif if i eq -4 then begin ;autoscale to max and min auto=1 i=ilast endif if i eq -5 then begin ;autoscale, range = minimum to 2 x average auto=2 i=ilast endif if i eq -6 then begin ;prints current image set_plot,'ps' device,filename = 'c:\idl.ps',/times,/portrait,xsize=7.5,ysize=9,yoffset=1.0,/inches,bits_per_pixel=8 ;;device,filename = 'c:\idl.ps',/times,/portrait,xsize=4.5,ysize=5.4,yoffset=1.0,/inches,bits_per_pixel=8 if auto eq 1 then tvscl,bytscl(p,min=min(p),max=max(p),top=255) else tvscl,bytscl(p,min=min,max=max,top=255) ;p>minmin