

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

        
            % begin "matcfgstr" string, created by run_lastensq.py
            instclass = os;
            instname  = 'os38';
            pingtype  = 'bb';
            proc_yearbase  = 2009;
            yearbase  = 2009;
            cfg =get_uhdascfg('cfgbase'  , 'km0910',...
                              'cfgpath'  , '/home/data/km0910/proc/os38bb/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 = 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/km0910/raw/os38/km2009_103_14619.raw',...
'/home/data/km0910/raw/os38/km2009_103_21600.raw',...
'/home/data/km0910/raw/os38/km2009_103_28800.raw',...
'/home/data/km0910/raw/os38/km2009_103_36000.raw',...
'/home/data/km0910/raw/os38/km2009_103_43200.raw',...
'/home/data/km0910/raw/os38/km2009_103_50400.raw',...
'/home/data/km0910/raw/os38/km2009_103_57600.raw',...
'/home/data/km0910/raw/os38/km2009_103_64800.raw',...
'/home/data/km0910/raw/os38/km2009_103_72000.raw',...
'/home/data/km0910/raw/os38/km2009_103_79200.raw',...
'/home/data/km0910/raw/os38/km2009_104_00000.raw',...
'/home/data/km0910/raw/os38/km2009_104_07200.raw',...
'/home/data/km0910/raw/os38/km2009_104_14400.raw',...
'/home/data/km0910/raw/os38/km2009_104_21600.raw',...
'/home/data/km0910/raw/os38/km2009_104_28800.raw',...
'/home/data/km0910/raw/os38/km2009_104_36000.raw',...
'/home/data/km0910/raw/os38/km2009_104_43200.raw',...
'/home/data/km0910/raw/os38/km2009_104_50400.raw',...
'/home/data/km0910/raw/os38/km2009_104_57600.raw',...
'/home/data/km0910/raw/os38/km2009_104_64800.raw',...
'/home/data/km0910/raw/os38/km2009_104_72000.raw',...
'/home/data/km0910/raw/os38/km2009_104_79200.raw',...
'/home/data/km0910/raw/os38/km2009_105_00000.raw',...
'/home/data/km0910/raw/os38/km2009_105_07200.raw',...
'/home/data/km0910/raw/os38/km2009_105_14400.raw',...
'/home/data/km0910/raw/os38/km2009_105_42614.raw',...
'/home/data/km0910/raw/os38/km2009_105_43200.raw',...
'/home/data/km0910/raw/os38/km2009_105_50400.raw',...
'/home/data/km0910/raw/os38/km2009_105_57600.raw',...
'/home/data/km0910/raw/os38/km2009_105_64800.raw',...
'/home/data/km0910/raw/os38/km2009_105_72000.raw',...
'/home/data/km0910/raw/os38/km2009_105_79200.raw',...
'/home/data/km0910/raw/os38/km2009_106_00000.raw',...
'/home/data/km0910/raw/os38/km2009_106_07200.raw',...
'/home/data/km0910/raw/os38/km2009_106_14400.raw',...
'/home/data/km0910/raw/os38/km2009_106_21600.raw',...
'/home/data/km0910/raw/os38/km2009_106_28800.raw',...
'/home/data/km0910/raw/os38/km2009_106_36000.raw',...
'/home/data/km0910/raw/os38/km2009_106_43200.raw',...
'/home/data/km0910/raw/os38/km2009_106_50400.raw',...
'/home/data/km0910/raw/os38/km2009_106_57600.raw',...
'/home/data/km0910/raw/os38/km2009_106_64800.raw',...
'/home/data/km0910/raw/os38/km2009_106_72000.raw',...
'/home/data/km0910/raw/os38/km2009_106_79200.raw',...
'/home/data/km0910/raw/os38/km2009_107_00000.raw',...
'/home/data/km0910/raw/os38/km2009_107_07200.raw',...
'/home/data/km0910/raw/os38/km2009_107_14400.raw',...
'/home/data/km0910/raw/os38/km2009_107_21600.raw',...
'/home/data/km0910/raw/os38/km2009_107_28800.raw',...
'/home/data/km0910/raw/os38/km2009_107_36000.raw',...
'/home/data/km0910/raw/os38/km2009_107_43200.raw',...
'/home/data/km0910/raw/os38/km2009_107_50400.raw',...
'/home/data/km0910/raw/os38/km2009_107_57600.raw',...
'/home/data/km0910/raw/os38/km2009_107_64800.raw',...
'/home/data/km0910/raw/os38/km2009_107_72000.raw',...
'/home/data/km0910/raw/os38/km2009_107_79200.raw',...
'/home/data/km0910/raw/os38/km2009_108_00000.raw',...
'/home/data/km0910/raw/os38/km2009_108_07200.raw',...
'/home/data/km0910/raw/os38/km2009_108_14400.raw',...
'/home/data/km0910/raw/os38/km2009_108_21600.raw',...
'/home/data/km0910/raw/os38/km2009_108_28800.raw',...
'/home/data/km0910/raw/os38/km2009_108_36000.raw',...
'/home/data/km0910/raw/os38/km2009_108_43200.raw',...
'/home/data/km0910/raw/os38/km2009_108_50400.raw',...
'/home/data/km0910/raw/os38/km2009_108_57600.raw',...
'/home/data/km0910/raw/os38/km2009_108_64800.raw',...
'/home/data/km0910/raw/os38/km2009_108_72000.raw',...
'/home/data/km0910/raw/os38/km2009_108_79200.raw',...
'/home/data/km0910/raw/os38/km2009_109_00000.raw',...
'/home/data/km0910/raw/os38/km2009_109_07200.raw',...
'/home/data/km0910/raw/os38/km2009_109_14400.raw',...
'/home/data/km0910/raw/os38/km2009_109_21600.raw',...
'/home/data/km0910/raw/os38/km2009_109_28800.raw',...
'/home/data/km0910/raw/os38/km2009_109_58677.raw',...
'/home/data/km0910/raw/os38/km2009_109_64800.raw',...
'/home/data/km0910/raw/os38/km2009_109_72000.raw',...
'/home/data/km0910/raw/os38/km2009_109_79200.raw',...
'/home/data/km0910/raw/os38/km2009_110_00000.raw',...
'/home/data/km0910/raw/os38/km2009_110_07200.raw',...
'/home/data/km0910/raw/os38/km2009_110_14400.raw',...
'/home/data/km0910/raw/os38/km2009_110_21600.raw',...
'/home/data/km0910/raw/os38/km2009_110_28800.raw',...
'/home/data/km0910/raw/os38/km2009_110_36000.raw',...
'/home/data/km0910/raw/os38/km2009_110_43200.raw',...
'/home/data/km0910/raw/os38/km2009_110_50400.raw',...
'/home/data/km0910/raw/os38/km2009_110_57600.raw',...
'/home/data/km0910/raw/os38/km2009_110_64800.raw',...
'/home/data/km0910/raw/os38/km2009_110_72000.raw',...
'/home/data/km0910/raw/os38/km2009_110_79200.raw',...
'/home/data/km0910/raw/os38/km2009_111_00000.raw',...
'/home/data/km0910/raw/os38/km2009_111_07200.raw',...
'/home/data/km0910/raw/os38/km2009_111_14400.raw',...
'/home/data/km0910/raw/os38/km2009_111_21600.raw',...
'/home/data/km0910/raw/os38/km2009_111_28800.raw',...
'/home/data/km0910/raw/os38/km2009_111_36000.raw',...
'/home/data/km0910/raw/os38/km2009_111_43200.raw',...
'/home/data/km0910/raw/os38/km2009_111_50400.raw',...
'/home/data/km0910/raw/os38/km2009_111_57600.raw',...
'/home/data/km0910/raw/os38/km2009_111_64800.raw',...
'/home/data/km0910/raw/os38/km2009_111_72000.raw',...
'/home/data/km0910/raw/os38/km2009_111_79200.raw',...
'/home/data/km0910/raw/os38/km2009_112_00000.raw',...
'/home/data/km0910/raw/os38/km2009_112_07200.raw',...
'/home/data/km0910/raw/os38/km2009_112_14400.raw',...
'/home/data/km0910/raw/os38/km2009_112_21600.raw',...
'/home/data/km0910/raw/os38/km2009_112_28800.raw',...
'/home/data/km0910/raw/os38/km2009_112_36000.raw',...
'/home/data/km0910/raw/os38/km2009_112_43200.raw',...
'/home/data/km0910/raw/os38/km2009_112_50400.raw',...
'/home/data/km0910/raw/os38/km2009_112_57600.raw',...
'/home/data/km0910/raw/os38/km2009_112_64800.raw',...
'/home/data/km0910/raw/os38/km2009_112_72000.raw',...
'/home/data/km0910/raw/os38/km2009_112_79200.raw',...
'/home/data/km0910/raw/os38/km2009_113_00000.raw',...
'/home/data/km0910/raw/os38/km2009_113_07200.raw',...
'/home/data/km0910/raw/os38/km2009_113_14400.raw',...
'/home/data/km0910/raw/os38/km2009_113_21600.raw',...
'/home/data/km0910/raw/os38/km2009_113_28800.raw',...
'/home/data/km0910/raw/os38/km2009_113_36000.raw',...
'/home/data/km0910/raw/os38/km2009_113_43200.raw',...
'/home/data/km0910/raw/os38/km2009_113_50400.raw',...
'/home/data/km0910/raw/os38/km2009_113_57600.raw',...
'/home/data/km0910/raw/os38/km2009_113_64800.raw',...
'/home/data/km0910/raw/os38/km2009_113_72000.raw',...
'/home/data/km0910/raw/os38/km2009_113_79200.raw',...
'/home/data/km0910/raw/os38/km2009_114_00000.raw',...
'/home/data/km0910/raw/os38/km2009_114_07200.raw',...
'/home/data/km0910/raw/os38/km2009_114_14400.raw',...
'/home/data/km0910/raw/os38/km2009_114_21600.raw',...
'/home/data/km0910/raw/os38/km2009_114_28800.raw',...
'/home/data/km0910/raw/os38/km2009_114_36000.raw',...
'/home/data/km0910/raw/os38/km2009_114_43200.raw',...
'/home/data/km0910/raw/os38/km2009_114_50400.raw',...
'/home/data/km0910/raw/os38/km2009_114_57600.raw',...
'/home/data/km0910/raw/os38/km2009_114_64800.raw',...
'/home/data/km0910/raw/os38/km2009_114_72000.raw',...
'/home/data/km0910/raw/os38/km2009_114_79200.raw',...
'/home/data/km0910/raw/os38/km2009_115_00000.raw',...
'/home/data/km0910/raw/os38/km2009_115_07200.raw',...
'/home/data/km0910/raw/os38/km2009_115_14400.raw',...
'/home/data/km0910/raw/os38/km2009_115_21600.raw',...
'/home/data/km0910/raw/os38/km2009_115_28800.raw',...
'/home/data/km0910/raw/os38/km2009_115_36000.raw',...
'/home/data/km0910/raw/os38/km2009_115_43200.raw',...
'/home/data/km0910/raw/os38/km2009_115_50400.raw',...
'/home/data/km0910/raw/os38/km2009_115_57600.raw',...
'/home/data/km0910/raw/os38/km2009_115_64800.raw',...
'/home/data/km0910/raw/os38/km2009_115_72000.raw',...
'/home/data/km0910/raw/os38/km2009_115_79200.raw',...
'/home/data/km0910/raw/os38/km2009_116_00000.raw',...
'/home/data/km0910/raw/os38/km2009_116_07200.raw',...
'/home/data/km0910/raw/os38/km2009_116_14400.raw',...
'/home/data/km0910/raw/os38/km2009_116_21600.raw',...
'/home/data/km0910/raw/os38/km2009_116_28800.raw',...
'/home/data/km0910/raw/os38/km2009_116_36000.raw',...
'/home/data/km0910/raw/os38/km2009_116_43200.raw',...
'/home/data/km0910/raw/os38/km2009_116_50400.raw',...
'/home/data/km0910/raw/os38/km2009_116_57600.raw',...
'/home/data/km0910/raw/os38/km2009_116_64800.raw',...
'/home/data/km0910/raw/os38/km2009_116_72000.raw',...
'/home/data/km0910/raw/os38/km2009_116_79200.raw',...
'/home/data/km0910/raw/os38/km2009_117_00000.raw',...
'/home/data/km0910/raw/os38/km2009_117_07200.raw',...
'/home/data/km0910/raw/os38/km2009_117_14400.raw',...
'/home/data/km0910/raw/os38/km2009_117_21600.raw',...
'/home/data/km0910/raw/os38/km2009_117_28800.raw',...
'/home/data/km0910/raw/os38/km2009_117_36000.raw',...
'/home/data/km0910/raw/os38/km2009_117_43200.raw',...
'/home/data/km0910/raw/os38/km2009_117_50400.raw',...
'/home/data/km0910/raw/os38/km2009_117_57600.raw',...
'/home/data/km0910/raw/os38/km2009_117_64800.raw',...
'/home/data/km0910/raw/os38/km2009_117_72000.raw',...
'/home/data/km0910/raw/os38/km2009_117_79200.raw',...
'/home/data/km0910/raw/os38/km2009_118_00000.raw',...
'/home/data/km0910/raw/os38/km2009_118_07200.raw',...
'/home/data/km0910/raw/os38/km2009_118_14400.raw',...
'/home/data/km0910/raw/os38/km2009_118_21600.raw',...
'/home/data/km0910/raw/os38/km2009_118_28800.raw',...
'/home/data/km0910/raw/os38/km2009_118_36000.raw',...
'/home/data/km0910/raw/os38/km2009_118_43200.raw',...
'/home/data/km0910/raw/os38/km2009_118_50400.raw',...
'/home/data/km0910/raw/os38/km2009_118_57600.raw',...
'/home/data/km0910/raw/os38/km2009_119_02948.raw',...
'/home/data/km0910/raw/os38/km2009_119_07200.raw',...
'/home/data/km0910/raw/os38/km2009_119_14400.raw',...
'/home/data/km0910/raw/os38/km2009_119_21600.raw',...
'/home/data/km0910/raw/os38/km2009_119_28800.raw',...
'/home/data/km0910/raw/os38/km2009_119_36000.raw',...
'/home/data/km0910/raw/os38/km2009_119_43200.raw',...
'/home/data/km0910/raw/os38/km2009_119_50400.raw',...
'/home/data/km0910/raw/os38/km2009_119_57600.raw',...
'/home/data/km0910/raw/os38/km2009_119_64800.raw',...
'/home/data/km0910/raw/os38/km2009_119_72000.raw',...
'/home/data/km0910/raw/os38/km2009_119_79200.raw',...
'/home/data/km0910/raw/os38/km2009_120_00000.raw',...
'/home/data/km0910/raw/os38/km2009_120_07200.raw',...
'/home/data/km0910/raw/os38/km2009_120_14400.raw',...
'/home/data/km0910/raw/os38/km2009_120_21600.raw',...
'/home/data/km0910/raw/os38/km2009_120_28800.raw',...
'/home/data/km0910/raw/os38/km2009_120_36000.raw',...
'/home/data/km0910/raw/os38/km2009_120_43200.raw',...
'/home/data/km0910/raw/os38/km2009_120_50400.raw',...
'/home/data/km0910/raw/os38/km2009_120_57600.raw',...
'/home/data/km0910/raw/os38/km2009_120_64800.raw',...
'/home/data/km0910/raw/os38/km2009_120_72000.raw',...
'/home/data/km0910/raw/os38/km2009_120_79200.raw',...
'/home/data/km0910/raw/os38/km2009_121_00000.raw',...
'/home/data/km0910/raw/os38/km2009_121_07200.raw',...
'/home/data/km0910/raw/os38/km2009_121_14400.raw',...
'/home/data/km0910/raw/os38/km2009_121_21600.raw',...
'/home/data/km0910/raw/os38/km2009_121_28800.raw',...
'/home/data/km0910/raw/os38/km2009_121_36000.raw',...
'/home/data/km0910/raw/os38/km2009_121_43200.raw',...
'/home/data/km0910/raw/os38/km2009_121_50400.raw',...
'/home/data/km0910/raw/os38/km2009_121_57600.raw',...
'/home/data/km0910/raw/os38/km2009_121_64800.raw',...
'/home/data/km0910/raw/os38/km2009_121_72000.raw',...
'/home/data/km0910/raw/os38/km2009_121_79200.raw',...
'/home/data/km0910/raw/os38/km2009_121_79921.raw',...
'/home/data/km0910/raw/os38/km2009_122_00000.raw',...
'/home/data/km0910/raw/os38/km2009_122_07200.raw',...
'/home/data/km0910/raw/os38/km2009_122_14400.raw',...
'/home/data/km0910/raw/os38/km2009_122_21600.raw',...
'/home/data/km0910/raw/os38/km2009_122_28800.raw',...
'/home/data/km0910/raw/os38/km2009_122_36000.raw',...
'/home/data/km0910/raw/os38/km2009_122_43200.raw',...
'/home/data/km0910/raw/os38/km2009_122_50400.raw',...
'/home/data/km0910/raw/os38/km2009_122_57600.raw',...
'/home/data/km0910/raw/os38/km2009_122_64800.raw',...
'/home/data/km0910/raw/os38/km2009_122_72000.raw',...
'/home/data/km0910/raw/os38/km2009_122_79200.raw',...
'/home/data/km0910/raw/os38/km2009_123_00000.raw',...
'/home/data/km0910/raw/os38/km2009_123_07200.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);


     