%  plotCtdCasts.m - plots ctd cast number at station location 
%                   on map with bathymetry.
%    needs variables set:  GEOMINFO CRUISEINFO DEFAULTS 
%                          CruiseName PlotCoast PlotBathy xrange yrange
%                          ctdcastlist InfoX InfoY InfoString
%    sets variables: none
%    calls: none
%
global GEOMINFO CRUISEINFO DEFAULTS

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

   i=find(ctdcastlist == 0);
   ctdxgrid(i)=NaN;
   ctdygrid(i)=NaN;
   for cast=ctdcastlist
      text(ctdxgrid(cast),ctdygrid(cast),int2str(ctdcast(cast)));
   end
   
   %plot(ctdxgrid,ctdygrid,'r*')
end

text(InfoX,InfoY,InfoString)
hold off;

%    end of plotCtdCasts.m

