function gb_plotE
% plots drifter tracks and wind 
% stress for event E.
% 4/2/01

% drifters used in event E
driftE=sort([90,88,89,87,82,85,91,95,96,94,92,70,81,93,79]);

clear
clf

% set start, stop times
tstart=[86 90 94 ];
tstop=tstart+4;

% set map domain
V=[-70 -65.5 39.75 42.5];

% start outer loop
for plnum=1:3
   subplot(2,2,plnum)
   axis(V)
   gbmapss2(V)
   hold on
   gb_plot97E(tstart(plnum),tstop(plnum));
   aspect5(41);
   hold on
end

function gb_plot97E(tstart,tstop)
% gb_plot97(tstart,tstop) plots tracks of all drifters 
% on bank during the time between tstart and tstop
% 3/25/01; 4/1/01

% convert to 1995 drifter days
tstart=yd2dd(tstart,1997);
tstop=yd2dd(tstop,1997);

%load data
load gb10mallA
load windstress97
t=z(:,1);

% set start, stop times
dt=4;
t1=[tstart:dt:tstop-dt];
t2=t1+dt;
N=length(t1);

% set map domain
V=[-70 -65.5 39.75 42.5];

% start loop
for n=1:N
   gbmapss2(V);
   aspect5(41);
   hold on
   % extract all drifter data for time window
   k=find(t>=t1(n) & t<=t2(n));
   zn=z(k,:);
   % find all drifters inside map domain
   k=find_inside(zn,V);
   znew=reconfig1(zn(k,:));
   
   % specify which drifters NOT to plot
   RD=1;
   if RD==1;
      DP=[72,76,86,74,84];
      nDP=length(DP);
      for ndp=1:nDP
         nnn=find(znew(:,8)==DP(ndp));
         znew(nnn,:)=[];
      end
   end
   
   % plot all drifters
   kk=find(isnan(znew(:,1)));
   h=plot(znew(:,2),znew(:,3));set(h,'linewidth',2);
   hold on
   plot(znew(kk-1,2),znew(kk-1,3),'r*')
   % text(znew(kk-1,2),znew(kk-1,3)+.1,int2str(znew(kk-1,8)))
   pdate=[dd2cd1(t1(n)),' - ',dd2cd1(t2(n))];
   title(pdate);
   axis(V)
   hold on
   
   % plot mean wind stress
   err=0.01;
   K=find(dd2yd(t1(n))-err<=t97 & t97<=dd2yd(t2(n))+err);
   txm=mean(tx97(K));
   tym=mean(ty97(K));
   xst1=-66.75;yst1=41.75;
   KK=2;
   KXY=.755;
   yst2=yst1+KK.*tym;
   xst2=xst1+KK.*txm./KXY;
   h=plot([xst1 xst2],[yst1 yst2],'k',xst2,yst2,'k*');set(h,'linewidth',2);
   hold on
    
   % plot wind stress scale
   xst1=-66.5;yst1=40.2;
   KK=2;
   KXY=.755;
   yst2=yst1;
   xst2=xst1+KK.*.2./KXY;
   h=plot([xst1 xst2],[yst1 yst2],'g',xst1,yst1,'g.',xst2,yst2,'g*');set(h,'linewidth',2);
   hold on
end
