
topts.RemoveSomeBands = +1;
toptsRMV.iKCBand = [2310 2311 2320 2321 2350 2351 2352 2353 2354 2355];
toptsRMV.iISO =    [   1    2    1    2    1    2    3    1    1    4];  
toptsRMV.iL =      [   4    4    2    2    1    1    1    3    5    1];
toptsRMV.iU =      [  24   24   16   16    9    9    9   23   25    9];

toptsRMV.iKCBand = [toptsRMV.iKCBand 2253 2254 2322];
toptsRMV.iISO    = [toptsRMV.iISO       2    2    3];
toptsRMV.iL      = [toptsRMV.iL         3    5    2];
toptsRMV.iU      = [toptsRMV.iU        23   25   16];

toptsRMV.iKCBand = [toptsRMV.iKCBand 2110 2120 ];
toptsRMV.iISO    = [toptsRMV.iISO       1    1 ];
toptsRMV.iL      = [toptsRMV.iL         2    3 ];
toptsRMV.iU      = [toptsRMV.iU        15   25 ];

toptsRMV.iKCBand = [toptsRMV.iKCBand 2140 2160 2170 2180]; 
toptsRMV.iISO    = [toptsRMV.iISO       1    1    1    1]; 
toptsRMV.iL      = [toptsRMV.iL         5    6    7    8]; 
toptsRMV.iU      = [toptsRMV.iU        23   36   37   38]; 

fname = '/asl/data/hitran/h2k.by.gas/g2.dat';
[line]=hitread(2100,2500,0,2,fname);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clf;
semilogy(line.wnum,line.stren,'.');       hold on; %pause(0.1)

for mm = 1 : length(toptsRMV.iU)
  mm
  %aa = input('enter iIso,iL,iU : ');
  aa = [toptsRMV.iISO(mm) toptsRMV.iL(mm) toptsRMV.iU(mm)];
  iISO = aa(1); iL = aa(2); iU = aa(3);
  ii = find(line.iso == iISO & line.iusgq == iU & line.ilsgq == iL );
  if length(ii) > 0
    if mm <= 10
      semilogy(line.wnum(ii),line.stren(ii),'r.','MarkerSize',10)
    else
      semilogy(line.wnum(ii),line.stren(ii),'m.','MarkerSize',10)
      end
    end
  end

hold off

xlabel('Wavenumber cm-1'); ylabel('Line Strength'); 
title('orig bands (R), new bands (M), weak bands (B)')
printfig(1,'/home/sergio/PAPERS/AIRS/AIRS_STM_Sept05/FIGS/bands','jpg');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clf;
gray  = [0.70 0.70 0.70];
semilogy(line.wnum,line.stren,'.','Color',gray);       hold on; %pause(0.1)

for mm = 1 : length(toptsRMV.iU)
  mm
  %aa = input('enter iIso,iL,iU : ');
  aa = [toptsRMV.iISO(mm) toptsRMV.iL(mm) toptsRMV.iU(mm)];
  iISO = aa(1); iL = aa(2); iU = aa(3);
  ii = find(line.iso == iISO & line.iusgq == iU & line.ilsgq == iL );
  if length(ii) > 0
    if mm <= 10
      semilogy(line.wnum(ii),line.stren(ii),'k.','MarkerSize',10)
    else
      semilogy(line.wnum(ii),line.stren(ii),'k.','MarkerSize',10)
      end
    end
  end

hold off

xlabel('Wavenumber cm-1'); ylabel('Line Strength'); 
axis([2100 2500 1e-27 1e-17]);
printfig(1,'/home/sergio/PAPERS/AIRS/AIRS_STM_Sept05/FIGS/bands_gray','jpg');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


cd ~/KCARTA/SRC/NONLTE2/sergio/VT_48PROFILES/sergio_merge_April2005

xxA = [150 350]; yyA = [1e-1 1e-1];
xxB = [150 350]; yyB = [5e-3 5e-3];

vt1_0  = load('vt1_s0.sss');
vt1_40  = load('vt1_s40.sss');
vt1_60  = load('vt1_s60.sss');
vt1_80  = load('vt1_s80.sss');
vt1_85  = load('vt1_s85.sss');
vt1_90  = load('vt1_s90.sss');
vt1_120 = load('vt1_s120.sss');

hgt  = p2h(vt1_0(:,2))/1000;
pres = vt1_0(:,2);
semilogy(vt1_0(:,3),pres,vt1_0(:,8),pres,vt1_0(:,12),pres,...
         vt1_0(:,14),pres,xxA,yyA,'k',xxB,yyB,'k','LineWidth',2)
set(gca,'ydir','reverse');
legend('Kinetic','\Sigma-\Sigma','\Pi-\Pi','\Delta-\Delta',0); grid
xlabel('T(K)'); ylabel('Pressure(mb)'); title('TRP profile, sun=0');
axis([150 350 1e-5 1000]);
text(160,800,'GND'); text(160,0.2,'ECMWF'); text(160,0.004,'TOA');
printfig(1,'/home/sergio/PAPERS/AIRS/AIRS_STM_Sept05/FIGS/trp_temps','jpg');

