; main ; fast_modpat NX=64 ; size of modul patrn map (map pixels) F1_length=2048. ; size of F1d table (table pixels) pitch=30 ; pitch in arc sec xoffset=64 ; offset from spin axis in asec yoffset=64 aspp=2 ; asec per map pixel delta=0 ; collimator phase in asec s2p=0.5 ; slit/pitch ratio s=findgen(F1_length)*2*!pi/pitch ; slit/pitch ratio ; CREATE A SYNTHETIC 1-D MODULATION PATTERN: d=[s2p^2,0,0,0] n= [1,2,3] ; use 1st 3 harmonics for triangle waveform d(n)=(1-cos(2*!pi*n*s2p))/(!pi^2*n^2) f1d=d(0)+d(1)*cos(s)+d(2)*cos(2*s)+d(3)*cos(3*s) ; INTRODUCE PSEUDO RANDOM JITTER AND SPIN-AXIS MOTION: theta=findgen(360)*!dtor dx=2.*(randomu(seed,360)-0.5)+20.*cos(theta) ; random jitter+ellipt. motion dy=2.*(randomu(seed,360)-0.5)+25.*sin(theta) ; random jitter+ellipt. motion t=systime(1) xpixel=0 & ypixel=0 ; FORCE MODPAT1D TO COMPUTE XPIXEL, YPIXEL ARRAYS for i=0,359 do begin theta=i*!dtor z=modpat1d(NX,F1D,theta,aspp,xoffset,yoffset,dx(i),dy(i),xpixel,ypixel) ; tvscl,reform(z,NX,NX),0 endfor time=systime(1)-t print,'elapsed time=',time,' time per modpat=',time/float(i) end