;+ ; NAME: ; ThomsonMidpoint ; PURPOSE: ; Calculate position along line of sight where the integrated intensity ; is half of the intensity integrated along the entire line of sight ; CALLING SEQUENCE: FUNCTION ThomsonMidpoint, ScSun,Elo, udark=udark, degrees=degrees, au=au ; INPUTS: ; ScSun scalar distance of spacecraft from Sun ; Elo scalar elongation of s/c line of sight (l.o.s.) in degrees. ; Elo=0 is the direction to the Sun ; OPTIONAL INPUT PARAMETERS: ; udark=udark scalar; type: float; default: 0 ; limb darkening constant ; /degrees if set all angles are in degrees (default is radians) ; /au if set all distances are in AU (default: solar radii) ; OUTPUTS: ; ThomsonMidPoint ; scalar point on l.o.s. where intensity is half the total ; integrated intensity ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; ToRadians, ToSolarRadii, ThomsonLOSRomb, nrZbrac, nrZBrent, InitVar ; EXTERNAL: ; ThomsonMidpointFnc ; PROCEDURE: ; First nrZbrac is used to bracket the zero of function ThomsonMidpointFnc. ; Then nrZBrent is used to locate the zero. ; MODIFICATION HISTORY: ; JAN-1997, Paul Hick (UCSD) ;- Tiny = 1.e-5 E = Elo *ToRadians(degrees=degrees) R = ScSun*ToSolarRadii(au=au) InitVar, udark, 0.0 arg = ThomsonLOSRomb(R, E, udark=udark) ; Intensity from 0 to infinity arg = [R, E, udark, 0.5*arg] ; Args need for ThomsonLOSRomb call in ThomsonMidpointFnc SHi = R*(cos(E) > 0.1) ; Distance to plane of sky X = nrZbrac ('ThomsonMidpointFnc',0.,SHi, fixX=1, arg=arg) X = nrZBrent('ThomsonMidpointFnc',0.,SHi, Tiny , arg=arg) RETURN, X & END