

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

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

        %%====> 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/oc47101/raw/nb150/oc2011_111_61581.raw',...
'/home/data/oc47101/raw/nb150/oc2011_111_64800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_111_72000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_111_79200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_112_00000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_112_07200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_112_14400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_112_21600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_112_28800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_112_36000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_112_43200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_112_50400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_112_57600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_112_64800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_112_72000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_112_79200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_113_00000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_113_07200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_113_14400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_113_21600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_113_28800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_113_36000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_113_59601.raw',...
'/home/data/oc47101/raw/nb150/oc2011_113_64800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_113_72000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_113_79200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_114_00000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_114_07200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_114_14400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_114_21600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_114_28800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_114_36000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_114_43200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_114_50400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_114_57600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_114_64800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_114_72000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_114_79200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_115_00000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_115_07200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_115_14400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_115_21600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_115_28800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_115_36000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_115_43200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_115_50400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_115_57600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_115_64800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_115_72000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_115_79200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_116_00000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_116_07200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_116_14400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_116_21600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_116_28800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_116_36000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_116_43200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_116_50400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_116_57600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_116_64800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_116_72000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_116_79200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_117_00000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_117_07200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_117_14400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_117_21600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_117_28800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_117_36000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_117_43200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_117_50400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_117_57600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_117_64800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_117_72000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_117_79200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_118_00000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_118_07200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_118_14400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_118_21600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_118_28800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_118_36000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_118_43200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_118_50400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_118_57600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_118_64800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_118_72000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_118_79200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_119_00000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_119_07200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_119_14400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_119_21600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_119_28800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_119_36000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_119_43200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_119_50400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_119_57600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_119_64800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_119_72000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_119_79200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_120_00000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_120_07200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_120_14400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_120_21600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_120_28800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_120_36000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_120_43200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_120_50400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_120_57600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_120_64800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_120_72000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_120_79200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_121_00000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_121_07200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_121_14400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_121_21600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_121_28800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_121_36000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_121_43200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_121_50400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_121_57600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_121_64800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_121_72000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_121_79200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_122_00000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_122_07200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_122_14400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_122_21600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_122_28800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_122_36000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_122_43200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_122_50400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_122_57600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_122_64800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_122_72000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_122_79200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_123_00000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_123_07200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_123_14400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_123_21600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_123_28800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_123_36000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_123_43200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_123_50400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_123_57600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_123_64800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_123_72000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_124_60333.raw',...
'/home/data/oc47101/raw/nb150/oc2011_124_64800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_124_72000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_124_79200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_124_83846.raw',...
'/home/data/oc47101/raw/nb150/oc2011_125_00000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_125_07200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_125_14400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_125_21600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_125_28800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_125_36000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_125_43200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_125_50400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_125_57600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_125_64800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_125_72000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_125_79200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_126_00000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_126_07200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_126_14400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_126_21600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_126_28800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_126_36000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_126_43200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_126_50400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_126_57600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_126_64800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_126_72000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_126_79200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_127_00000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_127_07200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_127_14400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_127_21600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_127_28800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_127_36000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_127_43200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_127_50400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_127_57600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_127_64800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_127_72000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_127_79200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_128_00000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_128_07200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_128_14400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_128_21600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_128_28800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_128_36000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_128_43200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_128_50400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_128_57600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_128_64800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_128_72000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_128_79200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_129_00000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_129_07200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_129_14400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_129_21600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_129_28800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_129_36000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_129_43200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_129_50400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_129_57600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_129_64800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_129_72000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_129_79200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_130_00000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_130_07200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_130_14400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_130_21600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_130_28800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_130_36000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_130_43200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_130_50400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_130_57600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_130_64800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_130_72000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_130_79200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_131_00000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_131_07200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_131_14400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_131_21600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_131_28800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_131_36000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_131_43200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_131_50400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_131_57600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_131_64800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_131_72000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_131_73969.raw',...
'/home/data/oc47101/raw/nb150/oc2011_131_79200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_132_00000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_132_07200.raw',...
'/home/data/oc47101/raw/nb150/oc2011_132_14400.raw',...
'/home/data/oc47101/raw/nb150/oc2011_132_21600.raw',...
'/home/data/oc47101/raw/nb150/oc2011_132_28800.raw',...
'/home/data/oc47101/raw/nb150/oc2011_132_36000.raw',...
'/home/data/oc47101/raw/nb150/oc2011_132_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);


     