PRO stidfix,da,cam,filt,exp,mode,imnum,sdev,amp @isitdos !ORDER=1 WINDOW,0 IF N_PARAMS() LT 6 THEN BEGIN sdev=3 amp=3 ENDIF IF N_PARAMS() LT 7 THEN amp=3 rimg=INTARR(256,256,3) pimg=FLTARR(256,256,3) dimg=FLTARR(256,256,3) rdmeandk,FIX(cam),FIX(exp),dk WHILE imnum-1 LE 0 DO BEGIN PRINT,'Please choose a new image number since there is no image previous to this one' READ,imnum ENDWHILE file=STRARR(3) file(0)= STRING(mpaths(mode),dd,cc,cam,dd,ff,filt,dd,firstchars(mode),da,cam,filt,exp,$ imnum, FORM='(A,A1,A,I1,A1,A,I1,A1,A,I2.2,2I1,I3.3,".",I3.3)') file(1)= STRING(mpaths(mode),dd,cc,cam,dd,ff,filt,dd,firstchars(mode),da,cam,filt,exp,$ (imnum-1), FORM='(A,A1,A,I1,A1,A,I1,A1,A,I2.2,2I1,I3.3,".",I3.3)') file(2)= STRING(mpaths(mode),dd,cc,cam,dd,ff,filt,dd,firstchars(mode),da,cam,filt,exp,$ (imnum+1), FORM='(A,A1,A,I1,A1,A,I1,A1,A,I2.2,2I1,I3.3,".",I3.3)') FOR i=0,2 DO BEGIN print,file(i),FORM='("READING : ",A)' rdkimg,file(i),hb,ximg kh = gethd(hb) help,/st,kh.misc.tm rimg(*,*,i) = ximg(*,*) ENDFOR FOR i=0,2 DO BEGIN tmp0=rimg(*,*,i)-dk IF i EQ 0 THEN umed=mean(tmp0) pimg(*,*,i)=tmp0-MEDIAN(tmp0,5) sig=STDEV(pimg(*,*,i),mean) pimg(*,*,i)=(pimg(*,*,i)-mean)/sig cell=REPLICATE(1B,7,7) dimg(*,*,i)=DILATE((pimg(*,*,i) GT sdev),cell) IF i EQ 0 THEN u=mean ENDFOR simg=TOTAL(dimg,3) nimg=(simg GT 2) stimg=nimg*(pimg(*,*,0) GT sdev) wkimg=(rimg(*,*,0)-dk)+amp*umed*stimg stars=WHERE(stimg) tvscl,rimg(*,*,0)