

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

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

        


        % now set up heading correction parameters
        % sets heading correction instrument to use (from config if possible)
        % (1) if there isn't one, initialize it
           if ~isfield(cfg, 'hcorr_inst'),
               cfg.hcorr_inst = ''; % 'gyro', 'ashtech', 'seapath', 'posmv'
           end
        % (2) override from quick_adcp.py if desired
           %%====> quick_adcp.py overrriding:
 hcorr_inst = 'mahrs';


        % (3)  override from quick_adcp.py if desired
        %      eg. hcorr_args = {'posmv', 'pmv', 'acc_heading_cutoff', .018};
            

        ping_headcorr = 0;  % for batch processing
        %====> quick_adcp.py overrriding:
 ping_headcorr = 1;
        %====> quick_adcp.py overrriding:
 num_persistence = 24;


        params = get_params(allparams, instname, pingtype);

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


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

        %%====> quick_adcp.py overrriding:
 params.bottom = 'xy2z';

        % 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/RB0806TESTtoRODMAN/raw/os75/rb2008_279_61055.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_279_64800.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_279_72000.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_279_79200.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_280_00000.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_280_07200.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_280_14400.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_280_21600.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_280_28800.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_280_36000.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_280_43200.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_280_50400.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_280_57600.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_280_64800.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_280_72000.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_280_79200.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_281_00000.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_281_07200.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_281_14400.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_281_21600.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_281_28800.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_281_36000.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_281_43200.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_281_50400.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_281_57600.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_281_64800.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_281_72000.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_281_79200.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_282_00000.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_282_07200.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_282_14400.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_282_21600.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_282_28800.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_282_36000.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_282_43200.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_282_50400.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_282_57600.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_282_64800.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_282_72000.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_282_79200.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_283_00000.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_283_07200.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_283_14400.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_283_21600.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_283_28800.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_283_36000.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_283_43200.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_283_50400.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_283_57600.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_283_64800.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_283_72000.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_283_79200.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_284_00000.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_284_07200.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_284_14400.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_284_21600.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_284_28800.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_284_36000.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_284_43200.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_284_50400.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_284_57600.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_284_64800.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_284_72000.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_284_79200.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_285_00000.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_285_07200.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_285_14400.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_285_21600.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_285_28800.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_285_36000.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_285_43200.raw',...
'/home/data/RB0806TESTtoRODMAN/raw/os75/rb2008_285_50400.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_args', cfg.hcorr_args, ...
            'gyro_msginfo', cfg.best.heading_rule,...
            'ping_headcorr', ping_headcorr, ...
            'num_persistence', num_persistence, ...
            'pingtype', pingtype,  'max_BLKprofiles', 144,  ...
            'save_editcfg', 0,...
            'verbose', 0);

        which table1

     