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

%    title for figure
figtitle=['Xctd 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 xctdcastlist(1) == 0
%             there are no stations for this line
   text(.5*(xrange(1)+xrange(2)),.5*(yrange(1)+yrange(2)),'No Xctd Casts on this line')
else

  i=find(xctdcastlist == 0);
  xctdxgrid(i)=NaN;
  xctdygrid(i)=NaN;
  for cast=xctdcastlist
     text(xctdxgrid(cast),xctdygrid(cast),int2str(xctdcast(cast)));
  end
  %plot(xctdxgrid,xctdygrid,'r*')
end
text(InfoX,InfoY,InfoString)
hold off;
%    end of plotXctdCasts.m

