C+ C NAME: C LOSWeights C PURPOSE: C Determine weights for set of points along a line of sight C CATEGORY: C Tomography C CALLING SEQUENCE: subroutine LOSWeights(I__VD,IM,XE,XR,PPlos,WWlos,M2Mean) C INPUTS: C IM integer Mode of operation C 1 = Nagoya - 327 MHz C 2 = Cambridge - 81.5 MHz C 3 = UCSD - 72.8 MHz C 4 = Thomson scattering U weights C 5 = Thomson scattering B weights C 6 = Thomson scattering V weights C XE(NL) real IPS line of sight elongations (deg) C XR(NL) real Observer-Sun distance (AU) C PPlos(4,NLOS,NL) C OUTPUTS: C WWlos(NLOS,NL) real Weights at each pos. along the los C CALLS: C T3D_iget, T3D_get, IPSBase, ThomsonBase, IPSConst, ThomsonUBVConst, ElSunDistance, ArrR4Copy C ArrR4Total, Say C SEE ALSO: C MkLosWeights C INCLUDE: include 'sun.h' include 't3d_param.h' include 't3d_array.h' include 't3d_index.h' C include 't3d_loc_fnc.h' C RESTRICTIONS: C For the IPS weights a fudge is used to speed up calculations. C The average Sun-Earth distance is used for all lines of sight. As a result C only one line of sight needs to be calculated by IPSBase. C PROCEDURE: C If the radial power index PWR is unequal 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 JAN-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C Added extra weight factor to cover radial dependence of the los weight C factors. Also added the calculation of the mean scintillation index. C (pulling this out of the iteration loop provides a significant gain in speed). C- integer I__VD integer IM real XE (*) ! Source elongations real XR (*) ! Observer-Sun distance (AU) real PPlos (*) real WWlos (*) ! Weight at all los segments real M2Mean (*) real IPSBase character cSay*10 /'LOSWeights'/ character cFlt2Str*14 include 't3d_loc_fnc.h' S(J) = (J-.5)*dLOS ! Distance along los (units of observer-Sun distance) call T3D_iget(T3D__NLOS_V, 0, NLOS) call T3D_get (T3D__DLOS_V, 0, dLOS) if (I__VD .eq. TOM__V) call T3D_iget(T3D__NL_V, 0, NL ) if (I__VD .eq. TOM__G) call T3D_iget(T3D__NL_G, 0, NL ) if (I__VD .eq. TOM__V) call T3D_get(T3D__PWR_V, 0, PWR) if (I__VD .eq. TOM__G) call T3D_get(T3D__PWR_G, 0, PWR) if (IM .le. 3) then ! IPS scintillation weights call IPSConst(IM,freq,theta) !do I=1,NL ! Loop over lines of sight ! R = XR(I) ! Observer-Sun distance ! L = locLOS(0,I) ! do J=1,NLOS ! WWlos(L+J) = IPSBase(freq,theta,S(J)*R) ! end do !end do !------- ! The above way is the proper way, but it's slooooooooooooooooooooooooow ! The calculation below ignores the variation in Earth-Sun distance, ! but it's a lot faster. if (NL .gt. 0) then R = ArrR4Total(NL,XR,J)/NL! Use average Sun-Earth distance do J=1,NLOS WWlos(J) = IPSBase(freq,theta,S(J)*R) end do end if do I=2,NL ! Copy from first line of sight call ArrR4Copy(NLOS,WWlos,WWlos( locLOS(1,I) )) end do !------- ! Add extra weight factor when PWR ne 2 PW = 2.*(2.-PWR) call Say(cSay,'I','Radial','power index: '//cFlt2Str(-2.+PWR,3)) if (PW .ne. 0.) then do I=1,NL ! Loop over lines of sight do J=1,NLOS L = locLOS(J,I) WWlos(L) = WWlos(L)/PPlos( locPOS(LOS__RR,J,I) )**PW end do end do end if if (I__VD .eq. TOM__G) then ! Calculate mean scintillation indices do I=1,NL ! Loop over all lines of sight L = locLOS(1,I) M2Mean(I) = ArrR4Total(NLOS,WWlos(L),J) end do end if else call ThomsonUBVConst(IM-3,U,APM) ! Thomson scattering weights: Helios U/B/V filter do I=1,NL E = abs(XE(I)) ! Elongation (deg) R = XR(I) ! Observer-Sun distance (AU) dR = dLOS*R ! Los resolution (AU) do J=1,NLOS L = locLOS(J,I) ElSun = ElSunDistance(R,S(J)*R,E, SinChi)/SUN__RAU WWlos(L) = ThomsonBase(ElSun,SinChi,U, P,rIt,rItr)*dR end do end do end if return end