;________________________________________________________________________________ ; ;IDL function DI_SMEAR.PRO ; ; ; This IDL function uses the resistant_mean value of the parallel overscan rows 2-5 ; (for Quadrants 3 & 4) and 1018 to 1021 (for Quadrants 1 & 2) in a Deep Impact ; CCD image to form an estimate of the smear value in each row of the quadrant. ; The smear value is then subtracted from the row, and the procedure is repeated ; row by row up the image, first from the bottom quadrants, then from the top. The ; resulting de-smeared image is returned as a result of the function call. ; ; ; INPUTS : INIMAGE, a 1024 x 1024 DI image array ; ; FLAT, a 1024 x 1024 DI flatfield for the DI CCD creating the image ; (user can input fltarr(1024,1024) + 1.0 if no flat exists) ; ; ; OUTPUTS : OUTIMAGE, a 1024 x 1024 DI image array, with smear removed ; ; ; CML 3/4/03 ; BTC 20030305 - array-ified, assumes resistant_mean returns vector mean ; ; ;________________________________________________________________________________ function di_desmear,inimage,flat sz = size(inimage) ;;; assume inimage is 2D [ncol,nrow] ncol = sz[1] nrow = sz[2] nro2 = nrow / 2L binning = 1024L / nrow topstart = 2L / binning topend = (5L / binning) > topstart botstart = 1018L / binning botend = (1021 / binning) > botstart resistant_mean,inimage[*,topstart:topend],3.0,bsm,sumdim=2 resistant_mean,inimage[*,botstart:botend],3.0,tsm,sumdim=2 ;;; [[bsm],[bsm]] & [[tsm],[tsm]] are [ncol,2] smear = [ [rebin([[bsm],[bsm]],ncol,nro2)] $ , [rebin([[tsm],[tsm]],ncol,nro2)] ] if n_elements(flat) ne n_elements(inimage) then lflat = 1.0 else lflat = flat return, inimage - (lflat*smear/4.0) ;;;Overscan is 4x co-add in Mode 1 end