%run_alookit
%
% This program shows the effect of the editing paramters applied by  "aflagit.m"
% using the values in aflagit_setup.m - if you want to see your data without
% the effects of the editing applied, set "flagit = 0" before running 
% this program.
% 
%
% instructions: 
%    (go to the location of asetup.m and aflagit_setup.m; edit those first)
% usage:
%  asetup; run_alookit

% Jules 2000/11/27


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

if (~exist('flagit', 'var'))
   flagit = 1;
end


% set for this application
config.ddrange        =       1;         %number of ddays to get data

%check values in aflagit_setup for your cruise.
aflagit_setup

%set up some graphing parameters for apuv.m
topo_clev = [-9000:500:0];  % Topography contour levels.
mvec_scale = 100;           %100cm/s per inch on paper

%now call the plotting driver ---

%this is a little convoluted because we need to send config.start_dd into 
%  alookit but matlab doesn't want to have the looping value be a structure
%  element


start_dd = config.start_dd;
for dd = start_dd: config.ddrange : config.end_dd
   config.start_dd = dd;

   [data, config] = agetmat(config);

   if (flagit)
      flagged = aflagit(data, config, pfc);
   else
      flagged = 0*data.umeas;
   end
   config.flagged = flagged;   %set flagit to zero to show all data
   

   figure(1)
   alookit
   figure(3)
   apuv(data, config, topo_clev, mvec_scale, pfc);  
   paused
end


