

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

        
            % begin "matcfgstr" string, created by run_lastensq.py
            instclass = os;
            instname  = 'os75';
            pingtype  = 'bb';
            proc_yearbase  = 2009;
            yearbase  = 2009;
            cfg =get_uhdascfg('cfgbase'  , 'MV0903',...
                              'cfgpath'  , '/home/data/MV0903/proc/os75bb/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/MV0903/raw/os75/mv2009_057_26737.raw',...
'/home/data/MV0903/raw/os75/mv2009_057_28800.raw',...
'/home/data/MV0903/raw/os75/mv2009_057_36000.raw',...
'/home/data/MV0903/raw/os75/mv2009_057_43200.raw',...
'/home/data/MV0903/raw/os75/mv2009_057_50400.raw',...
'/home/data/MV0903/raw/os75/mv2009_057_57600.raw',...
'/home/data/MV0903/raw/os75/mv2009_057_64800.raw',...
'/home/data/MV0903/raw/os75/mv2009_057_72000.raw',...
'/home/data/MV0903/raw/os75/mv2009_057_79200.raw',...
'/home/data/MV0903/raw/os75/mv2009_058_00000.raw',...
'/home/data/MV0903/raw/os75/mv2009_058_07200.raw',...
'/home/data/MV0903/raw/os75/mv2009_058_14400.raw',...
'/home/data/MV0903/raw/os75/mv2009_058_21600.raw',...
'/home/data/MV0903/raw/os75/mv2009_058_28800.raw',...
'/home/data/MV0903/raw/os75/mv2009_058_36000.raw',...
'/home/data/MV0903/raw/os75/mv2009_058_43200.raw',...
'/home/data/MV0903/raw/os75/mv2009_058_50400.raw',...
'/home/data/MV0903/raw/os75/mv2009_058_57600.raw',...
'/home/data/MV0903/raw/os75/mv2009_058_64800.raw',...
'/home/data/MV0903/raw/os75/mv2009_058_72000.raw',...
'/home/data/MV0903/raw/os75/mv2009_058_79200.raw',...
'/home/data/MV0903/raw/os75/mv2009_059_00000.raw',...
'/home/data/MV0903/raw/os75/mv2009_059_07200.raw',...
'/home/data/MV0903/raw/os75/mv2009_059_14400.raw',...
'/home/data/MV0903/raw/os75/mv2009_059_21600.raw',...
'/home/data/MV0903/raw/os75/mv2009_059_28800.raw',...
'/home/data/MV0903/raw/os75/mv2009_059_36000.raw',...
'/home/data/MV0903/raw/os75/mv2009_059_43200.raw',...
'/home/data/MV0903/raw/os75/mv2009_059_50400.raw',...
'/home/data/MV0903/raw/os75/mv2009_059_57600.raw',...
'/home/data/MV0903/raw/os75/mv2009_059_64800.raw',...
'/home/data/MV0903/raw/os75/mv2009_059_72000.raw',...
'/home/data/MV0903/raw/os75/mv2009_059_79200.raw',...
'/home/data/MV0903/raw/os75/mv2009_060_00000.raw',...
'/home/data/MV0903/raw/os75/mv2009_060_07200.raw',...
'/home/data/MV0903/raw/os75/mv2009_060_14400.raw',...
'/home/data/MV0903/raw/os75/mv2009_060_19113.raw',...
'/home/data/MV0903/raw/os75/mv2009_060_21600.raw',...
'/home/data/MV0903/raw/os75/mv2009_060_28800.raw',...
'/home/data/MV0903/raw/os75/mv2009_060_36000.raw',...
'/home/data/MV0903/raw/os75/mv2009_060_43200.raw',...
'/home/data/MV0903/raw/os75/mv2009_060_50400.raw',...
'/home/data/MV0903/raw/os75/mv2009_060_57600.raw',...
'/home/data/MV0903/raw/os75/mv2009_060_64800.raw',...
'/home/data/MV0903/raw/os75/mv2009_060_72000.raw',...
'/home/data/MV0903/raw/os75/mv2009_060_79200.raw',...
'/home/data/MV0903/raw/os75/mv2009_061_00000.raw',...
'/home/data/MV0903/raw/os75/mv2009_061_07200.raw',...
'/home/data/MV0903/raw/os75/mv2009_061_14400.raw',...
'/home/data/MV0903/raw/os75/mv2009_061_21600.raw',...
'/home/data/MV0903/raw/os75/mv2009_061_28800.raw',...
'/home/data/MV0903/raw/os75/mv2009_061_36000.raw',...
'/home/data/MV0903/raw/os75/mv2009_061_43200.raw',...
'/home/data/MV0903/raw/os75/mv2009_061_50400.raw',...
'/home/data/MV0903/raw/os75/mv2009_061_57600.raw',...
'/home/data/MV0903/raw/os75/mv2009_061_64800.raw',...
'/home/data/MV0903/raw/os75/mv2009_061_72000.raw',...
'/home/data/MV0903/raw/os75/mv2009_061_79200.raw',...
'/home/data/MV0903/raw/os75/mv2009_062_00000.raw',...
'/home/data/MV0903/raw/os75/mv2009_062_07200.raw',...
'/home/data/MV0903/raw/os75/mv2009_062_14400.raw',...
'/home/data/MV0903/raw/os75/mv2009_062_21600.raw',...
'/home/data/MV0903/raw/os75/mv2009_062_28800.raw',...
'/home/data/MV0903/raw/os75/mv2009_062_36000.raw',...
'/home/data/MV0903/raw/os75/mv2009_062_43200.raw',...
'/home/data/MV0903/raw/os75/mv2009_062_50400.raw',...
'/home/data/MV0903/raw/os75/mv2009_062_57600.raw',...
'/home/data/MV0903/raw/os75/mv2009_062_64800.raw',...
'/home/data/MV0903/raw/os75/mv2009_062_72000.raw',...
'/home/data/MV0903/raw/os75/mv2009_062_79200.raw',...
'/home/data/MV0903/raw/os75/mv2009_063_00000.raw',...
'/home/data/MV0903/raw/os75/mv2009_063_07200.raw',...
'/home/data/MV0903/raw/os75/mv2009_063_14400.raw',...
'/home/data/MV0903/raw/os75/mv2009_063_21600.raw',...
'/home/data/MV0903/raw/os75/mv2009_063_28800.raw',...
'/home/data/MV0903/raw/os75/mv2009_063_36000.raw',...
'/home/data/MV0903/raw/os75/mv2009_063_43200.raw',...
'/home/data/MV0903/raw/os75/mv2009_063_50400.raw',...
'/home/data/MV0903/raw/os75/mv2009_063_57600.raw',...
'/home/data/MV0903/raw/os75/mv2009_063_64800.raw',...
'/home/data/MV0903/raw/os75/mv2009_063_72000.raw',...
'/home/data/MV0903/raw/os75/mv2009_063_79200.raw',...
'/home/data/MV0903/raw/os75/mv2009_064_00000.raw',...
'/home/data/MV0903/raw/os75/mv2009_064_07200.raw',...
'/home/data/MV0903/raw/os75/mv2009_064_14400.raw',...
'/home/data/MV0903/raw/os75/mv2009_064_21600.raw',...
'/home/data/MV0903/raw/os75/mv2009_064_28800.raw',...
'/home/data/MV0903/raw/os75/mv2009_064_36000.raw',...
'/home/data/MV0903/raw/os75/mv2009_064_43200.raw',...
'/home/data/MV0903/raw/os75/mv2009_064_50400.raw',...
'/home/data/MV0903/raw/os75/mv2009_064_57600.raw',...
'/home/data/MV0903/raw/os75/mv2009_064_64800.raw',...
'/home/data/MV0903/raw/os75/mv2009_064_72000.raw',...
'/home/data/MV0903/raw/os75/mv2009_064_79200.raw',...
'/home/data/MV0903/raw/os75/mv2009_065_00000.raw',...
'/home/data/MV0903/raw/os75/mv2009_065_07200.raw',...
'/home/data/MV0903/raw/os75/mv2009_065_14400.raw',...
'/home/data/MV0903/raw/os75/mv2009_065_21600.raw',...
'/home/data/MV0903/raw/os75/mv2009_065_28800.raw',...
'/home/data/MV0903/raw/os75/mv2009_065_36000.raw',...
'/home/data/MV0903/raw/os75/mv2009_065_43200.raw',...
'/home/data/MV0903/raw/os75/mv2009_065_50400.raw',...
'/home/data/MV0903/raw/os75/mv2009_065_57600.raw',...
'/home/data/MV0903/raw/os75/mv2009_065_64800.raw',...
'/home/data/MV0903/raw/os75/mv2009_065_72000.raw',...
'/home/data/MV0903/raw/os75/mv2009_065_79200.raw',...
'/home/data/MV0903/raw/os75/mv2009_066_00000.raw',...
'/home/data/MV0903/raw/os75/mv2009_066_07200.raw',...
'/home/data/MV0903/raw/os75/mv2009_066_14400.raw',...
'/home/data/MV0903/raw/os75/mv2009_066_21600.raw',...
'/home/data/MV0903/raw/os75/mv2009_066_28800.raw',...
'/home/data/MV0903/raw/os75/mv2009_066_36000.raw',...
'/home/data/MV0903/raw/os75/mv2009_066_43200.raw',...
'/home/data/MV0903/raw/os75/mv2009_066_50400.raw',...
'/home/data/MV0903/raw/os75/mv2009_066_57600.raw',...
'/home/data/MV0903/raw/os75/mv2009_066_64800.raw',...
'/home/data/MV0903/raw/os75/mv2009_066_72000.raw',...
'/home/data/MV0903/raw/os75/mv2009_066_79200.raw',...
'/home/data/MV0903/raw/os75/mv2009_067_00000.raw',...
'/home/data/MV0903/raw/os75/mv2009_067_10742.raw',...
'/home/data/MV0903/raw/os75/mv2009_067_14400.raw',...
'/home/data/MV0903/raw/os75/mv2009_067_21600.raw',...
'/home/data/MV0903/raw/os75/mv2009_067_28800.raw',...
'/home/data/MV0903/raw/os75/mv2009_067_36000.raw',...
'/home/data/MV0903/raw/os75/mv2009_067_43200.raw',...
'/home/data/MV0903/raw/os75/mv2009_067_50400.raw',...
'/home/data/MV0903/raw/os75/mv2009_067_57600.raw',...
'/home/data/MV0903/raw/os75/mv2009_067_64800.raw',...
'/home/data/MV0903/raw/os75/mv2009_067_72000.raw',...
'/home/data/MV0903/raw/os75/mv2009_067_79200.raw',...
'/home/data/MV0903/raw/os75/mv2009_068_00000.raw',...
'/home/data/MV0903/raw/os75/mv2009_068_07200.raw',...
'/home/data/MV0903/raw/os75/mv2009_068_14400.raw',...
'/home/data/MV0903/raw/os75/mv2009_068_21600.raw',...
'/home/data/MV0903/raw/os75/mv2009_068_28800.raw',...
'/home/data/MV0903/raw/os75/mv2009_068_36000.raw',...
'/home/data/MV0903/raw/os75/mv2009_068_43200.raw',...
'/home/data/MV0903/raw/os75/mv2009_068_50400.raw',...
'/home/data/MV0903/raw/os75/mv2009_068_57600.raw',...
'/home/data/MV0903/raw/os75/mv2009_068_64800.raw',...
'/home/data/MV0903/raw/os75/mv2009_068_72000.raw',...
'/home/data/MV0903/raw/os75/mv2009_068_79200.raw',...
'/home/data/MV0903/raw/os75/mv2009_069_00000.raw',...
'/home/data/MV0903/raw/os75/mv2009_069_07200.raw',...
'/home/data/MV0903/raw/os75/mv2009_069_14400.raw',...
'/home/data/MV0903/raw/os75/mv2009_069_21600.raw',...
'/home/data/MV0903/raw/os75/mv2009_069_28800.raw',...
'/home/data/MV0903/raw/os75/mv2009_069_36000.raw',...
'/home/data/MV0903/raw/os75/mv2009_069_43200.raw',...
'/home/data/MV0903/raw/os75/mv2009_069_50400.raw',...
'/home/data/MV0903/raw/os75/mv2009_069_57600.raw',...
'/home/data/MV0903/raw/os75/mv2009_069_64800.raw',...
'/home/data/MV0903/raw/os75/mv2009_069_72000.raw',...
'/home/data/MV0903/raw/os75/mv2009_069_79200.raw',...
'/home/data/MV0903/raw/os75/mv2009_070_00000.raw',...
'/home/data/MV0903/raw/os75/mv2009_070_07200.raw',...
'/home/data/MV0903/raw/os75/mv2009_070_14400.raw',...
'/home/data/MV0903/raw/os75/mv2009_070_21600.raw',...
'/home/data/MV0903/raw/os75/mv2009_070_28800.raw',...
'/home/data/MV0903/raw/os75/mv2009_070_36000.raw',...
'/home/data/MV0903/raw/os75/mv2009_070_43200.raw',...
'/home/data/MV0903/raw/os75/mv2009_070_50400.raw',...
'/home/data/MV0903/raw/os75/mv2009_070_57600.raw',...
'/home/data/MV0903/raw/os75/mv2009_070_64800.raw',...
'/home/data/MV0903/raw/os75/mv2009_070_72000.raw',...
'/home/data/MV0903/raw/os75/mv2009_070_79200.raw',...
'/home/data/MV0903/raw/os75/mv2009_071_00000.raw',...
'/home/data/MV0903/raw/os75/mv2009_071_07200.raw',...
'/home/data/MV0903/raw/os75/mv2009_071_14400.raw',...
'/home/data/MV0903/raw/os75/mv2009_071_21600.raw',...
'/home/data/MV0903/raw/os75/mv2009_071_28800.raw',...
'/home/data/MV0903/raw/os75/mv2009_071_36000.raw',...
'/home/data/MV0903/raw/os75/mv2009_071_43200.raw',...
'/home/data/MV0903/raw/os75/mv2009_071_50400.raw',...
'/home/data/MV0903/raw/os75/mv2009_071_57600.raw',...
'/home/data/MV0903/raw/os75/mv2009_071_64800.raw',...
'/home/data/MV0903/raw/os75/mv2009_071_72000.raw',...
'/home/data/MV0903/raw/os75/mv2009_071_79200.raw',...
'/home/data/MV0903/raw/os75/mv2009_072_00000.raw',...
'/home/data/MV0903/raw/os75/mv2009_072_07200.raw',...
'/home/data/MV0903/raw/os75/mv2009_072_14400.raw',...
'/home/data/MV0903/raw/os75/mv2009_072_21600.raw',...
'/home/data/MV0903/raw/os75/mv2009_072_28800.raw',...
'/home/data/MV0903/raw/os75/mv2009_072_36000.raw',...
'/home/data/MV0903/raw/os75/mv2009_072_43200.raw',...
'/home/data/MV0903/raw/os75/mv2009_072_50400.raw',...
'/home/data/MV0903/raw/os75/mv2009_072_57600.raw',...
'/home/data/MV0903/raw/os75/mv2009_072_64800.raw',...
'/home/data/MV0903/raw/os75/mv2009_072_72000.raw',...
'/home/data/MV0903/raw/os75/mv2009_072_79200.raw',...
'/home/data/MV0903/raw/os75/mv2009_073_00000.raw',...
'/home/data/MV0903/raw/os75/mv2009_073_07200.raw',...
'/home/data/MV0903/raw/os75/mv2009_073_14400.raw',...
'/home/data/MV0903/raw/os75/mv2009_073_21600.raw',...
'/home/data/MV0903/raw/os75/mv2009_073_28800.raw',...
'/home/data/MV0903/raw/os75/mv2009_073_36000.raw',...
'/home/data/MV0903/raw/os75/mv2009_073_43200.raw',...
'/home/data/MV0903/raw/os75/mv2009_073_50400.raw',...
'/home/data/MV0903/raw/os75/mv2009_073_57600.raw',...
'/home/data/MV0903/raw/os75/mv2009_073_64800.raw',...
'/home/data/MV0903/raw/os75/mv2009_073_72000.raw',...
'/home/data/MV0903/raw/os75/mv2009_073_79200.raw',...
'/home/data/MV0903/raw/os75/mv2009_074_00000.raw',...
'/home/data/MV0903/raw/os75/mv2009_074_07200.raw',...
'/home/data/MV0903/raw/os75/mv2009_074_14400.raw',...
'/home/data/MV0903/raw/os75/mv2009_074_21600.raw',...
'/home/data/MV0903/raw/os75/mv2009_074_28800.raw',...
'/home/data/MV0903/raw/os75/mv2009_074_36000.raw',...
'/home/data/MV0903/raw/os75/mv2009_074_43200.raw',...
'/home/data/MV0903/raw/os75/mv2009_074_50400.raw',...
'/home/data/MV0903/raw/os75/mv2009_074_57600.raw',...
'/home/data/MV0903/raw/os75/mv2009_074_64800.raw',...
'/home/data/MV0903/raw/os75/mv2009_074_72000.raw',...
'/home/data/MV0903/raw/os75/mv2009_074_79200.raw',...
'/home/data/MV0903/raw/os75/mv2009_075_00000.raw',...
'/home/data/MV0903/raw/os75/mv2009_075_07200.raw',...
'/home/data/MV0903/raw/os75/mv2009_075_14400.raw',...
'/home/data/MV0903/raw/os75/mv2009_075_21600.raw',...
'/home/data/MV0903/raw/os75/mv2009_075_28800.raw',...
'/home/data/MV0903/raw/os75/mv2009_075_36000.raw',...
'/home/data/MV0903/raw/os75/mv2009_075_43200.raw',...
'/home/data/MV0903/raw/os75/mv2009_075_50400.raw',...
'/home/data/MV0903/raw/os75/mv2009_075_57600.raw',...
'/home/data/MV0903/raw/os75/mv2009_075_64800.raw',...
'/home/data/MV0903/raw/os75/mv2009_075_72000.raw',...
'/home/data/MV0903/raw/os75/mv2009_075_79200.raw',...
'/home/data/MV0903/raw/os75/mv2009_076_00000.raw',...
'/home/data/MV0903/raw/os75/mv2009_076_07200.raw',...
'/home/data/MV0903/raw/os75/mv2009_076_14400.raw',...
'/home/data/MV0903/raw/os75/mv2009_076_21600.raw',...
'/home/data/MV0903/raw/os75/mv2009_076_28800.raw',...
'/home/data/MV0903/raw/os75/mv2009_076_36000.raw',...
'/home/data/MV0903/raw/os75/mv2009_076_43200.raw',...
'/home/data/MV0903/raw/os75/mv2009_076_50400.raw',...
'/home/data/MV0903/raw/os75/mv2009_076_57600.raw',...
'/home/data/MV0903/raw/os75/mv2009_076_64800.raw',...
'/home/data/MV0903/raw/os75/mv2009_076_72000.raw',...
'/home/data/MV0903/raw/os75/mv2009_076_79200.raw',...
'/home/data/MV0903/raw/os75/mv2009_077_00000.raw',...
'/home/data/MV0903/raw/os75/mv2009_077_07200.raw',...
'/home/data/MV0903/raw/os75/mv2009_077_14400.raw',...
'/home/data/MV0903/raw/os75/mv2009_077_21600.raw',...
'/home/data/MV0903/raw/os75/mv2009_077_28800.raw',...
'/home/data/MV0903/raw/os75/mv2009_077_36000.raw',...
'/home/data/MV0903/raw/os75/mv2009_077_43200.raw',...
'/home/data/MV0903/raw/os75/mv2009_077_50400.raw',...
'/home/data/MV0903/raw/os75/mv2009_077_57600.raw',...
'/home/data/MV0903/raw/os75/mv2009_077_64800.raw',...
'/home/data/MV0903/raw/os75/mv2009_077_72000.raw',...
'/home/data/MV0903/raw/os75/mv2009_077_79200.raw',...
'/home/data/MV0903/raw/os75/mv2009_078_00000.raw',...
'/home/data/MV0903/raw/os75/mv2009_078_07200.raw',...
'/home/data/MV0903/raw/os75/mv2009_078_14400.raw',...
'/home/data/MV0903/raw/os75/mv2009_078_21600.raw',...
'/home/data/MV0903/raw/os75/mv2009_078_28800.raw',...
'/home/data/MV0903/raw/os75/mv2009_078_36000.raw',...
'/home/data/MV0903/raw/os75/mv2009_078_43200.raw',...
'/home/data/MV0903/raw/os75/mv2009_078_50400.raw',...
'/home/data/MV0903/raw/os75/mv2009_078_57600.raw',...
'/home/data/MV0903/raw/os75/mv2009_078_64800.raw',...
'/home/data/MV0903/raw/os75/mv2009_078_72000.raw',...
'/home/data/MV0903/raw/os75/mv2009_078_79200.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);


     