; NAME: ; DISTORT ; ; PURPOSE: ; Spreads frame in x direction with gaussian, ; Curves the frame, then tilts the frame ; ; CALLING SEQUENCE: ; Result = DISTORT(inframe, header, bx, by) ; ; INPUTS: ; Inframe = The frame to be modified ; Header = The header file ; BX = Buffer in x direction ; BY = Buffer in y direction ; ; OUTPUT: ; A modified frame that has been spread, titled, and curved ; ; PROCEDURE: ; Grap variables out of the header, and modify them as needed to ; fit the larger frame pre-rotation. Then spread the frame in ; the spacial direction using cnvlgauss. Next curve the frame, ; and finally rotate the frame. ; ; FUNCTIONS CALLED: ; sxpar, cnvlgauss, curveframe ; ; MODIFICATION HISTORY: ; created Augest 1 2003 by John Dermody function DISTORT, inframe, header, bx, by, xpos=xpos, xin=xin ; initialize variables tx = (size(inframe))[1] ty = (size(inframe))[2] seeing = sxpar(header, 'SEEING') tiltangle = sxpar(header, 'TILT') xamp = sxpar(header, 'TRACEAMP') xosc = sxpar(header, 'TRACEOSC') * (tx / (tx - 2 * bx)) yamp = - sxpar(header, 'SMILE') yosc = 0.5 * (ty / (ty - 2 * by)) ; modify frame outframe = cnvlgauss(inframe, fwhm=seeing) outframe = curveframe(outframe, xamp, xosc, yamp, yosc, xpos=xpos, xin=xin) outframe = (rot(outframe, tiltangle, cubic=-0.5))[bx:tx-bx-1, by:ty-by-1] return, outframe end