%This is the start of the 'autoedit' collection  of programs.
% see aREADME for more details
% 
%
% asetup; run_aplotscat.m
% asetup; run_aplottopog.m
% asetup; run_alookit.m
% asetup; run_aedit.m
%

% Jules 2000/11/27

%for run_aplotscat, run_aplottopg, run_alookit, run_aedit

start_dd = 32;                 % start decimal day
end_dd   = 62;                 % beginning of last decimal day
yearbase = 2000;               % year base
comment = 'ka0002';            % comment
dbpath = '../adcpdb/';
dbname = 'a0002';              % dbname not including "???.blk"
reflayer_range = [4 12];       % should match what you did with smoothr
numbins =  58;                 % number of bins in the database
longitude_split = 0;           % split longitude here (eg. 0 if in the
                               %     Pacific, 180 if in the Atlantic   
navfile = '';                  % read a *_xy.mat file from adcpsect for 
                               % navigation - this overrides the navigation
                               % created with getmat (which is the original
                               % user buffer navigation).
                                
%for run_areflsm   

%WARNING:  because the *.bin file from smoothr is binary, it MUST have 
% been written by the same kind of machine you're running this program on 
% (PC or SUN). Otherwise, you'll just get a Nx1 vector.

navpath = '/home/moli4/datasets/kaimi/ka0002/nav/'; %default is '../nav/';
smoothrfile = 'rot000038.bin'; % smoothed velocity input file  
refabsfile  = 'rot000038.ref'; % unsmoothed velocity input file
navfile  = 'rot000038.nav'; % unsmoothed velocity input file
outfile = 'a0002';   % root for output filename 
                                

%%%%%%%%%%%%%%  end of section to be edited by user %%%%%%%%%%%%%%%
config.start_dd       =       start_dd;
config.end_dd         =       end_dd;
config.yearbase       =       yearbase;
config.comment        =       comment;
config.dbpath         =       dbpath;
config.dbname         =       dbname;
config.nbins          =       numbins;
config.rl_range       =       reflayer_range;
config.lon_branch     =       longitude_split;
config.prefix         =       'a_';

clear start_dd end_dd yearbase comment dbpath dbname reflayer_range ...
      numbins longitude_split 



%add paths

%look for a file in autoedit/ 
if (exist('alocateit.m') ~= 2)
   aeditpath
end

%look for a file in codas3/
if (exist('smoothr.m') ~= 2)
   adcppath
end

%look for a file in m_map
if (exist('m_plotbndry.m') ~= 2)
   mmappath
end

