pro imagemovie,log imagetype='HRI ' db='DB2' ;DB or DB2? 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... cd,log+db+'\Image\',current=cdir files=file_search("*MMX*") 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=2 ;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 ;____________________________________________________________________________ ;Loop that reads the desires... i=1 again: i=fix(i)+1 ;make i an integer ;;print,'Pick a file (from 1 to ',sstr(nfiles),') or choose from menu: ' ;;read,i ;i=file index ;____________________________________________________________________________ ;Read & present file... d_read,log+db+'\Image\'+files(i-1),h,p ;determine image type and apply flat field if required... type=d_value(h,96) typ='Unknown' model=d_value(h,219) ;the model is needed to get the right flat field... case model of 'DISR1': model='DISR#1' 'DISR2': model='DISR#2' 'DISR3': model='DISR#3' else: model='Unknown' endcase if model eq 'Unknown' then begin print,'There is no flat field for model: ',d_value(h,219) ff=-1 endif if type eq 21 then begin typ='MRI ' if ff eq 1 then begin d_read,'\local\Imagers\Flat_Field\'+model+'\dli2_flat_field.disrsoft',hff,pff if model eq 'DISR#1' then pff=pff/256. ;DISR1 Flat field is wrong p=p/pff endif endif if type eq 22 then begin typ='SLI ' if ff eq 1 then begin d_read,'\local\Imagers\Flat_Field\'+model+'\sli_flat_field.disrsoft',hff,pff if model eq 'DISR#1' then pff=pff/256. ;DISR1 Flat field is wrong p=p/pff endif endif if type eq 23 then begin typ='HRI ' if ff eq 1 then begin d_read,'\local\Imagers\Flat_Field\'+model+'\dli1_flat_field.disrsoft',hff,pff if model eq 'DISR#1' then pff=pff/256. ;DISR1 Flat field is wrong p=p/pff endif endif if typ ne imagetype then goto,again ilast=i p=rotate(p,2) s=size(p) p=rebin(p,2*s(1),2*s(2)) ;,/sample) ;doubles image size if auto eq 2 then begin & min=min(p) & max=2*mean(p) & endif if auto eq 1 then begin & min=min(p) & max=max(p) & endif tvscl,p>min