function goes_class2value, goes_class, floatx=floatx, doublex=doublex, $
   loud=loud
;
;+
;   Name: goes_class2value
;
;   Purpose: convert GOES XRay class, such as X1.3, M5.7, C2 -> Watts/m^2
;
;   Input Paramters:
;      goes_class - vector of one or more GOES XRay classes
;
;   Output: 
;      Function returns 1:1 Watts/m^2 for each input class
;      Historically, returned as string array; /FLOATX or /DOUBLEX     
;
;   Keyword Parameters:
;      /DOUBLEX or /FLOATX - return numbers instead of string array 
;     /LOUD - if set, run historical loud (and fairly useless) mode
;
;   History:
;      Circa: 20-sep-2002 - S.L.Freeland -     
;      18-Dec-2006 - S.L.Freeland - add /DOUBLEX & /FLOATX(synonyms) doc-head
;                    Made quiet the default - use /LOUD to override
;-
loud=keyword_set(loud)
sclass=string(goes_class)
mant=strtrim(str2number(sclass),2)
eclass=strmid(goes_class,0,1)

gcl=str2arr('A,B,C,M,X')
expcl=str2arr('8,7,6,5,4')

expon=reverse(intarr(n_elements(gcl)) + 8)
retval=mant
for c=0,n_elements(gcl)-1 do begin 
  ssc=where(eclass eq gcl(c),sscnt)
  if sscnt gt 0 then begin
     retval(ssc)=mant(ssc)+'e-0' + expcl(c) 
  endif else if loud then box_message,'No flares of class ' +gcl(c)
endfor

if keyword_set(doublex) or keyword_set(floatx) then $
  retval=double(temporary(retval))  ; historical default=string...


return, retval
end


  
