C+ C NAME: C MkLOSWeightsm C PURPOSE: C To make weights for each source C CATEGORY: C Tomography C CALLING SEQUENCE: subroutine MkLOSWeightsmm(IM,dS,NS,NL,FR,SS,XE,RR,WW,PWR) C INPUTS: C IM integer Mode of operation C 1 = Velocity weights - 327 MHz C 2 = G-level weights - 81.5 MHz C 3 = UCSD velocity - 72.8 MHz C 4 = EISCAT velocity ~1000. MHz C 5 = MEXART data - 140.0 MHz C 6 = Thomson scat U weights C 7 = Thomson scat B weights C 8 = Thomson scat V weights C dS real resolution along LOS (in units of RR) C NS integer # segments of length dS along LOS C NL integer # IPS data points C FR(NL) real Radio frequency used C SS(NL) real IPS source size at the given frequency C XE(NL) real IPS line of sight elongations (deg) C RR(NL) real Observer-Sun distance (AU) C PWR real See PROCEDURE C OUTPUTS: C WW(NS,NL) real Weights at each pos. along the L.O.S per source C CALLS: C AIPS_WTF, THOM_WTF C SEE ALSO: C LosWeights C PROCEDURE: C > Note that dS is defined in units of the observer-Sun distance; NOT in AU C > If the radial power index PWR is not 2, then an additional weight factor is C included. The extra term comes from the radial dependence of the density fluctations C in the los integral. delta(n)^2 ~ r^[-2*(2-PWR)] C MODIFICATION HISTORY: C NOV, 1995 B. Jackson (STEL,UCSD) C Nov. 2012 B. Jackson (UCSD) C- real FR(NL), ! Radiofrequency for this site & SS(NL), ! IPS source size at this frequency & XE(NL), ! Source elongations & RR(NL), ! Distance from the Sun (AU) & WW(NS,NL) ! N wts. at each pos. along the L.O.S per src. S(J) = (J-.5)*dS ! Distance along los in units of RR !$omp parallel private(I,J,PW,E,R,dR) if (IM .le. 4) then ! IPS scintillation weights !$omp do schedule(static) do I=1,NL ! Loop over all lines of sight R = RR(I) do J=1,NS ! First line of sight if(SS(J).eq.0.0) then WW(J,I) = AIPS_WTF(IM,S(J)*R) else C IMM = 5 C WW(J,I) = AIPS_WTFm(IMM,SS(J),S(J)*R) WW(J,I) = AIPS_WTFmm(FR(J),SS(J),S(J)*R) end if end do end do !$omp end do nowait PW = 2.*(2.-PWR) !------- ! Add additional weight factor if PWR ne 2 if (PW .ne. 0.) then !$omp do schedule(static) do I=1,NL ! Loop over lines of sight do J=1,NS R = sqrt(RR(I)*RR(I)+S(J)*S(J)-2.*RR(I)*S(J)*cosd(XE(I))) WW(J,I) = WW(J,I)/R**PW end do end do !$omp end do nowait end if else ! Thomson scattering weights: Helios U/B/V filter !$omp do schedule(static) do I=1,NL E = abs(XE(I)) ! Elongation (deg) R = RR(I) dR = dS*R do J=1,NS WW(J,I) = THOM_WTF(R,S(J)*R,E,IM-5)*dR end do end do !$omp end do nowait end if !$omp end parallel return end