%% almost same as read_background except it does one chunk at a time.
iT = 6;
iT = 11;

iaTemp = -50:10:50; 
iaFr = 2205 : 25 : 2505; 

%%%%now read in the data
frall = [];
kall = [];

%for iF = 1 : length(iaFr)
for iF = 1 : 10
  f1 = iaFr(iF);
  for iT = 1 : 11
    iname = ['/carrot/s1/sergio/AIRSCO2/BACKGND_MAY2004/refgas2_' num2str(iT)];
    iname = [iname '_' num2str(f1) '.mat'];
    loader = ['load ' iname]
    eval(loader);
    kall(iT,:,:) = k;
    end

  iaLay = 1;      iFr = 1:10:10000;   %ilay = 1  ==> 1200 mb = 0 km
  iaLay = [1 80]; iFr = 1:10:10000;   %ilay = 80 ==> 12 mb   = 30 km 

  figure(1); plot(fr,squeeze(exp(-kall(6,iaLay(1),:))),...
                  fr,squeeze(exp(-kall(6,iaLay(2),:))))
  figure(2); 
    subplot(211)
      data1 = squeeze(kall(:,iaLay(1),iFr)); plot(data1,'.-');
    subplot(212)
      data2 = squeeze(kall(:,iaLay(2),iFr)); plot(data2,'.-');
  pause
  end
