

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

        
            % begin "matcfgstr" string, created by run_lastensq.py
            instclass = nb;
            instname  = 'nb150';
            pingtype  = 'nb';
            proc_yearbase  = 2010;
            yearbase  = 2010;
            cfg =get_uhdascfg('cfgbase'  , 'oc460',...
                              'cfgpath'  , '/home/data/oc460/proc/nb150/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;

        %%====


        % 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/oc460/raw/nb150/oc2010_120_67088.raw',...
'/home/data/oc460/raw/nb150/oc2010_120_72000.raw',...
'/home/data/oc460/raw/nb150/oc2010_120_79200.raw',...
'/home/data/oc460/raw/nb150/oc2010_121_00000.raw',...
'/home/data/oc460/raw/nb150/oc2010_121_07200.raw',...
'/home/data/oc460/raw/nb150/oc2010_121_14400.raw',...
'/home/data/oc460/raw/nb150/oc2010_121_21600.raw',...
'/home/data/oc460/raw/nb150/oc2010_121_28800.raw',...
'/home/data/oc460/raw/nb150/oc2010_121_36000.raw',...
'/home/data/oc460/raw/nb150/oc2010_121_43200.raw',...
'/home/data/oc460/raw/nb150/oc2010_121_50400.raw',...
'/home/data/oc460/raw/nb150/oc2010_121_57600.raw',...
'/home/data/oc460/raw/nb150/oc2010_121_64800.raw',...
'/home/data/oc460/raw/nb150/oc2010_121_72000.raw',...
'/home/data/oc460/raw/nb150/oc2010_121_79200.raw',...
'/home/data/oc460/raw/nb150/oc2010_122_00000.raw',...
'/home/data/oc460/raw/nb150/oc2010_122_07200.raw',...
'/home/data/oc460/raw/nb150/oc2010_122_14400.raw',...
'/home/data/oc460/raw/nb150/oc2010_122_21600.raw',...
'/home/data/oc460/raw/nb150/oc2010_122_28800.raw',...
'/home/data/oc460/raw/nb150/oc2010_122_36000.raw',...
'/home/data/oc460/raw/nb150/oc2010_122_43200.raw',...
'/home/data/oc460/raw/nb150/oc2010_122_50400.raw',...
'/home/data/oc460/raw/nb150/oc2010_122_57600.raw',...
'/home/data/oc460/raw/nb150/oc2010_122_64800.raw',...
'/home/data/oc460/raw/nb150/oc2010_122_72000.raw',...
'/home/data/oc460/raw/nb150/oc2010_122_79200.raw',...
'/home/data/oc460/raw/nb150/oc2010_123_00000.raw',...
'/home/data/oc460/raw/nb150/oc2010_123_07200.raw',...
'/home/data/oc460/raw/nb150/oc2010_123_14400.raw',...
'/home/data/oc460/raw/nb150/oc2010_123_21600.raw',...
'/home/data/oc460/raw/nb150/oc2010_123_28800.raw',...
'/home/data/oc460/raw/nb150/oc2010_123_36000.raw',...
'/home/data/oc460/raw/nb150/oc2010_123_43200.raw',...
'/home/data/oc460/raw/nb150/oc2010_123_50400.raw',...
'/home/data/oc460/raw/nb150/oc2010_123_57600.raw',...
'/home/data/oc460/raw/nb150/oc2010_123_64800.raw',...
'/home/data/oc460/raw/nb150/oc2010_123_72000.raw',...
'/home/data/oc460/raw/nb150/oc2010_123_79200.raw',...
'/home/data/oc460/raw/nb150/oc2010_124_00000.raw',...
'/home/data/oc460/raw/nb150/oc2010_124_07200.raw',...
'/home/data/oc460/raw/nb150/oc2010_124_14400.raw',...
'/home/data/oc460/raw/nb150/oc2010_124_21600.raw',...
'/home/data/oc460/raw/nb150/oc2010_124_28800.raw',...
'/home/data/oc460/raw/nb150/oc2010_124_36000.raw',...
'/home/data/oc460/raw/nb150/oc2010_124_43200.raw',...
'/home/data/oc460/raw/nb150/oc2010_124_50400.raw',...
'/home/data/oc460/raw/nb150/oc2010_124_57600.raw',...
'/home/data/oc460/raw/nb150/oc2010_124_64800.raw',...
'/home/data/oc460/raw/nb150/oc2010_124_72000.raw',...
'/home/data/oc460/raw/nb150/oc2010_124_79200.raw',...
'/home/data/oc460/raw/nb150/oc2010_125_00000.raw',...
'/home/data/oc460/raw/nb150/oc2010_125_07200.raw',...
'/home/data/oc460/raw/nb150/oc2010_125_14400.raw',...
'/home/data/oc460/raw/nb150/oc2010_125_21600.raw',...
'/home/data/oc460/raw/nb150/oc2010_125_28800.raw',...
'/home/data/oc460/raw/nb150/oc2010_125_36000.raw',...
'/home/data/oc460/raw/nb150/oc2010_125_43200.raw',...
'/home/data/oc460/raw/nb150/oc2010_125_50400.raw',...
'/home/data/oc460/raw/nb150/oc2010_125_57600.raw',...
'/home/data/oc460/raw/nb150/oc2010_125_64800.raw',...
'/home/data/oc460/raw/nb150/oc2010_125_72000.raw',...
'/home/data/oc460/raw/nb150/oc2010_125_79200.raw',...
'/home/data/oc460/raw/nb150/oc2010_126_00000.raw',...
'/home/data/oc460/raw/nb150/oc2010_126_07200.raw',...
'/home/data/oc460/raw/nb150/oc2010_126_14400.raw',...
'/home/data/oc460/raw/nb150/oc2010_126_21600.raw',...
'/home/data/oc460/raw/nb150/oc2010_126_28800.raw',...
'/home/data/oc460/raw/nb150/oc2010_126_36000.raw',...
'/home/data/oc460/raw/nb150/oc2010_126_43200.raw',...
'/home/data/oc460/raw/nb150/oc2010_126_50400.raw',...
'/home/data/oc460/raw/nb150/oc2010_126_57600.raw',...
'/home/data/oc460/raw/nb150/oc2010_126_64800.raw',...
'/home/data/oc460/raw/nb150/oc2010_126_72000.raw',...
'/home/data/oc460/raw/nb150/oc2010_126_79200.raw',...
'/home/data/oc460/raw/nb150/oc2010_127_00000.raw',...
'/home/data/oc460/raw/nb150/oc2010_127_07200.raw',...
'/home/data/oc460/raw/nb150/oc2010_127_14400.raw',...
'/home/data/oc460/raw/nb150/oc2010_127_21600.raw',...
'/home/data/oc460/raw/nb150/oc2010_127_28800.raw',...
'/home/data/oc460/raw/nb150/oc2010_127_36000.raw',...
'/home/data/oc460/raw/nb150/oc2010_127_43200.raw',...
'/home/data/oc460/raw/nb150/oc2010_127_50400.raw',...
'/home/data/oc460/raw/nb150/oc2010_127_57600.raw',...
'/home/data/oc460/raw/nb150/oc2010_127_64800.raw',...
'/home/data/oc460/raw/nb150/oc2010_127_72000.raw',...
'/home/data/oc460/raw/nb150/oc2010_127_79200.raw',...
'/home/data/oc460/raw/nb150/oc2010_128_00000.raw',...
'/home/data/oc460/raw/nb150/oc2010_128_07200.raw',...
'/home/data/oc460/raw/nb150/oc2010_128_14400.raw',...
'/home/data/oc460/raw/nb150/oc2010_128_21600.raw',...
'/home/data/oc460/raw/nb150/oc2010_128_28800.raw',...
'/home/data/oc460/raw/nb150/oc2010_128_36000.raw',...
'/home/data/oc460/raw/nb150/oc2010_128_43200.raw',...
'/home/data/oc460/raw/nb150/oc2010_128_50400.raw',...
'/home/data/oc460/raw/nb150/oc2010_128_57600.raw',...
'/home/data/oc460/raw/nb150/oc2010_128_64800.raw',...
'/home/data/oc460/raw/nb150/oc2010_128_72000.raw',...
'/home/data/oc460/raw/nb150/oc2010_128_79200.raw',...
'/home/data/oc460/raw/nb150/oc2010_129_00000.raw',...
'/home/data/oc460/raw/nb150/oc2010_129_07200.raw',...
'/home/data/oc460/raw/nb150/oc2010_129_14400.raw',...
'/home/data/oc460/raw/nb150/oc2010_129_21600.raw',...
'/home/data/oc460/raw/nb150/oc2010_129_28800.raw',...
'/home/data/oc460/raw/nb150/oc2010_129_36000.raw',...
'/home/data/oc460/raw/nb150/oc2010_129_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);


     