pro temp outdir='E:\H4RG-10-007\KPNO\07Apr26\reduced\' cd,outdir inlist='M13_inlist.txt' readcol,inlist,files1,format='a' ; files1=['M13_Dither0_0ArcSecondsEast_0ArcSecondsNorth_H4RG_SIPIN_15_Reads_Apr27_2007_02_04_51.fits', $ ; 'M13_Dither1_20ArcSecondsEast_0ArcSecondsNorth_H4RG_SIPIN_15_Reads_Apr27_2007_02_08_34.fits', $ ; 'M13_Dither2_20ArcSecondsEast_20ArcSecondsNorth_H4RG_SIPIN_15_Reads_Apr27_2007_02_11_26.fits', $ ; 'M13_Dither3_0ArcSecondsEast_20ArcSecondsNorth_H4RG_SIPIN_15_Reads_Apr27_2007_02_13_32.fits', $ ; 'M13_Dither4_20ArcSecondsWest_20ArcSecondsNorth_H4RG_SIPIN_15_Reads_Apr27_2007_02_15_41.fits', $ ; 'M13_Dither5_20ArcSecondsWest_0ArcSecondsNorth_H4RG_SIPIN_15_Reads_Apr27_2007_02_17_33.fits', $ ; 'M13_Dither6_20ArcSecondsWest_20ArcSecondsSouth_H4RG_SIPIN_15_Reads_Apr27_2007_02_19_38.fits', $ ; 'M13_Dither7_0ArcSecondsWest_20ArcSecondsSouth_H4RG_SIPIN_15_Reads_Apr27_2007_02_21_42.fits', $ ; 'M13_Dither8_20ArcSecondsEastt_20ArcSecondsSouth_H4RG_SIPIN_15_Reads_Apr27_2007_02_23_41.fits'] ; files1=['M53_Dither0_0ArcSecondsEast_0ArcSecondsNorth_H4RG_SIPIN_15_Reads_Apr27_2007_00_35_24.fits', $ ; 'M53_Dither1_20ArcSecondsEast_0ArcSecondsNorth_H4RG_SIPIN_15_Reads_Apr27_2007_00_38_15.fits', $ ; 'M53_Dither2_20ArcSecondsEast_20ArcSecondsNorth_H4RG_SIPIN_15_Reads_Apr27_2007_00_40_09.fits', $ ; 'M53_Dither0_0ArcSecondsEast_20ArcSecondsNorth_H4RG_SIPIN_15_Reads_Apr27_2007_00_42_49.fits', $ ; 'M53_Dither4_20ArcSecondsWest_20ArcSecondsNorth_H4RG_SIPIN_15_Reads_Apr27_2007_00_44_42.fits', $ ; 'M53_Dither5_20ArcSecondsWest_0ArcSecondsNorth_H4RG_SIPIN_15_Reads_Apr27_2007_00_46_52.fits', $ ; 'M53_Dither6_20ArcSecondsWest_20ArcSecondsNorth_H4RG_SIPIN_15_Reads_Apr27_2007_00_48_46.fits', $ ; 'M53_Dither7_20ArcSecondsWest_20ArcSecondsNorth_H4RG_SIPIN_15_Reads_Apr27_2007_00_51_24.fits', $ ; 'M53_Dither8_20ArcSecondsEast_20ArcSecondsSouth_H4RG_SIPIN_15_Reads_Apr27_2007_00_53_54.fits'] ; files1=['u62p0202_Dither0_0ArcSecondsEast_0ArcSecondsNorth_H4RG_SIPIN_20_Reads_Apr26_2007_22_05_26.fits', $ ; 'u62p0202_Dither1_20ArcSecondsEast_0ArcsSecondsNorth_H4RG_SIPIN_20_Reads_Apr26_2007_22_08_36.fits', $ ; 'u62p0202_Dither2_20ArcSecondsEast_20ArcsSecondsNorth_H4RG_SIPIN_20_Reads_Apr26_2007_22_11_06.fits', $ ; 'u62p0202_Dither3_0ArcSecondsEast_20ArcsSecondsNorth_H4RG_SIPIN_20_Reads_Apr26_2007_22_13_48.fits', $ ; 'u62p0202_Dither4_20ArcSecondsWest_20ArcsSecondsNorth_H4RG_SIPIN_20_Reads_Apr26_2007_22_16_42.fits', $ ; 'u62p0202_Dither5_20ArcSecondsWest_0ArcsSecondsNorth_H4RG_SIPIN_20_Reads_Apr26_2007_22_19_52.fits', $ ; 'u62p0202_Dither6_20ArcSecondsWest_20ArcsSecondsSouth_H4RG_SIPIN_20_Reads_Apr26_2007_22_22_22.fits', $ ; 'u62p0202_Dither7_0ArcSecondsWest_20ArcsSecondsSouth_H4RG_SIPIN_20_Reads_Apr26_2007_22_24_49.fits', $ ; 'u62p0202_Dither8_20ArcSecondsEast_20ArcsSecondsSouth_H4RG_SIPIN_20_Reads_Apr26_2007_22_27_51.fits'] ;file1='M13_Dither3_0ArcSecondsEast_20ArcSecondsNorth_H4RG_SIPIN_30_Reads_Apr27_2007_03_27_01.fits' ; Y band ;file1='M13_Dither4_0ArcSecondsEast_20ArcSecondsNorth_H4RG_SIPIN_30_Reads_Apr27_2007_02_48_12.fits' ; G band ;file1='M13_Dither2_20ArcSecondsEast_20ArcSecondsNorth_H4RG_SIPIN_15_Reads_Apr27_2007_02_11_26.fits' ; I band ;file1='M13_Dither3_0ArcSecondsEast_20ArcSecondsNorth_H4RG_SIPIN_15_Reads_Apr27_2007_02_13_32.fits' ; I band ;file2='Dark_H4RG_SIPIN_30_Reads_Apr27_2007_18_51_06.fits' file2='Dark_H4RG_SIPIN_20_Reads_Apr27_2007_18_11_46.fits' file2='Dark_H4RG_SIPIN_15_Reads_Apr27_2007_17_56_41.fits' for k=0,n_elements(files1)-1 do begin file1=files1(k) im1=readfits(file1,h) nreads=sxpar(h,'NREADS') im1=im1(*,*,nreads-1)-im1(*,*,0) im2=readfits(file2) im2=im2(*,*,nreads-1)-im2(*,*,0) diff=float(im1)-float(im2) diff2d=diff diff=0 diffsky=im2 im1=0 im2=0 z=histogram(diffsky/nreads/5.) plot,z,psym=10 vec=where(diffsky/nreads/5. gt 70.*nreads/15.) diff2dx=diff2d diff2dx(vec)=!VALUES.F_NAN for i=1,4094 do begin & for j=1,4094 do begin & if finite(diff2dx(i,j),/nan) then diff2dx(i,j)=mean(diff2dx(i-1:i+1,j-1:j+1),/NAN) & endfor & endfor zz=where(finite(diff2dx,/nan),count) for i=1,4094 do begin & for j=1,4094 do begin & if finite(diff2dx(i,j),/nan) then diff2dx(i,j)=mean(diff2dx(i-1:i+1,j-1:j+1),/NAN) & endfor & endfor zz=where(finite(diff2dx,/nan),count) for i=1,4094 do begin & for j=1,4094 do begin & if diff2dx(i,j) lt 0. then diff2dx(i,j)=mean(diff2dx(i-1:i+1,j-1:j+1),/NAN) & endfor & endfor zz=where(diff2dx lt 0,count) for i=1,4094 do begin & for j=1,4094 do begin & if diff2dx(i,j) lt 0. then diff2dx(i,j)=mean(diff2dx(i-1:i+1,j-1:j+1),/NAN) & endfor & endfor for i=1,4094 do begin & for j=1,4094 do begin & if diff2dx(i,j) lt 0. then diff2dx(i,j)=mean(diff2dx(i-1:i+1,j-1:j+1),/NAN) & endfor & endfor for i=1,4094 do begin & for j=1,4094 do begin & if diff2dx(i,j) lt 0. then diff2dx(i,j)=mean(diff2dx(i-1:i+1,j-1:j+1),/NAN) & endfor & endfor for i=1,4094 do begin & for j=1,4094 do begin & if diff2dx(i,j) lt 0. then diff2dx(i,j)=mean(diff2dx(i-1:i+1,j-1:j+1),/NAN) & endfor & endfor zz=where(diff2dx lt 100,count) tv,bytscl(diff2d,min=-200,max=1000) tv,bytscl(diff2dx,min=-200,max=1000) writefits,'reduced\'+file1+'_minus_'+file2+'_nohotpix.fits',diff2dx,h writefits,'reduced\'+file1+'_minus_'+file2+'_hotpix.fits',diff2d,h endfor ; plot,im2(2090,2017,*) ; oplot,im1(2090,2017,*),color=250 ; oplot,im1(2089,2017,*),color=250 ; oplot,im2(2089,2017,*),color=250 ; plot,im1(1955,2079,*) ; oplot,im2(1955,2079,*),color=250 ; end pro makemosaic outdir='E:\H4RG-10-007\KPNO\07Apr26\reduced\' cd,outdir inlist='M13_inlist.txt' readcol,inlist,files1,format='a' readcol,'M13_coords.txt',x,y offsets=fltarr(9,2) offsets(*,0)=max(x)-x offsets(*,1)=max(y)-y imx=fltarr(4096+max(offsets(*,0)),4096+max(offsets(*,1)),9) imx(*,*,*)=!VALUES.F_NAN for i=0,n_elements(files1)-1 do begin & dummy=float(readfits(files1(i)))-65536 & & imx(0+offsets(i,0):4095+offsets(i,0),0+offsets(i,1):4095+offsets(i,1),i)=dummy & endfor immed=median(imx,dimension=3) writefits,'x.fits',immed end im1=readfits('M13_Dither0_0ArcSecondsEast_0ArcSecondsNorth_H4RG_SIPIN_15_Reads_Apr27_2007_02_04_51.fits_minus_Dark_H4RG_SIPIN_15_Reads_Apr27_2007_17_56_41.fits_nohotpix.fits') im2=readfits('M13_Dither1_20ArcSecondsEast_0ArcSecondsNorth_H4RG_SIPIN_15_Reads_Apr27_2007_02_08_34.fits_minus_Dark_H4RG_SIPIN_15_Reads_Apr27_2007_17_56_41.fits_nohotpix.fits') imx(0:159,*)=im1(0:159,*) imx(160:4095,*)=(im1(160:4095,*)+im2(0:4095-160,*))/2. imx(4095:4095+159,*)=im2(4095-160:4095,*)