

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

        
            % begin "matcfgstr" string, created by run_lastensq.py
            instclass = wh;
            instname  = 'wh300';
            pingtype  = 'bb';
            proc_yearbase  = 2010;
            yearbase  = 2010;
            cfg =get_uhdascfg('cfgbase'  , 'w1010c_moum',...
                              'cfgpath'  , '/home/data/w1010c_moum/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 = '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 = 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/w1010c_moum/raw/wh300/we2010_295_07964.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_295_14400.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_295_21600.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_295_28800.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_295_36000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_295_43200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_295_50400.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_295_57600.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_295_64800.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_295_72000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_295_79200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_296_00000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_296_07200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_296_14400.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_296_21600.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_296_28800.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_296_36000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_296_43200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_296_50400.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_296_57600.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_296_64800.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_296_72000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_296_79200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_297_00000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_297_07200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_297_14400.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_297_21600.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_297_28800.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_297_36000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_297_43200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_297_50400.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_297_57600.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_297_58754.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_297_64800.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_297_68639.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_297_72000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_297_73494.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_297_73635.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_297_79200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_297_79421.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_298_00000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_298_04269.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_298_04775.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_298_07200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_298_09201.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_298_14400.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_298_21600.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_298_28800.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_298_36000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_298_43200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_298_50400.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_298_57600.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_298_64800.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_298_72000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_298_79200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_299_00000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_299_07200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_299_14400.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_299_21600.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_299_28800.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_299_36000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_299_43200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_299_50400.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_299_57600.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_299_64800.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_299_72000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_299_79200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_300_00000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_300_07200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_300_14400.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_300_21600.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_300_28800.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_300_36000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_300_43200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_300_50400.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_300_57600.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_300_64800.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_300_72000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_300_79200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_301_00000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_301_07200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_301_14400.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_301_21600.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_301_28800.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_301_36000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_301_43200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_301_50400.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_301_57600.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_301_64800.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_302_09143.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_302_14400.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_302_21600.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_302_28800.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_302_36000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_302_43200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_302_50400.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_302_57600.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_302_64800.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_302_72000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_302_79200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_303_00000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_303_07200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_303_14400.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_303_21600.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_303_28800.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_303_36000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_303_43200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_303_50400.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_303_57600.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_303_64800.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_303_72000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_303_79200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_304_00000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_304_07200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_304_14400.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_304_21600.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_304_28800.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_304_36000.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_304_43200.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_304_50400.raw',...
'/home/data/w1010c_moum/raw/wh300/we2010_304_57600.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);


     