

    %% no diary written %% 
    %% no change to display %% 

   
           % begin "matcfgstr" string, created by run_lastensq.py
           instclass = os;
           instname  = 'os75';
           pingtype  = 'nb';
           yearbase  = 2006;
           cfg =get_uhdascfg('cfgbase'  , 'kn182_15b',...
                             'cfgpath'  , '/home/data/kn182_15b/proc/os75nb/config',...
                             'instclass', instclass,...
                             'instname' , instname,...
                             'pingtype' , pingtype);
           gbindirbase = cfg.gbindirbase;
           allparams = cfg.allparams;
            

   

   % sets heading correction instrumetn to use (from config if possible)
   if ~isfield(cfg, 'hcorr_inst'),
       cfg.hcorr_inst = ''; % 'gyro', 'ashtech', 'seapath', 'posmv'
   end
   ping_headcorr = 0;  % for batch processing

   %====> quick_adcp.py overrriding:
   hcorr_inst = 'posmv';
   %====> quick_adcp.py overrriding:
   ping_headcorr = 1;


   params = get_params(allparams, instname, pingtype);

   params.showverbose = 0;
   params.pingedit = 'all';
   params.yearbase = yearbase;


   % params comes from ../config/cruiseid_proc.m
   % this matlab file is written by python: override some things here
   params.interval = 300;


   % can override single ping editing either manually ...
   % see get_pedefaults
   % ... or in an m-file
   if exist('override_editcfg.m','file')
           override_editcfg
   else
       fprintf('Using pingedit defaults (no editcfg override file: override_editcfg)\n')
   end


   % This list MUST start at the beginning if the list of all
   % possible files.  DO NOT delete any files from the raw
   % directory after processing (averaging) has begun or it will
   % throw off total ensemble count used by write_ensblk.m


   % all files:
   files = {'/home/data/kn182_15b/raw/os75/kn2006_171_50248.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_171_51595.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_171_53314.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_171_57600.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_171_64800.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_171_72000.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_171_79200.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_172_00000.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_172_07200.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_172_14400.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_172_21600.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_172_28800.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_172_36000.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_172_43200.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_172_50400.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_172_57600.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_172_64800.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_172_72000.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_172_79200.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_173_00000.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_173_07200.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_173_14400.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_173_21600.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_173_28800.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_173_36000.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_173_43200.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_173_50400.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_173_57600.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_173_64800.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_173_72000.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_173_79200.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_174_00000.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_174_07200.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_174_14400.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_174_21600.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_174_28800.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_174_36000.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_174_43200.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_174_50400.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_174_57600.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_174_64800.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_174_72000.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_174_79200.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_175_00000.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_175_07200.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_175_14400.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_175_21600.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_175_28800.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_175_36000.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_175_43200.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_175_50400.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_175_57600.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_175_64800.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_175_72000.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_175_79200.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_176_00000.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_176_07200.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_176_14400.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_176_21600.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_176_28800.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_176_36000.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_176_43200.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_176_50400.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_176_57600.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_176_64800.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_176_72000.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_176_79200.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_177_00000.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_177_07200.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_177_14400.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_177_21600.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_177_28800.raw',...
'/home/data/kn182_15b/raw/os75/kn2006_177_36000.raw'};


   % this should start with the most recent profile (from ens_blk*.log)
   % and start there. no need to fiddle with filelists.
   % It is automatically in incremental mode.

   write_ensblk(instclass, files, params,...
       'gbindir', fullfile(gbindirbase, instname),...
       'save_lastens', 1,...
       'hcorr_inst', hcorr_inst, 'ping_headcorr', ping_headcorr,...
       'pingtype', pingtype,  'max_BLKprofiles', 144,  ...
       'save_editcfg', 0,...
       'verbose', 0);

