

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

        
            % begin "matcfgstr" string, created by run_lastensq.py
            instclass = wh;
            instname  = 'wh300';
            pingtype  = 'bb';
            proc_yearbase  = 2009;
            yearbase  = 2009;
            cfg =get_uhdascfg('cfgbase'  , 'km0909',...
                              'cfgpath'  , '/home/data/km0909/proc/wh300/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 = 'posmv';              % this should be obsolete, but here for constistency
        % this is what is used. see get_rbinheading.m :
           %%====> quick_adcp.py overrriding:
 cfg.hcorr_args = {'posmv', 'pmv', 'acc_heading_cutoff', 0.018};

        % 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 = 120;

        %%====> 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/km0909/raw/wh300/km2009_078_13426.raw',...
'/home/data/km0909/raw/wh300/km2009_078_14400.raw',...
'/home/data/km0909/raw/wh300/km2009_078_21600.raw',...
'/home/data/km0909/raw/wh300/km2009_078_28800.raw',...
'/home/data/km0909/raw/wh300/km2009_078_36000.raw',...
'/home/data/km0909/raw/wh300/km2009_078_43200.raw',...
'/home/data/km0909/raw/wh300/km2009_078_50400.raw',...
'/home/data/km0909/raw/wh300/km2009_078_57600.raw',...
'/home/data/km0909/raw/wh300/km2009_078_64800.raw',...
'/home/data/km0909/raw/wh300/km2009_078_72000.raw',...
'/home/data/km0909/raw/wh300/km2009_078_79200.raw',...
'/home/data/km0909/raw/wh300/km2009_079_00000.raw',...
'/home/data/km0909/raw/wh300/km2009_079_07200.raw',...
'/home/data/km0909/raw/wh300/km2009_079_14400.raw',...
'/home/data/km0909/raw/wh300/km2009_079_21600.raw',...
'/home/data/km0909/raw/wh300/km2009_079_28800.raw',...
'/home/data/km0909/raw/wh300/km2009_079_36000.raw',...
'/home/data/km0909/raw/wh300/km2009_079_43200.raw',...
'/home/data/km0909/raw/wh300/km2009_079_50400.raw',...
'/home/data/km0909/raw/wh300/km2009_079_57600.raw',...
'/home/data/km0909/raw/wh300/km2009_079_64800.raw',...
'/home/data/km0909/raw/wh300/km2009_079_72000.raw',...
'/home/data/km0909/raw/wh300/km2009_079_79200.raw',...
'/home/data/km0909/raw/wh300/km2009_080_00000.raw',...
'/home/data/km0909/raw/wh300/km2009_080_13174.raw',...
'/home/data/km0909/raw/wh300/km2009_080_14400.raw',...
'/home/data/km0909/raw/wh300/km2009_080_21600.raw',...
'/home/data/km0909/raw/wh300/km2009_080_28800.raw',...
'/home/data/km0909/raw/wh300/km2009_080_36000.raw',...
'/home/data/km0909/raw/wh300/km2009_080_43200.raw',...
'/home/data/km0909/raw/wh300/km2009_080_50400.raw',...
'/home/data/km0909/raw/wh300/km2009_080_57600.raw',...
'/home/data/km0909/raw/wh300/km2009_080_64800.raw',...
'/home/data/km0909/raw/wh300/km2009_080_72000.raw',...
'/home/data/km0909/raw/wh300/km2009_080_79200.raw',...
'/home/data/km0909/raw/wh300/km2009_081_00000.raw',...
'/home/data/km0909/raw/wh300/km2009_081_07200.raw',...
'/home/data/km0909/raw/wh300/km2009_081_14400.raw',...
'/home/data/km0909/raw/wh300/km2009_081_21600.raw',...
'/home/data/km0909/raw/wh300/km2009_081_28800.raw',...
'/home/data/km0909/raw/wh300/km2009_081_36000.raw',...
'/home/data/km0909/raw/wh300/km2009_081_43200.raw',...
'/home/data/km0909/raw/wh300/km2009_081_50400.raw',...
'/home/data/km0909/raw/wh300/km2009_081_57600.raw',...
'/home/data/km0909/raw/wh300/km2009_081_64800.raw',...
'/home/data/km0909/raw/wh300/km2009_081_72000.raw',...
'/home/data/km0909/raw/wh300/km2009_081_79200.raw',...
'/home/data/km0909/raw/wh300/km2009_082_00000.raw',...
'/home/data/km0909/raw/wh300/km2009_082_07200.raw',...
'/home/data/km0909/raw/wh300/km2009_082_14400.raw',...
'/home/data/km0909/raw/wh300/km2009_082_21600.raw',...
'/home/data/km0909/raw/wh300/km2009_082_28800.raw',...
'/home/data/km0909/raw/wh300/km2009_082_36000.raw',...
'/home/data/km0909/raw/wh300/km2009_082_43200.raw',...
'/home/data/km0909/raw/wh300/km2009_082_50400.raw',...
'/home/data/km0909/raw/wh300/km2009_082_57600.raw',...
'/home/data/km0909/raw/wh300/km2009_082_64800.raw',...
'/home/data/km0909/raw/wh300/km2009_082_72000.raw',...
'/home/data/km0909/raw/wh300/km2009_082_79200.raw',...
'/home/data/km0909/raw/wh300/km2009_083_00000.raw',...
'/home/data/km0909/raw/wh300/km2009_083_07200.raw',...
'/home/data/km0909/raw/wh300/km2009_083_14400.raw',...
'/home/data/km0909/raw/wh300/km2009_083_21600.raw',...
'/home/data/km0909/raw/wh300/km2009_083_28800.raw',...
'/home/data/km0909/raw/wh300/km2009_083_36000.raw',...
'/home/data/km0909/raw/wh300/km2009_083_43200.raw',...
'/home/data/km0909/raw/wh300/km2009_083_50400.raw',...
'/home/data/km0909/raw/wh300/km2009_083_57600.raw',...
'/home/data/km0909/raw/wh300/km2009_083_64800.raw',...
'/home/data/km0909/raw/wh300/km2009_083_72000.raw',...
'/home/data/km0909/raw/wh300/km2009_083_79200.raw',...
'/home/data/km0909/raw/wh300/km2009_084_00000.raw',...
'/home/data/km0909/raw/wh300/km2009_084_07200.raw',...
'/home/data/km0909/raw/wh300/km2009_084_14400.raw',...
'/home/data/km0909/raw/wh300/km2009_084_21600.raw',...
'/home/data/km0909/raw/wh300/km2009_084_28800.raw',...
'/home/data/km0909/raw/wh300/km2009_084_36000.raw',...
'/home/data/km0909/raw/wh300/km2009_084_43200.raw',...
'/home/data/km0909/raw/wh300/km2009_084_50400.raw',...
'/home/data/km0909/raw/wh300/km2009_084_57600.raw',...
'/home/data/km0909/raw/wh300/km2009_084_64800.raw',...
'/home/data/km0909/raw/wh300/km2009_084_72000.raw',...
'/home/data/km0909/raw/wh300/km2009_084_79200.raw',...
'/home/data/km0909/raw/wh300/km2009_085_00000.raw',...
'/home/data/km0909/raw/wh300/km2009_085_07200.raw',...
'/home/data/km0909/raw/wh300/km2009_085_14400.raw',...
'/home/data/km0909/raw/wh300/km2009_085_21600.raw',...
'/home/data/km0909/raw/wh300/km2009_085_28800.raw',...
'/home/data/km0909/raw/wh300/km2009_085_36000.raw',...
'/home/data/km0909/raw/wh300/km2009_085_43200.raw',...
'/home/data/km0909/raw/wh300/km2009_085_50400.raw',...
'/home/data/km0909/raw/wh300/km2009_085_57600.raw',...
'/home/data/km0909/raw/wh300/km2009_085_64800.raw',...
'/home/data/km0909/raw/wh300/km2009_085_72000.raw',...
'/home/data/km0909/raw/wh300/km2009_085_79200.raw',...
'/home/data/km0909/raw/wh300/km2009_086_00000.raw',...
'/home/data/km0909/raw/wh300/km2009_086_07200.raw',...
'/home/data/km0909/raw/wh300/km2009_086_14400.raw',...
'/home/data/km0909/raw/wh300/km2009_086_21600.raw',...
'/home/data/km0909/raw/wh300/km2009_086_28800.raw',...
'/home/data/km0909/raw/wh300/km2009_086_36000.raw',...
'/home/data/km0909/raw/wh300/km2009_086_43200.raw',...
'/home/data/km0909/raw/wh300/km2009_086_50400.raw',...
'/home/data/km0909/raw/wh300/km2009_086_57600.raw',...
'/home/data/km0909/raw/wh300/km2009_086_64800.raw',...
'/home/data/km0909/raw/wh300/km2009_086_72000.raw',...
'/home/data/km0909/raw/wh300/km2009_086_79200.raw',...
'/home/data/km0909/raw/wh300/km2009_087_00000.raw',...
'/home/data/km0909/raw/wh300/km2009_087_07200.raw',...
'/home/data/km0909/raw/wh300/km2009_087_14400.raw',...
'/home/data/km0909/raw/wh300/km2009_087_21600.raw',...
'/home/data/km0909/raw/wh300/km2009_087_28800.raw',...
'/home/data/km0909/raw/wh300/km2009_087_36000.raw',...
'/home/data/km0909/raw/wh300/km2009_087_43200.raw',...
'/home/data/km0909/raw/wh300/km2009_087_53777.raw',...
'/home/data/km0909/raw/wh300/km2009_087_57600.raw',...
'/home/data/km0909/raw/wh300/km2009_087_64800.raw',...
'/home/data/km0909/raw/wh300/km2009_087_72000.raw',...
'/home/data/km0909/raw/wh300/km2009_087_79200.raw',...
'/home/data/km0909/raw/wh300/km2009_088_00000.raw',...
'/home/data/km0909/raw/wh300/km2009_088_07200.raw',...
'/home/data/km0909/raw/wh300/km2009_088_14400.raw',...
'/home/data/km0909/raw/wh300/km2009_088_21600.raw',...
'/home/data/km0909/raw/wh300/km2009_088_28800.raw',...
'/home/data/km0909/raw/wh300/km2009_088_36000.raw',...
'/home/data/km0909/raw/wh300/km2009_088_43200.raw',...
'/home/data/km0909/raw/wh300/km2009_088_50400.raw',...
'/home/data/km0909/raw/wh300/km2009_088_57600.raw',...
'/home/data/km0909/raw/wh300/km2009_088_64800.raw',...
'/home/data/km0909/raw/wh300/km2009_088_72000.raw',...
'/home/data/km0909/raw/wh300/km2009_088_79200.raw',...
'/home/data/km0909/raw/wh300/km2009_089_00000.raw',...
'/home/data/km0909/raw/wh300/km2009_089_07200.raw',...
'/home/data/km0909/raw/wh300/km2009_089_14400.raw',...
'/home/data/km0909/raw/wh300/km2009_089_21600.raw',...
'/home/data/km0909/raw/wh300/km2009_089_28800.raw',...
'/home/data/km0909/raw/wh300/km2009_089_36000.raw',...
'/home/data/km0909/raw/wh300/km2009_089_43200.raw',...
'/home/data/km0909/raw/wh300/km2009_089_50400.raw',...
'/home/data/km0909/raw/wh300/km2009_089_57600.raw',...
'/home/data/km0909/raw/wh300/km2009_089_64800.raw',...
'/home/data/km0909/raw/wh300/km2009_089_72000.raw',...
'/home/data/km0909/raw/wh300/km2009_089_79200.raw',...
'/home/data/km0909/raw/wh300/km2009_090_00000.raw',...
'/home/data/km0909/raw/wh300/km2009_090_07200.raw',...
'/home/data/km0909/raw/wh300/km2009_090_14400.raw',...
'/home/data/km0909/raw/wh300/km2009_090_21600.raw',...
'/home/data/km0909/raw/wh300/km2009_090_28800.raw',...
'/home/data/km0909/raw/wh300/km2009_090_36000.raw',...
'/home/data/km0909/raw/wh300/km2009_090_43200.raw',...
'/home/data/km0909/raw/wh300/km2009_090_50400.raw',...
'/home/data/km0909/raw/wh300/km2009_090_57600.raw',...
'/home/data/km0909/raw/wh300/km2009_090_64800.raw',...
'/home/data/km0909/raw/wh300/km2009_090_72000.raw',...
'/home/data/km0909/raw/wh300/km2009_090_79200.raw',...
'/home/data/km0909/raw/wh300/km2009_091_00000.raw',...
'/home/data/km0909/raw/wh300/km2009_091_07200.raw',...
'/home/data/km0909/raw/wh300/km2009_091_14400.raw',...
'/home/data/km0909/raw/wh300/km2009_091_21600.raw',...
'/home/data/km0909/raw/wh300/km2009_091_28800.raw',...
'/home/data/km0909/raw/wh300/km2009_091_36000.raw',...
'/home/data/km0909/raw/wh300/km2009_091_43200.raw',...
'/home/data/km0909/raw/wh300/km2009_091_50400.raw',...
'/home/data/km0909/raw/wh300/km2009_091_57600.raw',...
'/home/data/km0909/raw/wh300/km2009_091_64800.raw',...
'/home/data/km0909/raw/wh300/km2009_091_72000.raw',...
'/home/data/km0909/raw/wh300/km2009_091_79200.raw',...
'/home/data/km0909/raw/wh300/km2009_092_00000.raw',...
'/home/data/km0909/raw/wh300/km2009_092_07200.raw',...
'/home/data/km0909/raw/wh300/km2009_092_14400.raw',...
'/home/data/km0909/raw/wh300/km2009_092_21600.raw',...
'/home/data/km0909/raw/wh300/km2009_092_28800.raw',...
'/home/data/km0909/raw/wh300/km2009_092_36000.raw',...
'/home/data/km0909/raw/wh300/km2009_092_43200.raw',...
'/home/data/km0909/raw/wh300/km2009_092_50400.raw',...
'/home/data/km0909/raw/wh300/km2009_092_57600.raw',...
'/home/data/km0909/raw/wh300/km2009_092_64800.raw',...
'/home/data/km0909/raw/wh300/km2009_092_72000.raw',...
'/home/data/km0909/raw/wh300/km2009_092_79200.raw',...
'/home/data/km0909/raw/wh300/km2009_093_00000.raw',...
'/home/data/km0909/raw/wh300/km2009_093_07200.raw',...
'/home/data/km0909/raw/wh300/km2009_093_14400.raw',...
'/home/data/km0909/raw/wh300/km2009_093_21600.raw',...
'/home/data/km0909/raw/wh300/km2009_093_28800.raw',...
'/home/data/km0909/raw/wh300/km2009_093_36000.raw',...
'/home/data/km0909/raw/wh300/km2009_093_43200.raw',...
'/home/data/km0909/raw/wh300/km2009_093_50400.raw',...
'/home/data/km0909/raw/wh300/km2009_093_57600.raw',...
'/home/data/km0909/raw/wh300/km2009_093_64800.raw',...
'/home/data/km0909/raw/wh300/km2009_093_72000.raw',...
'/home/data/km0909/raw/wh300/km2009_093_79200.raw',...
'/home/data/km0909/raw/wh300/km2009_094_00000.raw',...
'/home/data/km0909/raw/wh300/km2009_094_07200.raw',...
'/home/data/km0909/raw/wh300/km2009_094_14400.raw',...
'/home/data/km0909/raw/wh300/km2009_094_21600.raw',...
'/home/data/km0909/raw/wh300/km2009_094_28800.raw',...
'/home/data/km0909/raw/wh300/km2009_094_36000.raw',...
'/home/data/km0909/raw/wh300/km2009_094_43200.raw',...
'/home/data/km0909/raw/wh300/km2009_094_50400.raw',...
'/home/data/km0909/raw/wh300/km2009_094_57600.raw',...
'/home/data/km0909/raw/wh300/km2009_094_64800.raw',...
'/home/data/km0909/raw/wh300/km2009_094_72000.raw',...
'/home/data/km0909/raw/wh300/km2009_094_79200.raw',...
'/home/data/km0909/raw/wh300/km2009_095_00000.raw',...
'/home/data/km0909/raw/wh300/km2009_095_07200.raw',...
'/home/data/km0909/raw/wh300/km2009_095_14400.raw',...
'/home/data/km0909/raw/wh300/km2009_095_21600.raw',...
'/home/data/km0909/raw/wh300/km2009_095_28800.raw',...
'/home/data/km0909/raw/wh300/km2009_095_36000.raw',...
'/home/data/km0909/raw/wh300/km2009_095_43200.raw',...
'/home/data/km0909/raw/wh300/km2009_095_50400.raw',...
'/home/data/km0909/raw/wh300/km2009_095_57600.raw',...
'/home/data/km0909/raw/wh300/km2009_095_64800.raw',...
'/home/data/km0909/raw/wh300/km2009_095_72000.raw',...
'/home/data/km0909/raw/wh300/km2009_095_79200.raw',...
'/home/data/km0909/raw/wh300/km2009_096_00000.raw',...
'/home/data/km0909/raw/wh300/km2009_096_07200.raw',...
'/home/data/km0909/raw/wh300/km2009_096_14400.raw',...
'/home/data/km0909/raw/wh300/km2009_096_21600.raw',...
'/home/data/km0909/raw/wh300/km2009_096_28800.raw',...
'/home/data/km0909/raw/wh300/km2009_096_36000.raw',...
'/home/data/km0909/raw/wh300/km2009_096_43200.raw',...
'/home/data/km0909/raw/wh300/km2009_096_50400.raw',...
'/home/data/km0909/raw/wh300/km2009_096_57600.raw',...
'/home/data/km0909/raw/wh300/km2009_096_64800.raw',...
'/home/data/km0909/raw/wh300/km2009_096_72000.raw',...
'/home/data/km0909/raw/wh300/km2009_096_79200.raw',...
'/home/data/km0909/raw/wh300/km2009_097_00000.raw',...
'/home/data/km0909/raw/wh300/km2009_097_07200.raw',...
'/home/data/km0909/raw/wh300/km2009_097_14400.raw',...
'/home/data/km0909/raw/wh300/km2009_097_21600.raw',...
'/home/data/km0909/raw/wh300/km2009_097_28800.raw',...
'/home/data/km0909/raw/wh300/km2009_097_36000.raw',...
'/home/data/km0909/raw/wh300/km2009_097_43200.raw',...
'/home/data/km0909/raw/wh300/km2009_097_50400.raw',...
'/home/data/km0909/raw/wh300/km2009_097_57600.raw',...
'/home/data/km0909/raw/wh300/km2009_097_64800.raw',...
'/home/data/km0909/raw/wh300/km2009_097_72000.raw',...
'/home/data/km0909/raw/wh300/km2009_097_79200.raw',...
'/home/data/km0909/raw/wh300/km2009_098_00000.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);


     