PRO check,name,num,size,nsigma ; ; This procedure goes through a specified number num of image files ; with the same name and sequential extensions and prints out the ; maximum and minimum values to the screen, along with the sequence ; number of the image. This allows the user to identify those images ; that require cleaning. ; OPENW,unit,name+'.log',/GET_LUN ; open change log file FOR i=0,num-1 DO BEGIN ext=get_ext(i) ; calculate extension for i-th file fname=name+'.'+ext img=imin(fname,size); read in image file fx=clean(img,1,nsigma,2) ; remove local spikes where there are ; at least 2 large interpixel gradients wc=WHERE(img NE fx)&nc=N_ELEMENTS(wc) IF wc(0) NE -1 THEN BEGIN ; at least 1 change has been made pc=img(wc) ; locate changed pixel(s) rv=INTARR(nc)&cv=rv ; arrays for cols, rows of changed pixels FOR j=0,nc-1 DO BEGIN xy,wc(j),size,c,r&cv(j)=FIX(c)&rv(j)=FIX(r) ENDFOR PRINTF,unit,fname,':' ; update log file with file name, PRINT,fname,':' PRINTF,unit,'Cols: ',cv ; columns of changed pixels, PRINT,'Cols: ',cv PRINTF,unit,'Rows: ',rv ; rows ... , and PRINT,'Rows: ',rv PRINTF,unit,'Vals: ',pc ; values of changed pixels PRINT,'Vals: ',pc PRINTF,unit,' ' imout,fname,fx ; save cleaned image ENDIF ELSE BEGIN PRINTF,unit,fname,':' PRINT,fname,':' PRINTF,unit,'no changes' PRINT,'no changes' PRINTF,unit,' ' ENDELSE ENDFOR CLOSE,unit FREE_LUN,unit RETURN END