%  plotXbtCasts.m -  plots xbt cast number at station location 
%                    on map with bathymetry
%    needs variables set:  GEOMINFO CRUISEINFO DEFAULTS 
%                         CruiseName xrange yrange 
%                         xbtcastlist InfoX InfoY InfoString
%    sets variables: none
%    calls: none
%
global GEOMINFO CRUISEINFO DEFAULTS

%    title for figure
figtitle=['Xbt Cast locations for ' CruiseName];

%        open an new graphics window.
figure;
if(PlotCoast) 
   plot(xcoast,ycoast);
end
hold on;
if(PlotBathy) 
   [C,h]=contour(xdep,ydep,zdep,botcl);
   %clabel(C,h);
end
axis([xrange yrange]);
title(figtitle);
xlabel('distance (km)');
ylabel('distance (km)');

if xbtcastlist(1) == 0
%             there are no stations for this line
   text(.5*(xrange(1)+xrange(2)),.5*(yrange(1)+yrange(2)),'No Xbt Casts on this line')
else

  i=find(xbtcastlist == 0);
  xbtxgrid(i)=NaN;
  xbtygrid(i)=NaN;
  for cast=1:xbtcastlist
%     text(xbtxgrid(cast),xbtygrid(cast),int2str(xbtcast(cast)));
     plot(xbtxgrid(cast),xbtygrid(cast),'r*');
  end
end
text(InfoX,InfoY,InfoString)

hold off;

%    end of plotXbtCasts.m

