pro shift_div_graph, imone, imtwo, imnew, sclmin, sclmax, XRANGE = xrange, YRANGE = yrange, DZV=DIV_ZERO_VAL, scale = scale ; USAGE: ; shift_div_graph, im1, im2, pn, .9, 1.1, xrange=[0,1339], yrange=[0,1299], scale=0.5, DZV=999 ; HINT: enter 9 for the xcoordinate to exit the program ; imone gets shifted by xshift and yshift, then divided by imtwo ; any pixels that get divided by zero are given the value DIV_ZERO zmask = imtwo eq 0 ; where the zeros are nzmask = imtwo ne 0 ; where the non-zeros are imtwo_b = imtwo + zmask ; make all the zeros ones x = 0.0 y = 0.0 while ( x ne 9 ) do begin imnew = shift_im_cbc(imone, x, y) / imtwo_b ; do the shifting and ; division if KEYWORD_SET(DIV_ZERO_VAL) then $ imnew = imnew * nzmask + (zmask * DIV_ZERO_VAL) $ else imnew = imnew * nzmask xmin = 335 xmax = 1005 ymin = 325 ymax = 1005 if KEYWORD_SET(XRANGE) then begin xmin = xrange[0] xmax = xrange[1] endif if KEYWORD_SET(YRANGE) then begin ymin = yrange[0] ymax = yrange[1] endif imstat, imnew[xmin:xmax, ymin:ymax] if KEYWORD_SET(SCALE) then begin dispimage = bytscl(imnew[xmin:xmax, ymin:ymax], MAX = sclmax, MIN = sclmin) imsize = size(dispimage, /DIMENSIONS) tv, rebin( dispimage, imsize[0]* scale, imsize[1] * scale ) endif else begin tv, bytscl(imnew[xmin:xmax, ymin:ymax], MAX = sclmax, MIN = sclmin) endelse read, x, prompt = 'enter x shift: ' read, y, prompt = 'enter y shift: ' endwhile end