;+ ; NAME: ; SI_TO_CGS ; ; PURPOSE: ; Convert quantities from SI to CGS or the other way around ; ; ; CATEGORY: ; Solar-B utilities software ; ; CALLING SEQUENCE: ; si_to_cgs, inval, outval, unit = unit, quant = quant, /reverse ; ; ; INPUTS: ; inval: Input value (default in the SI system) ; ; ; ; KEYWORD PARAMETERS: ; unit: String describing unit of output value ; (e.g. [W m-2 sr-1] for intensity) ; quant: String describing what quantity inval/outval is. ; Default quantity is intensity. Other allowed quantities: None at the moment. ; reverse: Set this keyword to convert from CGS to SI ; ; OUTPUTS: ; outval: Ouput value (e.g intensity in CGS units) ; ; CALLS: ; ; COMMON BLOCKS: ; ; PROCEDURE: ; ; RESTRICTIONS: ; So far only intensity implemented. ; ; MODIFICATION HISTORY: ; 07-Sep-2005: Written by Oivind Wikstol ;- pro si_to_cgs, inval, outval, unit = unit, quant = quant, reverse = reverse if n_params() lt 2 then begin print, 'si_to_cgs, inval, outval, unit = unit, /intensity, /reverse' Return endif ; if reverse keyword set, convert from CGS to SI if keyword_set(reverse) then ret_system = 'SI' else ret_system = 'CGS' ; default assume invalues are intensity if not keyword_set(quant) then quant = 'intensity' ; if reverse keyword set - convert from CGS to SI, else convert from SI to CGS if quant eq 'intensity' then begin if keyword_set(reverse) then begin outval = inval*1.e-3 unit = '[W m-2 sr-1]' endif else begin outval = inval* 1.e3 unit = '[erg cm-2 s-1 sr-1]' endelse endif end