function trace_wavename2num, input, fixit=fixit
;
;+
;   Name: trace_wavename2num
;
;   Purpose: map from string name ('171', '195' etc) -> index/catalog.wave_num
;
;   Input Parameters:
;      input - string of form 'xxx [,yyy, zzz']
;     
;   Output:
;      function returns number equivilent (pass to trace_where, for example)
;
;   Calling Example
;      wnum=trace_wavename2num
;  
;   History:
;      10-Sep-1998 - S.L.Freeland - for TRACE WWW/IDL catalog optimization
;
;-
wavearr=            str2arr('1216,1550,1600,1700,171,195,284,TEST,WL')
wnumarr=strcompress(str2arr('  13,  21,  16,  18,  2,  6, 10,  20,15'))

retval=''

case 1 of 
   data_chk(input,/scalar,/string): begin 
      retval=strupcase(strcompress(strtrim(input,2)))
      for i=0,n_elements(wavearr)-1 do retval=str_replace(retval,wavearr(i),wnumarr(i))
   endcase
   else: begin
      box_message,'only scalar strings for now'
   endcase
endcase

if keyword_set(fixit) then retval=fix(retval)

return,retval
end
