;+ ; NAME: image_shift_maskedges ; PURPOSE: ; When shifting an image, manipulate the bad pixel mask ; appropriately such that the correct edges of the shifted ; image are declared bad. ; NOTES: ; This doesn't worry about bad pixels in the interior of the image - ; for now. This relies on rounding the shift such that it's only the ; fractional part and thus using the bad pixel mask for the nearest integer ; pixel is not such a bad idea. You still should have fixed via interpolation ; all bad pixels before any subpixel shifting, of course. ; ; INPUTS: ; badpix bad pixel mask ; xshift, yshift x and y image shifts ; This code assumes |x| < 1, |y| < 1 ; KEYWORDS: ; OUTPUTS: ; Modifies the supplied badpix mask. ; ; HISTORY: ; Began 2004-10-21 20:27:33 by Marshall Perrin ;- PRO image_shift_maskedges,badpix,xshift,yshift sz = size(badpix) if xshift lt 0 then badpix[sz[1]-1,*]=0 if xshift gt 0 then badpix[0,*]=0 if yshift lt 0 then badpix[*,sz[2]-1]=0 if yshift gt 0 then badpix[*,0]=0 end