semilogy(vt1_0(:,3),vt1_0(:,2),vt1_0(:,8),vt1_0(:,2),...
         vt1_40(:,8),vt1_40(:,2),vt1_60(:,8),vt1_60(:,2),...
         vt1_80(:,8),vt1_80(:,2),vt1_85(:,8),vt1_85(:,2),...
         vt1_90(:,8),vt1_90(:,2),xxA,yyA,'k',xxB,yyB,'k',...
         'LineWidth',2)
set(gca,'ydir','reverse');
legend('Kinetic','0','40','60','80','85','90',0)
xlabel('T(K)'); ylabel('Pressure(mb)'); title('TRP profile, sun=0 .. 120');
axis([150 350 1e-5 1000]); grid
text(160,800,'GND'); text(160,0.2,'ECMWF'); text(160,0.004,'TOA');
printfig(1,'/home/sergio/PAPERS/AIRS/AIRS_STM_Sept05/FIGS/trp_solar','jpg');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
vt1_0  = load('vt1_s0.sss');
vt2_0  = load('vt2_s0.sss');
vt3_0  = load('vt3_s0.sss');
vt4_0  = load('vt4_s0.sss');
vt5_0  = load('vt5_s0.sss');

semilogy(vt1_0(:,3),vt1_0(:,2),'b--',vt1_0(:,8),vt1_0(:,2),'b.-',...
         vt2_0(:,3),vt2_0(:,2),'g--',vt2_0(:,8),vt2_0(:,2),'g.-',...
         vt3_0(:,3),vt3_0(:,2),'r--',vt3_0(:,8),vt3_0(:,2),'r.-',...
         vt4_0(:,3),vt4_0(:,2),'c--',vt4_0(:,8),vt4_0(:,2),'c.-',...
         vt5_0(:,3),vt5_0(:,2),'m--',vt5_0(:,8),vt5_0(:,2),'m.-',...
         xxA,yyA,'k',xxB,yyB,'k',...
         'LineWidth',2)
set(gca,'ydir','reverse');
xlabel('T(K)'); ylabel('Pressure(mb)'); title('TRP MLS MLW SAS SAW profiles');
axis([150 350 1e-5 1000]); grid
text(160,800,'GND'); text(160,0.2,'ECMWF'); text(160,0.004,'TOA');
printfig(1,'/home/sergio/PAPERS/AIRS/AIRS_STM_Sept05/FIGS/profiles','jpg');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear all
cd /home/sergio/KCARTADATA/NLTE/UA
iGas = 2;
for iG = iGas:iGas 
  for iP = 1 : 6 
 
    if iP == 1 
      fname = ['trp_gasID_' num2str(iG)]; 
    elseif iP == 2 
      fname = ['mls_gasID_' num2str(iG)]; 
    elseif iP == 3 
      fname = ['mlw_gasID_' num2str(iG)]; 
    elseif iP == 4 
      fname = ['sas_gasID_' num2str(iG)]; 
    elseif iP == 5 
      fname = ['saw_gasID_' num2str(iG)]; 
    elseif iP == 6 
      fname = ['std_gasID_' num2str(iG)]; 
      end 
 
    haha = load(fname); 
    alt(:,iP)   = haha(:,2); 
    press(:,iP) = haha(:,3); 
    temp(:,iP)  = haha(:,4); 
    amt(:,iP)   = haha(:,5); 
 
    end 
  end 

xxA = [0 400]; yyA = [1e-1 1e-1];
xxB = [0 400]; yyB = [5e-3 5e-3];

semilogy(amt,press,xxA,yyA,'k',xxB,yyB,'k','LineWidth',2); 
set(gca,'ydir','reverse'); grid 
  legend('trp','mls','mlw','sas','saw','std',0);  
  title('ppmv for CO2');
axis([0 400 1e-5 1000]); grid
text(0,800,'GND'); text(0,0.2,'ECMWF'); text(0,0.004,'TOA'); 
printfig(1,'/home/sergio/PAPERS/AIRS/AIRS_STM_Sept05/FIGS/co2ppmv','jpg');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

cd ~/KCARTA/SRC/NONLTE2/sergio/VT_48PROFILES/sergio_merge_April2005
str0 = 's1s2s3s4p1p2d1d2';

for jj = 8:15
  for ii = 1 : 48
    fname = ['vt' num2str(ii) '_s0.sss'];
    blah = load(fname);
    press(ii,:) = blah(:,2);
    lte(ii,:)   = blah(:,3);
    nlte(ii,:)  = blah(:,jj);
    end

  nn = jj-7;
  nn = (nn-1)*2 + (1:2);
  str = str0(nn);
  xxA = [0 400]; yyA = [1e-1 1e-1];
  xxB = [0 400]; yyB = [5e-3 5e-3];

  semilogy(nlte',press',xxA,yyA,'k',xxB,yyB,'k','LineWidth',2)
  set(gca,'ydir','reverse');
  xlabel('T(K)'); ylabel('Pressure(mb)'); 
    title(['NLTE profiles' num2str(jj-7) '  ' str]);
  axis([150 350 1e-5 1000]); grid
  text(160,800,'GND'); text(160,0.2,'ECMWF'); text(160,0.004,'TOA');
  pause;
  end