

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

        
            % begin "matcfgstr" string, created by run_lastensq.py
            instclass = os;
            instname  = 'os75';
            pingtype  = 'nb';
            proc_yearbase  = 2011;
            yearbase  = 2011;
            cfg =get_uhdascfg('cfgbase'  , 'oc47004',...
                              'cfgpath'  , '/home/data/oc47004/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/oc47004/raw/os75/oc2011_099_67743.raw',...
'/home/data/oc47004/raw/os75/oc2011_099_72000.raw',...
'/home/data/oc47004/raw/os75/oc2011_099_79200.raw',...
'/home/data/oc47004/raw/os75/oc2011_100_00000.raw',...
'/home/data/oc47004/raw/os75/oc2011_100_07200.raw',...
'/home/data/oc47004/raw/os75/oc2011_100_14400.raw',...
'/home/data/oc47004/raw/os75/oc2011_100_21600.raw',...
'/home/data/oc47004/raw/os75/oc2011_100_28800.raw',...
'/home/data/oc47004/raw/os75/oc2011_100_36000.raw',...
'/home/data/oc47004/raw/os75/oc2011_100_43200.raw',...
'/home/data/oc47004/raw/os75/oc2011_100_50400.raw',...
'/home/data/oc47004/raw/os75/oc2011_100_57600.raw',...
'/home/data/oc47004/raw/os75/oc2011_100_64800.raw',...
'/home/data/oc47004/raw/os75/oc2011_100_72000.raw',...
'/home/data/oc47004/raw/os75/oc2011_100_79200.raw',...
'/home/data/oc47004/raw/os75/oc2011_101_00000.raw',...
'/home/data/oc47004/raw/os75/oc2011_101_07200.raw',...
'/home/data/oc47004/raw/os75/oc2011_101_14400.raw',...
'/home/data/oc47004/raw/os75/oc2011_101_21600.raw',...
'/home/data/oc47004/raw/os75/oc2011_101_28800.raw',...
'/home/data/oc47004/raw/os75/oc2011_101_36000.raw',...
'/home/data/oc47004/raw/os75/oc2011_101_43200.raw',...
'/home/data/oc47004/raw/os75/oc2011_101_50400.raw',...
'/home/data/oc47004/raw/os75/oc2011_101_57600.raw',...
'/home/data/oc47004/raw/os75/oc2011_101_64800.raw',...
'/home/data/oc47004/raw/os75/oc2011_101_72000.raw',...
'/home/data/oc47004/raw/os75/oc2011_101_79200.raw',...
'/home/data/oc47004/raw/os75/oc2011_102_00000.raw',...
'/home/data/oc47004/raw/os75/oc2011_102_07200.raw',...
'/home/data/oc47004/raw/os75/oc2011_102_14400.raw',...
'/home/data/oc47004/raw/os75/oc2011_102_21600.raw',...
'/home/data/oc47004/raw/os75/oc2011_102_28800.raw',...
'/home/data/oc47004/raw/os75/oc2011_102_36000.raw',...
'/home/data/oc47004/raw/os75/oc2011_102_43200.raw',...
'/home/data/oc47004/raw/os75/oc2011_102_50400.raw',...
'/home/data/oc47004/raw/os75/oc2011_102_57709.raw',...
'/home/data/oc47004/raw/os75/oc2011_102_64800.raw',...
'/home/data/oc47004/raw/os75/oc2011_102_69391.raw',...
'/home/data/oc47004/raw/os75/oc2011_102_72000.raw',...
'/home/data/oc47004/raw/os75/oc2011_102_79200.raw',...
'/home/data/oc47004/raw/os75/oc2011_103_00000.raw',...
'/home/data/oc47004/raw/os75/oc2011_103_07200.raw',...
'/home/data/oc47004/raw/os75/oc2011_103_14400.raw',...
'/home/data/oc47004/raw/os75/oc2011_103_21600.raw',...
'/home/data/oc47004/raw/os75/oc2011_103_28800.raw',...
'/home/data/oc47004/raw/os75/oc2011_103_36000.raw',...
'/home/data/oc47004/raw/os75/oc2011_103_43200.raw',...
'/home/data/oc47004/raw/os75/oc2011_103_50400.raw',...
'/home/data/oc47004/raw/os75/oc2011_103_57600.raw',...
'/home/data/oc47004/raw/os75/oc2011_103_64800.raw',...
'/home/data/oc47004/raw/os75/oc2011_103_72000.raw',...
'/home/data/oc47004/raw/os75/oc2011_103_79200.raw',...
'/home/data/oc47004/raw/os75/oc2011_104_00000.raw',...
'/home/data/oc47004/raw/os75/oc2011_104_07200.raw',...
'/home/data/oc47004/raw/os75/oc2011_104_14400.raw',...
'/home/data/oc47004/raw/os75/oc2011_104_21600.raw',...
'/home/data/oc47004/raw/os75/oc2011_104_28800.raw',...
'/home/data/oc47004/raw/os75/oc2011_104_36000.raw',...
'/home/data/oc47004/raw/os75/oc2011_104_43200.raw',...
'/home/data/oc47004/raw/os75/oc2011_104_50400.raw',...
'/home/data/oc47004/raw/os75/oc2011_104_57600.raw',...
'/home/data/oc47004/raw/os75/oc2011_104_64800.raw',...
'/home/data/oc47004/raw/os75/oc2011_104_72000.raw',...
'/home/data/oc47004/raw/os75/oc2011_104_79200.raw',...
'/home/data/oc47004/raw/os75/oc2011_105_00000.raw',...
'/home/data/oc47004/raw/os75/oc2011_105_07200.raw',...
'/home/data/oc47004/raw/os75/oc2011_105_14400.raw',...
'/home/data/oc47004/raw/os75/oc2011_105_21600.raw',...
'/home/data/oc47004/raw/os75/oc2011_105_28800.raw',...
'/home/data/oc47004/raw/os75/oc2011_105_36000.raw',...
'/home/data/oc47004/raw/os75/oc2011_105_43200.raw',...
'/home/data/oc47004/raw/os75/oc2011_105_50400.raw',...
'/home/data/oc47004/raw/os75/oc2011_105_57600.raw',...
'/home/data/oc47004/raw/os75/oc2011_105_64800.raw',...
'/home/data/oc47004/raw/os75/oc2011_105_72000.raw',...
'/home/data/oc47004/raw/os75/oc2011_105_79200.raw',...
'/home/data/oc47004/raw/os75/oc2011_106_00000.raw',...
'/home/data/oc47004/raw/os75/oc2011_106_07200.raw',...
'/home/data/oc47004/raw/os75/oc2011_106_14400.raw',...
'/home/data/oc47004/raw/os75/oc2011_106_21600.raw',...
'/home/data/oc47004/raw/os75/oc2011_106_28800.raw',...
'/home/data/oc47004/raw/os75/oc2011_106_36000.raw',...
'/home/data/oc47004/raw/os75/oc2011_106_43200.raw',...
'/home/data/oc47004/raw/os75/oc2011_106_50400.raw',...
'/home/data/oc47004/raw/os75/oc2011_106_57600.raw',...
'/home/data/oc47004/raw/os75/oc2011_106_64800.raw',...
'/home/data/oc47004/raw/os75/oc2011_106_72000.raw',...
'/home/data/oc47004/raw/os75/oc2011_106_79200.raw',...
'/home/data/oc47004/raw/os75/oc2011_107_00000.raw',...
'/home/data/oc47004/raw/os75/oc2011_107_07200.raw',...
'/home/data/oc47004/raw/os75/oc2011_107_14400.raw',...
'/home/data/oc47004/raw/os75/oc2011_107_21600.raw',...
'/home/data/oc47004/raw/os75/oc2011_107_28800.raw',...
'/home/data/oc47004/raw/os75/oc2011_107_36000.raw',...
'/home/data/oc47004/raw/os75/oc2011_107_43200.raw',...
'/home/data/oc47004/raw/os75/oc2011_107_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,   'maxrunsecs', 300,...
            'save_editcfg', 0,...
            'verbose', 0);


     