;+ ; NAME: ; ThomsonPDistance ; PURPOSE: ; Find the distance to the plane of the sky where a single electron ; would have a given polarization. ; CALLING SEQUENCE: FUNCTION ThomsonPDistance, ElSun, U, P ; INPUTS: ; ElSun array distance Sun-Electron (in solar radii) ; U array limb darkening coefficient ; P array polarization (-1<=P<=1) ; OUTPUTS: ; ThomsonPDistance ; array distance to the plane of the sky (solar radii) (>=0) ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; SyncArgs, ThomsonSoup ; PROCEDURE: ; > The distance to the plane of the sky is given as a positive number. ; There are two locations on either side of the plane of the sky ; which match the polarization. ; > An electron can only produce a positive polarization. If a negative ; polarization is specified, then D=-1. is returned ; > An electron can only produce a polarization below a certain maximum ; (less than one). If a polarization above the maximum value is specified ; the D=-1. is returned. ; MODIFICATION HISTORY: ; JUL-1996, Paul Hick (UCSD) ;- D = 0. SyncArgs, ElSun, P, D ThomsonSoup, ElSun, U, E, F Q = P*(2*E/F-1) I = where(P LE 0 OR Q GT 1) IF I[0] NE -1 THEN D[I] = BadValue(D) I = where(0 LT P OR Q LE 1) IF I[0] NE -1 THEN D[I] = ElSun[I]*sqrt((1-Q[I])/(1+P[I])) RETURN, D & END