

         %% 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'  , 'kn199_5',...
                              'cfgpath'  , '/home/data/kn199_5/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 = 'posmv';              % this should be obsolete, but here for constistency
        % this is what is used. see get_rbinheading.m :
           %% cfg.hcorr_args : defaulting to values from get_uhdascfg, above

        % 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/kn199_5/raw/os75/kn2010_311_63049.raw',...
'/home/data/kn199_5/raw/os75/kn2010_311_64800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_311_72000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_311_79200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_312_00000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_312_07200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_312_14400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_312_21600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_312_28800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_312_36000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_312_43200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_312_50400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_312_57600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_312_62521.raw',...
'/home/data/kn199_5/raw/os75/kn2010_312_64800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_312_72000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_312_79200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_313_00000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_313_07200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_313_14400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_313_21600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_313_28800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_313_36000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_313_43200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_313_50400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_313_57600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_313_64800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_313_72000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_313_79200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_314_00000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_314_07200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_314_14400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_314_21600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_314_28800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_314_36000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_314_43200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_314_50400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_314_57600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_314_64800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_314_72000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_314_79200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_315_00000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_315_07200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_315_14400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_315_21600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_315_28800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_315_36000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_315_43200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_315_50400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_315_57600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_315_64800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_315_72000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_315_79200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_316_00000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_316_07200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_316_14400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_316_21600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_316_28800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_316_36000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_316_43200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_316_50400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_316_57600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_316_64800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_316_72000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_316_79200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_317_00000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_317_07200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_317_14400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_317_21600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_317_28800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_317_36000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_317_42943.raw',...
'/home/data/kn199_5/raw/os75/kn2010_317_43200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_317_50400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_317_57600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_317_64800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_317_72000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_317_79200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_318_00000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_318_07200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_318_14400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_318_21600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_318_28800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_318_36000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_318_43200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_318_50400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_318_57600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_318_64800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_318_72000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_318_79200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_319_00000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_319_07200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_319_14400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_319_21600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_319_28800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_319_36000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_319_43200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_319_50400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_319_57600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_319_64800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_319_72000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_319_79200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_320_00000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_320_07200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_320_14400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_320_21600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_320_28800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_320_36000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_320_43200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_320_50400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_320_57600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_320_64800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_320_72000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_320_79200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_321_00000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_321_07200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_321_14400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_321_21600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_321_28800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_321_36000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_321_43200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_321_50400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_321_57600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_321_64800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_321_72000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_321_79200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_322_00000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_322_07200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_322_14400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_322_21600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_322_28800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_322_36000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_322_43200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_322_50400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_322_57600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_322_64800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_322_72000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_322_79200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_323_00000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_323_07200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_323_14400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_323_21600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_323_28800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_323_36000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_323_43200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_323_50400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_323_57600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_323_64800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_323_72000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_323_79200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_324_00000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_324_07200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_324_14400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_324_21600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_324_28800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_324_36000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_324_43200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_324_50400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_324_57600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_324_64800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_324_72000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_324_79200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_325_00000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_325_07200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_325_14400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_325_21600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_325_28800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_325_36000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_325_43200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_325_50400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_325_57600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_325_64800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_325_72000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_325_79200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_326_00000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_326_07200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_326_14400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_326_21600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_326_28800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_326_36000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_326_43200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_326_50400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_326_57600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_326_64800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_326_72000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_326_79200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_327_00000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_327_07200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_327_14400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_327_21600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_327_28800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_327_36000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_327_43200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_327_50400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_327_57600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_327_64800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_327_72000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_327_79200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_328_00000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_328_07200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_328_14400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_328_21600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_328_28800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_328_36000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_328_43200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_328_50400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_328_57600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_328_64800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_328_72000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_328_79200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_329_00000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_329_07200.raw',...
'/home/data/kn199_5/raw/os75/kn2010_329_14400.raw',...
'/home/data/kn199_5/raw/os75/kn2010_329_21600.raw',...
'/home/data/kn199_5/raw/os75/kn2010_329_28800.raw',...
'/home/data/kn199_5/raw/os75/kn2010_329_36000.raw',...
'/home/data/kn199_5/raw/os75/kn2010_329_43200.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);


     