%run_aplottopog.m
% 
% This program plots topography under the cruise track
%
% instructions: 
%    (go to the location of asetup.m and aflagit_setup.m; edit those first)
% usage:
%  asetup; run_aplottopog



% Jules 2000/11/27


if (~isfield(config, 'prefix'))
   config.prefix = 'a_';
end

%run asetup.m; use those parameters; set more:

% now override some
config.rl_range = [1 2];                     % just to fake it out
config.nbins = 2;                            % keep it small but more than 1

%and set this one                   
config.ddrange  =  config.end_dd - config.start_dd + 1; %get all the data


%======================================================================

%and set some other parameters
topo_clev = [-9000:500:0];  % Topography contour levels.
savetodisk = 1;

%get the data

[data, config] = agetmat(config);

%try to filter positions a bit
badi = find(data.clmps > 10);  %that's 10m/s!!
if (~isempty(badi))
   warning('found potential bad navigation at:')
   fprintf('    dday                   lat                   lon\n')
   fprintf('%11.7f       %14.7fN     %14.7fE\n',...
                [data.dday(badi)', data.lat(badi)', data.lon(badi)'])
                data.lon(badi) = [];
                data.lat(badi) = [];
                data.dday(badi) = [];
end




% (2)  cruisetrack over topography
aplottopog  

orient landscape
print -dpsc aplottopog

