;+ ;NAME: ; distortion1 ;PURPOSE: ; Crude estimate of distortion from m=0 to m=1 on MOSES. The assumptions ; are not right, but the implication is that it may be necessary to include ; second-order terms when doing coordinate transforms between images. ;CALLING SEQUENCE: ; .run distortion1 ;MODIFICATION HISTORY: ; 2006-Jun-17 C. Kankelborg ;- ;Length scales (m) lambda = 30.4d-9 ;He II 304A d = 1d-6 ;groove spacing (roughly) pixel = 13.5d-6 ;pixel size (as I remember) f = 4.8d ;focal length (roughly) ;Model MOSES very approximately, putting the instrument into the ;z=0 plane (in instrument coordinates, where x is along Earth-Sun line), ;and pretending that all the detectors live in a common x=0 plane. y0 = (dindgen(2048)-(2047.0d/2.0d))*pixel ;y coords on detector m=0 y1 = f*tan( asin( sin(atan(y0/f)) - lambda/d ) ) ;Above formula ignores the vertical dimension. ;Detector coordinates corresponding to detector m=0 pixels: det0 = (y0-y0[0])/pixel det1 = (y1-y1[0])/pixel ;The above will greatly overestimate the magnification ratio of the two ;images, because detector m=1 is actually tilted inward, toward the grating. ;Create a demagnified version of det1: det1_demag = (det0[2047]/det1[2047]) * det1 ;Plot residual: residual = det1_demag - det0 plot, det0, residual, title='ROM Image distortion in m=1', $ xtitle='Detector coordinates (instrument y) in m=0', $ ytitle='Residual m=1 distortion after demagnification' print,'Rough estimate of maximum residual distortion after magnification' print,'is taken out: ', max(residual) - min(residual), ' pixels.' end