

         %% 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'  , 'MGLN45MV',...
                              'cfgpath'  , '/home/data/MGLN45MV/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/MGLN45MV/raw/os75/mv2008_236_64209.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_236_64800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_236_72000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_236_79200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_237_00000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_237_07200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_237_14400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_237_21600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_237_28800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_237_36000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_237_43200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_237_50400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_237_57600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_237_64800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_237_72000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_237_79200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_238_00000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_238_07200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_238_14400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_238_21600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_238_28800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_238_36000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_238_43200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_238_50400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_238_57600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_238_64800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_238_72000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_238_79200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_239_00000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_239_07200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_239_14400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_239_21600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_239_28800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_239_36000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_239_43200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_239_50400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_239_57600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_239_64800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_239_72000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_239_79200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_240_00000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_240_07200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_240_14400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_240_21600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_240_28800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_240_36000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_240_43200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_240_50400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_240_57600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_240_64800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_240_72000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_240_79200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_241_00000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_241_07200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_241_14400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_241_21600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_241_28800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_241_36000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_241_43200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_241_50400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_241_57600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_241_64800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_241_72000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_241_79200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_242_00000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_242_07200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_242_14400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_242_21600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_242_28800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_242_36000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_242_43200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_242_50400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_242_57600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_242_64800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_242_72000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_242_79200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_243_00000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_243_07200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_243_14400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_243_21600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_243_28800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_243_36000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_243_43200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_243_50400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_243_57600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_243_64800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_243_72000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_243_79200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_244_00000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_244_07200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_244_14400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_244_21600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_244_28800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_244_36000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_244_43200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_244_50400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_244_57600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_244_64800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_244_72000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_244_79200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_245_00000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_245_07200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_245_14400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_245_21600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_245_28800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_245_36000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_245_43200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_245_50400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_245_57600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_245_64800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_245_72000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_245_79200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_246_00000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_246_07200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_246_14400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_246_21600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_246_28800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_246_36000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_246_43200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_246_50400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_246_57600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_246_64800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_246_72000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_246_79200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_247_00000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_247_07200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_247_14400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_247_21600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_247_28800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_247_36000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_247_43200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_247_50400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_247_57600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_247_64800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_247_72000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_247_79200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_248_00000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_248_07200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_248_14400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_248_21600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_248_28800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_248_36000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_248_43200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_248_50400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_248_57600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_248_64800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_248_72000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_248_79200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_249_00000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_249_07200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_249_14400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_249_21600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_249_28800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_249_36000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_249_43200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_249_50400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_249_57600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_249_64800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_249_72000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_249_79200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_250_00000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_250_07200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_250_14400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_250_21600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_250_28800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_250_36000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_250_43200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_250_50400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_250_57600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_250_64800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_250_72000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_250_79200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_251_00000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_251_07200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_251_14400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_251_21600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_251_28800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_251_36000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_251_43200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_251_50400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_251_57600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_251_64800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_251_72000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_251_79200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_252_00000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_252_07200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_252_14400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_252_21600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_252_28800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_252_36000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_252_43200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_252_50400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_252_57600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_252_64800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_252_72000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_252_79200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_253_00000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_253_07200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_253_14400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_253_21600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_253_28800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_253_36000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_253_43200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_253_50400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_253_57600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_253_64800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_253_72000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_253_79200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_254_00000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_254_07200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_254_14400.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_254_21600.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_254_28800.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_254_36000.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_254_43200.raw',...
'/home/data/MGLN45MV/raw/os75/mv2008_254_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);


     