;+ ; NAME: ; ThomsonMidpointFar ; PURPOSE: ; Calculate position along line of sight where the integrated ; intensity is half of the intensity integrated along the ; entire line of sight (treating the Sun as a point source ; CALLING SEQUENCE: ; S = ThomsonMidpoint(ScSun,Elo,U,/degrees) ; INPUTS: ; ScSun array distance of spacecraft from Sun in AU ; Elo array elongation of s/c line of sight (l.o.s.) in degrees. ; Elo=0 is the direction to the Sun ; OUTPUTS: ; ThomsonMidPointFar ; array point on l.o.s. where intensity is half the total ; integrated intensity ; CALLS: ; ThomsonLOS, nrZbrac, nrZBrent, SyncArgs, ToRadians, BadValue ; EXTERNAL: ; RESTRICTIONS: ; PROCEDURE: ; MODIFICATION HISTORY: ; JAN-1997, Paul Hick (UCSD) ;- FUNCTION ThomsonMidFar, S,E ; Internal use only ; Input S in units of Observer-Sun distance @compile_opt.pro ; On error, return to caller sE = sin(E) cE = cos(E) Y = S-cE ; Distance to plane of sky Y2 = Y*Y sE2 = sE*sE YE = Y2+sE2 RETURN, Y*(Y2+3*sE2/5)/(YE*YE)+cE*(1-2*sE2/5)/2+(atan(Y,sE)-E/2)/sE END FUNCTION ThomsonMidpointFar, ScSun, Elo, degrees=Degrees @compile_opt.pro ; On error, return to caller dpr = ToRadians(degrees=Degrees) TinyElo = 2.*dpr Tiny = 1.E-5 Mid = 0. SyncArgs, Elo, Mid L = where(Elo*dpr LT TinyElo) IF L[0] NE -1 THEN Mid[L] = cos(Elo[L]*dpr)+(32./(15*!Pi))^(1./3.)*sin(Elo[L]*dpr) L = where(Elo*dpr GT !pi-TinyElo) IF L[0] NE -1 THEN Mid[L] = cos(Elo[L]*dpr)+2.^(1./3.)*(1-2.^(-5./3.)*sin(Elo[L]*dpr)^2) L = where(TinyElo LE Elo*dpr AND Elo*dpr LE !pi-TinyElo) IF L[0] NE -1 THEN BEGIN Mid[L] = BadValue(Mid) SHi = cos(Elo[L]*dpr) > 0.1 ; Distance to plane of sky X = nrZbrac ('ThomsonMidFar',0.,SHi,fixx=1,arg=Elo[L]*dpr) Mid[L] = nrZBrent('ThomsonMidFar',0.,SHi,Tiny,arg=Elo[L]*dpr) ENDIF RETURN, ScSun*Mid & END