pro two_source_fit,vis,xpos,ypos,SC=sc ; ;PURPOSE: ; Given the source positions for a double source, find the ; relative amplitudes and fluxes from a given subcollimator set ; sc is set of 3 or more subcollimators from 1 to 9 ; METHOD: ; Uses vis = F1*R1(k)*exp(ik.x1)+F2*R2(k)*exp(ik.x2) default,sc,[5,6,7] if n_elements(sc) lt 3 then message,'Fewer than 3 subcollimators' pitch=(hsi_grid_parameters()).pitch k=1/pitch wsc0=where(vis.isc eq sc[0],n0) wsc1=where(vis.isc eq sc[1],n1) wsc2=where(vis.isc eq sc[2],n2) pa0=atan(vis[wsc0].v,vis[wsc0].u) pa1=atan(vis[wsc1].v,vis[wsc1].u) pa2=atan(vis[wsc2].v,vis[wsc2].u) i=complex(0,1) ; for first sc: kx=k[sc[0]-1]*cos(pa0) ky=k[sc[0]-1]*sin(pa0) phz1=kx*xpos[0]+ky*ypos[0] phz2=kx*xpos[1]+ky*ypos[1] ; find best fit to V = RF1*exp(i*phz1)+RF2*exp(i*phz2) ; Vreal=a*cos(phz1)+b*cos(phz2) ; for n0 values ; Vimag=a*sin(phz1)+b*sin(phz2); for n0 values return end restore,'MEMfit_sigvis_phzradset_2003-06-17_225310-225440E30-60ff.sav',/ver