% routine for plotting drifters
%

function sumplt(wop,wy);

% function sumplt(wy,wop);

%   wop=menu('Which option?','trajectories','temperature series','u&v series');

%   wy=menu('Which year?','95','96','97','98','realtime');


if nargin==0;
  wop=menu('Which option?','trajectories','temperature series','u&v series');

end;   


if nargin<2;
  wy=menu('Which year?','95','96','97','98','realtime');
  disp(['Hardcoded to ',num2str(94+wy)]);

%  yr=['95';'96';'97';'98';'99'];
end;

yr=94+wy;


if wy==1;
  disp('Hardcoded to trajectory option');
  sumplt95;
elseif wy==2;
  disp('Hardcoded to trajectory option');
  load /data5/jmanning/drift/uscg96/all1m4

% loop for multiple drifters
  hm=input('How many? ');
  for mm=1:hm;
    disp(' ');
    fn=input('input drifter # (w/out direc or extension): ','s');

%   need to make a matrix "yy" with time, lat, lon
    eval(['yy=[yrday',fn,'o lat',fn,'o lon',fn,'o];']);

% define the line color
    mc=mm;

% plot only a certian time period
    id=find(yy(:,1)>153.67&yy(:,1)<155.2);
    pltdrft(yy(id,2),yy(id,3),mc,0,96,yy(id,1));
  end;
elseif wy>=3;

% loop for multiple drifters
  hm=input('How many? ');
  for mm=1:hm;
    disp(' ');
    readdjgf;

    mc=mm+4;
%    if mc==8;mc=2;end;
%    mc=1;
%   if mm==1|mm==8;mc=2;end;
 
 
    if wop==1;
      georbat;
%      pltdrft(yy(:,3),yy(:,2),mc,86400,97,yy(:,1));
      pltdrft(yy(:,3),yy(:,2),mc,-86400,yr,yy(:,1));
      hold on;
      gbox=bound(2,yy(:,2),yy(:,3));
      axis(gbox)
      lllabel;
%     plot deployment location
      plot(yy(1,2),yy(1,3),'.','color','g','markersize',20)
    elseif wop==2;
      idz=find(yy(:,4)~=0.0);
      plot(yy(idz,1),yy(idz,4),'color',['c',num2str(mc)],'linewidth',mm);
      hold on;
      tpod=input('Enter tpod filename if one exist for this drifter (else 99):','s');
      if length(tpod)~=2;
        eval(['load /data5/jmanning/minilog/',tpod]);
        plot(yd,temp,'--','color',['c',num2str(mc)],'linewidth',mm);
      end;
    elseif wop==3;
      [u,v,spd,jdn]=ll2uv(yy(:,1),yy(:,3),yy(:,2),12);
      uorv=menu('What?','u','v');
      if uorv==1;plot(jdn,u/100,['c',num2str(mc)],'linewidth',2);
         else;plot(jdn,v/100,['c',num2str(mc)],'linewidth',2);end;
    end;
    hold on;
  end;

end;
