pro get_19,x_19
;+
;  Procedure to load the wavelength calibration of CaXIX bins into
;  IDL variable.  To extend the CMB calibration table to cover all bins
;  it does a linear fit to the wavelengths and extrapolates out to cover
;  128 bins. Should only be used for qualitative work eg realistic looking
;  plots.
;  
;  Output:
;             x_19    - array of approximate CaXIX wavelengths
; Use:
;      IDL> get_19,x_19
;
;
;	CDP  Feb 92
;       RDB  13-Mar-93  Changed $DIR_BCS_CALDAT to $DIR_BCS_CAL
;-

;
;  get CMB bin/wavelength calibration
;
openr,1,concat_dir('$DIR_BCS_CAL','cal19_wl.dat')
x1 = fltarr(205)
l1 = fltarr(205)
for i=0,204 do begin
   readf,1,a,b,c,d,e,f,g
   x1(i) = a
   l1(i) = e
endfor
close,1

;
;  fit line to real data cos want wavelength for all bins
;
coeff = poly_fit(x1,l1,1,yfit)

x_19 = fltarr(128)

for i=0,255,2 do begin
  x_19(i/2) = coeff(0) + coeff(1)*i
endfor

end
