
%% 
clf

m_proj('mercator','lon',[ -123-34/60 -123-25/60],'lat', [48+37/60 48+43/60]);
load SItopo

[c,h]=m_contourf(topo.lon,topo.lat,topo.z,[-300:25:0]);
set(h,'edgecol','none');
colormap([seajmk3(64);1 1 1])
hold on;
[c,h]=m_contour(topo.lon,topo.lat,topo.z,-250:50:-50);
set(h,'edgecol',[1 1 1]*0.5)
m_usercoast('./SViCoast.mat','color','k');

% shading flat;
m_grid;


lon = -123-[30.1 30.2 30.24 30.1 29.2]/60;
lat = 48+[38:42]/60;

m_plot(lon,lat,'d','markersi',6,'markerfacecol','k')
for i=1:length(lon)
  m_text(lon(i),lat(i),[' J' num2str(i)])
end;

if dop
  docprint('CruisePlanTopo','PlotTopo.m');
end

%% get the tide
dt=1;
for dt=[0 1];
  jmkfigure(3+dt,2,0.7)
  
  clf
  time = datenum(2010,5,14)+[-48:0.5:24*2]/24;
  h=T_XTIDE('Patricia Bay',time);
  subplot(2,1,1);
  
  patch([3+20/60 22 22 3+20/60]/24+datenum(2010,5,14),[0 0 15 15],[1 1 1]*0.75)
  hold on;
  plot(time+1/24,h)
  
  kdatetick;
  subplot(2,1,2);
  
  plot(time+1/24,h)
  xlim([3+20/60 22]/24+datenum(2010,5,14));
  kdatetick;
  xlabel('DST 14 May, 2010');
  
  t=[9 9+5/6 10.5 11+1/6 11+55/60 13+35/60]-dt;
  hold on;
  for i=1:length(t);
    plot([1 1]*t(i)/24+datenum(2010,5,14),[0 15]);
    hold on;
    plot([1 1]*t(i)/24+datenum(2010,5,14)+5.5/24,[0 15]);
  end;
  
  plot([1 1]*t(i)/24+datenum(2010,5,14)+0.5/24,[0 15],'linewi',2);
  plot([1 1]*(8-dt)/24+datenum(2010,5,14),[0 15],'linewi',2);
  if dt==1
    text([1]*7/24+datenum(2010,5,14),3,'  7 AM start');
  else
    text([1]*8/24+datenum(2010,5,14),3,'  8 AM start');
  end
  if dop
    if dt==1
      docprint('Tides7AM','PlotTopo.m');
    else
      docprint('Tides8AM','PlotTopo.m');
    end
  end;
end;

