; Fast way of making a modulation pattern function modpat1d,NX,F1D,theta,aspp,xoffset,yoffset,dx,dy,xpixel,ypixel ;+ ; FUNCTION MODPAT1D.PRO ; ; PURPOSE: ; Projects a 1-dimensional modulation pattern onto a 2-dimensional ; array. The vector F1d must have 1-arcsec pixels. ; The pattern pixel locations given by the vectors xpixel and ypixel ; used to project F1d, are optional; they will be created by the ; program if they do not exist, and then used in subsequent calls. ; The array F1D must be at least 2048 pixels (arcsec) long. ; INPUTS: ; NX = size of 2-D modulation pattern to be produced ; F1D = 1-D array of values to be projected. Must be larger ; than 2047 pixels in size. 1 pixel = 1 arc sec ; theta = angle (radians) of F1D vector, CW from the x axis ; aspp = arc sec per pixel in modulation pattern map ; xoffset = x position of map center (in arc sec) ; yoffset = y position of map center (in arc sec) ; xpixel = vector of pixel indices of the x coordinate ; ypixel = vector of pixel indices of the y coordinate ; dx,dy = aspect position of telescope axis from sun center (arc sec) ; ; CALLING SEQUENCE: ; ; RESULT=modpat1d(NX,F1D,theta,aspp [,xpixel,ypixel]) ; Result is a reformed, 1-D version of the modulation pattern. ; Use reform(result,nx,nx) to make it 2-dimensional if required. ; ; METHOD: ; Each pixel of the modulation is read from the F1d "lookup table". ; The appropriate index in F1d is found by projecting a perpendicular ; from (xpixel,ypixel) in the modulation pattern onto the line ; passing through (dx,dx) with an orientation theta measured CCW ; from the x axis. For the finest HESSI collimator, pitch=4.3, ; so there are over 4 points per cycle for all collimators. ; There is no interpolation, since that would slow the program, but ; if better sampling is required, the lookup table F1d can be ; increased in size without appreciable decrease in speed. ; ; SPEED: ; Each call to function modpat1d takes about 3.8 ms on a Sun Ultra-1, ; or about 1.4 ms on a Sun Ultra-10, or a 333-MHz Pentium II. ; This suggests that one single-collimator back-projection map would ; take about 4 s (for an Ultra-1, or proportionately less for the ; faster machines), assuming 1000 photons or 1000 time bins. ; ; VERSION: 1.0 EJS 22 June 1998 ;-