

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

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

        


        % heading correction instrument comes from config/cruise_cfg.m
        % NEW: override with hcorr_args, not hcorr_inst
        % (1) if there isn't one bomb out.
           if ~isfield(cfg, 'hcorr_args'),
               error('load_uhblk_tmp.m: no heading correction setting: check config/cruise_cfg.m -- version mismatch??')
           end

        % (3)  override from quick_adcp.py if desired
        %      eg. hcorr_args = {'posmv', 'pmv', 'acc_heading_cutoff', .018};
           cfg.hcorr_inst = 'ashtech';              % this should be obsolete, but here for constistency
        % this is what is used. see get_rbinheading.m :
           %%====> quick_adcp.py overrriding:
 cfg.hcorr_args = {'ashtech', 'adu'};

        % matlab does not know about post_headcorr at this point; only
        % "ping_headcorr = 0" or "ping_headcorr = 1"
        % matlab initializing ping_headcorr = 0
        ping_headcorr = 0;

        % quick_adcp.py overrides follow:
        %====> 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/oc469_01/raw/os75/oc2010_273_66108.raw',...
'/home/data/oc469_01/raw/os75/oc2010_273_72000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_273_79200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_274_00000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_274_07200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_274_14400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_274_21600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_274_28800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_274_36000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_274_43200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_274_50400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_274_57600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_274_64800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_274_72000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_274_79200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_275_00000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_275_07200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_275_14400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_275_21600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_275_28800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_275_36000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_275_43200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_275_50400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_275_57600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_275_60964.raw',...
'/home/data/oc469_01/raw/os75/oc2010_275_61039.raw',...
'/home/data/oc469_01/raw/os75/oc2010_275_64800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_275_72000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_275_79200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_276_00000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_276_07200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_276_14400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_276_21600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_276_28800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_276_36000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_276_43200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_276_50400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_276_57600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_276_64800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_276_72000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_276_79200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_277_00000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_277_07200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_277_14400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_277_21600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_277_28800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_277_36000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_277_43200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_277_50400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_277_57600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_277_64800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_277_72000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_277_79200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_278_00000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_278_07200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_278_14400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_278_21600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_278_28800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_278_36000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_278_43200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_278_50400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_278_57600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_278_64800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_278_72000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_278_79200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_279_00000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_279_07200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_279_14400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_279_21600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_279_28800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_279_36000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_279_43200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_279_50400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_279_57600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_279_61313.raw',...
'/home/data/oc469_01/raw/os75/oc2010_279_64800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_279_72000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_279_79200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_280_00000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_280_07200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_280_14400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_280_21600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_280_28800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_280_36000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_280_43200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_280_50400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_280_57600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_280_64800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_280_72000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_280_79200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_281_00000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_281_07200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_281_14400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_281_21600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_281_28800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_281_36000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_281_43200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_281_50400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_281_57600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_281_64800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_281_72000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_281_79200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_282_00000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_282_07200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_282_14400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_282_21600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_282_28800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_282_36000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_282_43200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_282_50400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_282_57600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_282_64800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_282_72000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_282_79200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_283_00000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_283_07200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_283_14400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_283_21600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_283_28800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_283_36000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_283_43200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_283_50400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_283_57600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_283_64800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_283_72000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_283_79200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_284_00000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_284_07200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_284_14400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_284_21600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_284_28800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_284_36000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_284_43200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_284_50400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_284_57600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_284_64800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_284_72000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_284_79200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_285_00000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_285_07200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_285_14400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_285_21600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_285_28800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_285_36000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_285_43200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_285_50400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_285_57600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_285_64800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_285_72000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_285_79200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_286_00000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_286_07200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_286_14400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_286_21600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_286_28800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_286_36000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_286_43200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_286_50400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_286_57600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_286_64800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_286_72000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_286_79200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_287_00000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_287_07200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_287_14400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_287_21600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_287_28800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_287_36000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_287_43200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_287_50400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_287_57600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_287_64800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_287_72000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_287_79200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_288_00000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_288_07200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_288_14400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_288_21600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_288_28800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_288_36000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_288_43200.raw',...
'/home/data/oc469_01/raw/os75/oc2010_288_50400.raw',...
'/home/data/oc469_01/raw/os75/oc2010_288_57600.raw',...
'/home/data/oc469_01/raw/os75/oc2010_288_64800.raw',...
'/home/data/oc469_01/raw/os75/oc2010_288_72000.raw',...
'/home/data/oc469_01/raw/os75/oc2010_288_79200.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,   'maxrunsecs', 300,...
            'save_editcfg', 0,...
            'verbose', 0);


     