;+ ; NAME: ; ToSolarRadii ; PURPOSE: ; Returns factor needed to convert distance to solar radii ; CATEGORY: ; Thomson scattering ; CALLING SEQUENCE: FUNCTION ToSolarRadii, au=au ; OPTIONAL INPUT PARAMETERS: ; au=au if not set then rpau=1 is returned ; if set then the number of au per solar radii is returned ; OUTPUTS: ; Result multiplicative factor to convert to solar radii ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; InitVar ; PROCEDURE: ; Many of the Thomson scattering procedures have a keyword /au to indicate ; that in- and output distances are in AU rather than the default units of ; solar radii. This function provides the conversion factor needed to ; convert to solar radii irrespective of the setting of keyword /au. ; MODIFICATION HISTORY: ; FEB-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu ;- InitVar, au, /key CASE au of 0: rpau = 1 1: rpau = 1/!sun.RAu ; Converts AU to solar radii ENDCASE RETURN, rpau & END