PRO checkmod,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 extdig=checkext(name) FOR i=0,num-1 DO BEGIN ext=get_ext(i,extdig) ; calculate extension for i-th file fname=name+'.'+ext rdkimg,fname,h,img ; read in image file tmp=cleanmod(img,2,nsigma,2); remove local spikes where there are ; at least 2 large interpixel gradients fx=cleanmod(tmp,2,nsigma,2) ; do it again for good measure 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) xy,wc,size,cv,rv ; get column and row numbers 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,' ' wrkimg,fname,h,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