function two_src_visibility1,flux,area,x,y,sc,pa=PA,PLOT=plot ; PURPOSE: returns complex visibility of two sources on ONE RHESSI uvcircle ; INPUTS: ; Flux = float(2) = flux vector for two sources ; Area = float(2) = area vector for two sources ; = !pi*[a1^2,a2^2] where a1, a2 are Gaussian widths in asec ; x = float(2) = x coordinate of two sources relative to map center (asec) ; y = float(2) = y coordinate of two sources relative to map center (asec) ; sc = scalar 1 to 9 ; ;OPTIONAL INPUTS: ; pa = vector of position angles (defaults to 32 values on 0 to 2*!pi) ; /plot to plot the amplitude profile ; ; OUTPUT: ; complex visibility of two sources ;;OPTIONAL INPUTS: ; ejs dec 12, 2006 default,pa,findgen(32)*!pi/32 ; from 0 to 180 degrees pitch=((hsi_grid_parameters()).pitch)[sc-1] kx=cos(pa) # (1/pitch) ky=sin(pa) # (1/pitch) k=sqrt(kx^2+ky^2) x1=x-mean(x) ; shift to center of sources y1=y-mean(y) relvis1= exp(-2*!pi*k^2*area[0]) relvis2= exp(-2*!pi*k^2*area[1]) phz1 = 2*!pi*(kx*x1[0]+ky*y1[0]) phz2 = 2*!pi*(kx*x1[1]+ky*y1[1]) i=complex(0,1) vis1 = relvis1*flux[0]*exp(i*phz1) vis2 = relvis2*flux[1]*exp(i*phz2) vis=vis1+vis2 amp=abs(Vis) if keyword_set(plot) then begin ; window,/free ti='TWO-SOURCE VISIBILITY AMPLITUDE FOR SC '+strcompress(fix(sc),/rem) plot,float(vis1),/xst,/yst,tit=ti,yra=[-1,1]*total(flux),psym=-6,symsiz=0.3 oplot,imaginary(vis1),line=-2,psym=-6,symsiz=0.3 oplot,float(vis2),line=-2 ; for j=0,8 do oplot,32*[j,j],[0.01,1]*total(flux) ; legend,/right,/bottom,['Flux='+strcompress(flux[0],/rem)+strcompress(flux[1]),$ ; 'xpos='+strcompress(x[0],/rem)+strcompress(x[1]),$ ; 'ypos='+strcompress(y[0],/rem)+strcompress(y[1]),$ ; 'area='+strcompress(area[0],/rem)+strcompress(area[1])],/clear,textcolor=1 print,sc,correlate( float(vis1),imaginary(vis1)) print,sc,correlate( float(vis2),imaginary(vis2)) stop endif ;stop return,vis end area=!pi*[2,2]^2 flux=[200.,100.] x=[-20,20] y=[-20,20] !p.multi=[0,3,3] for sc=1,9 do begin vism=two_src_visibility1(flux,area,x,y,sc,/plot) ; plot,vism,tit='SC='+strcompress(sc,/rem),yra=[-300,300],/xst,/yst,psym=-6,symsiz=0.3 ; oplot,imaginary(vism),line=2 ;write_png,'2src_visF200-100W3-3.png',255b-tvrd() endfor end