%aplottopog.m
%a tool to plot cruisetrack over topography

% Jules 2000/11/27

%--------------------  topography --------------------
set(0, 'defaulttextinterpreter', 'tex')

clf
%set up the colors
topo_cmap = mk_cmap(length(topo_clev), 'topo');
topo_irange =  [1 length(topo_cmap(:,1))]; % indices into topo_cmap
colormap([topo_cmap])

lonrange = max(data.lon) - min(data.lon);
latrange = max(data.lat) - min(data.lat);

llpad = max(latrange*.1, lonrange*.1);

lonlims = [min(data.lon) max(data.lon)] + [-llpad llpad];
latlims = [min(data.lat) max(data.lat)] + [-llpad llpad];
  %make sure it doesn't go over /- 90
  latlims(1) = max(-90, latlims(1));
  latlims(2) = min( 90, latlims(2));
m_proj('lambert', 'long' ,lonlims, 'lat', latlims);
m_elev('contourf',topo_clev);
m_grid('box','fancy','tickdir','in');
m_coast;
navtimes = NaN*data.lon;
m_track(data.lon, data.lat, navtimes, 'color', 'g', 'linewidth', 2);


h_dcb = dcolbar( topo_clev/1000, 'vert', 'Depth (km)');
h_dcbp = findobj(h_dcb,'Type','patch');
cf_index(h_dcbp, topo_clev/1000, topo_irange);

date_it


startdate = to_date(config.yearbase,min(data.dday));
enddate = to_date(config.yearbase,max(data.dday));

datestr = sprintf('%s to %s', startdate(6:10), enddate(6:10))

subtitle_comment = sprintf('%s (%s)', config.comment, datestr);
subtitle(subtitle_comment)
