pro sumer_distort_dstr, dstr, xoff=xoff, yoff=yoff detector=strmid(fxpar(dstr.h, 'DETECTOR'),4, 1) tmp=sumer_distort_cor(det=detector) ll_pos = sumer_ll_pos(dstr.refpixels, dstr.sumpixels) for l=0, dstr.ndata-1 do begin dstr.data(*,*,*,l) = sumer_distort_cor(float(dstr.data(*,*,*,l)),$ ll_pos(0,l), ll_pos(1,l), xoff_new, yoff_new, $ xoff=xoff, yoff=yoff) dstr.sumpixels(0,l) = dstr.sumpixels(0,l)-ll_pos(0,l)+xoff_new dstr.sumpixels(1,l) = dstr.sumpixels(1,l)-ll_pos(1,l)+yoff_new endfor end