disp('med_tau_plt_AMMA');
%taucx=ytaucx;taucy=ytaucy;taub=ytaub;


kk=find(abs(taucx-tauib)>.03+.01*v1);
taucx(kk)=NaN;taucy(kk)=NaN;
clear taucxmm taucymm taubm tauibm dum nm tauibmm tauibmx
uu(1:13)=0:12;
uu(14:17)=14:2:20;
for i=1:16
   ii=find(v1>=uu(i) & v1<uu(i+1));
   jj=find(isfinite(taucx(ii)) &  isfinite(taucy(ii)) & isfinite(taub(ii)) & (reldir(ii)>270 | reldir(ii)<90));%& isfinite(taucy(ii))
   if isempty(jj)
      taucxmm(i)=NaN;
      taucymm(i)=NaN;
      tauibmm(i)=NaN;
      taubmm(i)=NaN;
      taucxmx(i)=NaN;
      taucymx(i)=NaN;
      tauibmx(i)=NaN;
      taubmx(i)=NaN;
      wu(i)=NaN;
      wv(i)=NaN;
      nm(i)=0;
      dum(i)=NaN;
   else
      taucxmm(i)=nanmedian(taucx(ii(jj)));
      taucymm(i)=nanmedian(taucy(ii(jj)));
      tauibmm(i)=nanmedian(tauib(ii(jj)));
   	taubmm(i)=nanmedian(taub(ii(jj)));
    wu(i)=nanmedian(y1(ii(jj),117));
    wv(i)=nanmedian(y1(ii(jj),119));
    
   	nm(i)=length(jj);
      dum(i)=nanmedian(v1(ii(jj)));%
      taucxmx(i)=nanmean(taucx(ii(jj)));
      taucymx(i)=nanmean(taucy(ii(jj)));
      tauibmm(i)=nanmedian(tauib(ii(jj)));
   	taubmx(i)=nanmean(taub(ii(jj)));

   end;
end;
ii=find(nm>2);
figure;plot(dum,taubmm,dum(ii),taucxmm(ii),dum,taubmx,'x',dum(ii),taucxmx(ii),'-x',dum(ii),tauibmm(ii),'d',[0 18],[0 0]);xlabel('U (m/s)');ylabel('Taux (N/m^2)');title([jdollars  '  x-mean  diamond- median ID']);axis([0 18 -.025 .7]);
figure;plot(taubmm(ii),taucxmm(ii),'o',taubmx(ii),taucxmx(ii),'x',taubmm(ii),tauibmm(ii),'d',[-.10 1],[-.10 1]);axis([-.025 .7 -.025 .7]);xlabel('Bulk Streamwise Stress (N/m^2)');ylabel('Turb Streamwise Stress (N/m^2)');title([jdollars  '  x-mean  o-median  diamond-ID'  ]);

figure;plot(dum(ii),-.004-tauibmm(ii)/10,dum(ii),taucymm(ii),'-o',dum(ii),taucymx(ii),'-x',[0 16],[0 0]);xlabel('U (m/s)');ylabel('Tau xstream (N/m^2)');title([jdollars  '  o-median  x-mean  -0.004-\tau/10  ']);axis([0 18 -.08 .08]);
figure;plot(dum(ii),-wu(ii),'kd',dum(ii),-wv(ii),'rd',[0 16],[0 0]);xlabel('U (m/s)');ylabel('-<wu> (black) and -<wv> (red) median components');axis([0 12 -.1 .3]);
