

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

        
            % begin "matcfgstr" string, created by run_lastensq.py
            instclass = os;
            instname  = 'os75';
            pingtype  = 'nb';
            proc_yearbase  = 2009;
            yearbase  = 2009;
            cfg =get_uhdascfg('cfgbase'  , 'at15_42',...
                              'cfgpath'  , '/home/data/at15_42/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 = 'phins';              % this should be obsolete, but here for constistency
        % this is what is used. see get_rbinheading.m :
           %%====> quick_adcp.py overrriding:
 cfg.hcorr_args = {'phins', 'hdg'};

        % 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/at15_42/raw/os75/at2009_008_58461.raw',...
'/home/data/at15_42/raw/os75/at2009_008_64800.raw',...
'/home/data/at15_42/raw/os75/at2009_008_72000.raw',...
'/home/data/at15_42/raw/os75/at2009_008_79200.raw',...
'/home/data/at15_42/raw/os75/at2009_009_00000.raw',...
'/home/data/at15_42/raw/os75/at2009_009_07200.raw',...
'/home/data/at15_42/raw/os75/at2009_009_14400.raw',...
'/home/data/at15_42/raw/os75/at2009_009_21600.raw',...
'/home/data/at15_42/raw/os75/at2009_009_28800.raw',...
'/home/data/at15_42/raw/os75/at2009_009_36000.raw',...
'/home/data/at15_42/raw/os75/at2009_009_43200.raw',...
'/home/data/at15_42/raw/os75/at2009_009_50400.raw',...
'/home/data/at15_42/raw/os75/at2009_009_57600.raw',...
'/home/data/at15_42/raw/os75/at2009_010_51103.raw',...
'/home/data/at15_42/raw/os75/at2009_010_57600.raw',...
'/home/data/at15_42/raw/os75/at2009_010_64800.raw',...
'/home/data/at15_42/raw/os75/at2009_010_72000.raw',...
'/home/data/at15_42/raw/os75/at2009_010_79200.raw',...
'/home/data/at15_42/raw/os75/at2009_011_00000.raw',...
'/home/data/at15_42/raw/os75/at2009_011_07200.raw',...
'/home/data/at15_42/raw/os75/at2009_011_14400.raw',...
'/home/data/at15_42/raw/os75/at2009_011_21600.raw',...
'/home/data/at15_42/raw/os75/at2009_011_28800.raw',...
'/home/data/at15_42/raw/os75/at2009_011_36000.raw',...
'/home/data/at15_42/raw/os75/at2009_011_43200.raw',...
'/home/data/at15_42/raw/os75/at2009_011_50400.raw',...
'/home/data/at15_42/raw/os75/at2009_011_57600.raw',...
'/home/data/at15_42/raw/os75/at2009_011_64800.raw',...
'/home/data/at15_42/raw/os75/at2009_011_72000.raw',...
'/home/data/at15_42/raw/os75/at2009_011_79200.raw',...
'/home/data/at15_42/raw/os75/at2009_012_00000.raw',...
'/home/data/at15_42/raw/os75/at2009_012_07200.raw',...
'/home/data/at15_42/raw/os75/at2009_012_14400.raw',...
'/home/data/at15_42/raw/os75/at2009_012_21600.raw',...
'/home/data/at15_42/raw/os75/at2009_012_28800.raw',...
'/home/data/at15_42/raw/os75/at2009_012_36000.raw',...
'/home/data/at15_42/raw/os75/at2009_012_43200.raw',...
'/home/data/at15_42/raw/os75/at2009_012_50400.raw',...
'/home/data/at15_42/raw/os75/at2009_012_57600.raw',...
'/home/data/at15_42/raw/os75/at2009_012_64800.raw',...
'/home/data/at15_42/raw/os75/at2009_012_72000.raw',...
'/home/data/at15_42/raw/os75/at2009_012_79200.raw',...
'/home/data/at15_42/raw/os75/at2009_013_00000.raw',...
'/home/data/at15_42/raw/os75/at2009_013_07200.raw',...
'/home/data/at15_42/raw/os75/at2009_013_14400.raw',...
'/home/data/at15_42/raw/os75/at2009_013_21600.raw',...
'/home/data/at15_42/raw/os75/at2009_013_28800.raw',...
'/home/data/at15_42/raw/os75/at2009_013_36000.raw',...
'/home/data/at15_42/raw/os75/at2009_013_43200.raw',...
'/home/data/at15_42/raw/os75/at2009_013_50400.raw',...
'/home/data/at15_42/raw/os75/at2009_013_57600.raw',...
'/home/data/at15_42/raw/os75/at2009_013_64800.raw',...
'/home/data/at15_42/raw/os75/at2009_013_72000.raw',...
'/home/data/at15_42/raw/os75/at2009_013_79200.raw',...
'/home/data/at15_42/raw/os75/at2009_014_00000.raw',...
'/home/data/at15_42/raw/os75/at2009_014_07200.raw',...
'/home/data/at15_42/raw/os75/at2009_014_14400.raw',...
'/home/data/at15_42/raw/os75/at2009_014_21600.raw',...
'/home/data/at15_42/raw/os75/at2009_014_28800.raw',...
'/home/data/at15_42/raw/os75/at2009_014_36000.raw',...
'/home/data/at15_42/raw/os75/at2009_014_43200.raw',...
'/home/data/at15_42/raw/os75/at2009_014_50400.raw',...
'/home/data/at15_42/raw/os75/at2009_014_57600.raw',...
'/home/data/at15_42/raw/os75/at2009_014_64800.raw',...
'/home/data/at15_42/raw/os75/at2009_014_72000.raw',...
'/home/data/at15_42/raw/os75/at2009_014_79200.raw',...
'/home/data/at15_42/raw/os75/at2009_015_00000.raw',...
'/home/data/at15_42/raw/os75/at2009_015_07200.raw',...
'/home/data/at15_42/raw/os75/at2009_015_14400.raw',...
'/home/data/at15_42/raw/os75/at2009_015_21600.raw',...
'/home/data/at15_42/raw/os75/at2009_015_28800.raw',...
'/home/data/at15_42/raw/os75/at2009_015_36000.raw',...
'/home/data/at15_42/raw/os75/at2009_015_43200.raw',...
'/home/data/at15_42/raw/os75/at2009_015_50400.raw',...
'/home/data/at15_42/raw/os75/at2009_015_57600.raw',...
'/home/data/at15_42/raw/os75/at2009_015_64800.raw',...
'/home/data/at15_42/raw/os75/at2009_015_72000.raw',...
'/home/data/at15_42/raw/os75/at2009_015_79200.raw',...
'/home/data/at15_42/raw/os75/at2009_016_00000.raw',...
'/home/data/at15_42/raw/os75/at2009_016_07200.raw',...
'/home/data/at15_42/raw/os75/at2009_016_14400.raw',...
'/home/data/at15_42/raw/os75/at2009_016_21600.raw',...
'/home/data/at15_42/raw/os75/at2009_016_28800.raw',...
'/home/data/at15_42/raw/os75/at2009_016_36000.raw',...
'/home/data/at15_42/raw/os75/at2009_016_43545.raw',...
'/home/data/at15_42/raw/os75/at2009_016_50400.raw',...
'/home/data/at15_42/raw/os75/at2009_016_57600.raw',...
'/home/data/at15_42/raw/os75/at2009_016_64800.raw',...
'/home/data/at15_42/raw/os75/at2009_016_72000.raw',...
'/home/data/at15_42/raw/os75/at2009_016_79200.raw',...
'/home/data/at15_42/raw/os75/at2009_017_00000.raw',...
'/home/data/at15_42/raw/os75/at2009_017_07200.raw',...
'/home/data/at15_42/raw/os75/at2009_017_14400.raw',...
'/home/data/at15_42/raw/os75/at2009_017_21600.raw',...
'/home/data/at15_42/raw/os75/at2009_017_28800.raw',...
'/home/data/at15_42/raw/os75/at2009_017_36000.raw',...
'/home/data/at15_42/raw/os75/at2009_017_43200.raw',...
'/home/data/at15_42/raw/os75/at2009_017_50400.raw',...
'/home/data/at15_42/raw/os75/at2009_017_57600.raw',...
'/home/data/at15_42/raw/os75/at2009_017_64800.raw',...
'/home/data/at15_42/raw/os75/at2009_017_72000.raw',...
'/home/data/at15_42/raw/os75/at2009_017_79200.raw',...
'/home/data/at15_42/raw/os75/at2009_018_00000.raw',...
'/home/data/at15_42/raw/os75/at2009_018_07200.raw',...
'/home/data/at15_42/raw/os75/at2009_018_14400.raw',...
'/home/data/at15_42/raw/os75/at2009_018_21600.raw',...
'/home/data/at15_42/raw/os75/at2009_018_28800.raw',...
'/home/data/at15_42/raw/os75/at2009_018_36000.raw',...
'/home/data/at15_42/raw/os75/at2009_018_43200.raw',...
'/home/data/at15_42/raw/os75/at2009_018_50400.raw',...
'/home/data/at15_42/raw/os75/at2009_018_57600.raw',...
'/home/data/at15_42/raw/os75/at2009_018_64800.raw',...
'/home/data/at15_42/raw/os75/at2009_018_72000.raw',...
'/home/data/at15_42/raw/os75/at2009_018_79200.raw',...
'/home/data/at15_42/raw/os75/at2009_019_00000.raw',...
'/home/data/at15_42/raw/os75/at2009_019_07200.raw',...
'/home/data/at15_42/raw/os75/at2009_019_14400.raw',...
'/home/data/at15_42/raw/os75/at2009_019_21600.raw',...
'/home/data/at15_42/raw/os75/at2009_019_28800.raw',...
'/home/data/at15_42/raw/os75/at2009_019_36000.raw',...
'/home/data/at15_42/raw/os75/at2009_019_43200.raw',...
'/home/data/at15_42/raw/os75/at2009_019_50400.raw',...
'/home/data/at15_42/raw/os75/at2009_019_57600.raw',...
'/home/data/at15_42/raw/os75/at2009_019_64800.raw',...
'/home/data/at15_42/raw/os75/at2009_019_72000.raw',...
'/home/data/at15_42/raw/os75/at2009_019_79200.raw',...
'/home/data/at15_42/raw/os75/at2009_020_00000.raw',...
'/home/data/at15_42/raw/os75/at2009_020_07200.raw',...
'/home/data/at15_42/raw/os75/at2009_020_14400.raw',...
'/home/data/at15_42/raw/os75/at2009_020_21600.raw',...
'/home/data/at15_42/raw/os75/at2009_020_28800.raw',...
'/home/data/at15_42/raw/os75/at2009_020_36000.raw',...
'/home/data/at15_42/raw/os75/at2009_020_43200.raw',...
'/home/data/at15_42/raw/os75/at2009_020_50400.raw',...
'/home/data/at15_42/raw/os75/at2009_020_57600.raw',...
'/home/data/at15_42/raw/os75/at2009_020_64800.raw',...
'/home/data/at15_42/raw/os75/at2009_020_72000.raw',...
'/home/data/at15_42/raw/os75/at2009_020_79200.raw',...
'/home/data/at15_42/raw/os75/at2009_021_00000.raw',...
'/home/data/at15_42/raw/os75/at2009_021_07200.raw',...
'/home/data/at15_42/raw/os75/at2009_021_14400.raw',...
'/home/data/at15_42/raw/os75/at2009_021_21600.raw',...
'/home/data/at15_42/raw/os75/at2009_021_28800.raw',...
'/home/data/at15_42/raw/os75/at2009_021_36000.raw',...
'/home/data/at15_42/raw/os75/at2009_021_43200.raw',...
'/home/data/at15_42/raw/os75/at2009_021_50400.raw',...
'/home/data/at15_42/raw/os75/at2009_021_57600.raw',...
'/home/data/at15_42/raw/os75/at2009_021_64800.raw',...
'/home/data/at15_42/raw/os75/at2009_021_72000.raw',...
'/home/data/at15_42/raw/os75/at2009_021_79200.raw',...
'/home/data/at15_42/raw/os75/at2009_022_00000.raw',...
'/home/data/at15_42/raw/os75/at2009_022_07200.raw',...
'/home/data/at15_42/raw/os75/at2009_022_14400.raw',...
'/home/data/at15_42/raw/os75/at2009_022_21600.raw',...
'/home/data/at15_42/raw/os75/at2009_022_28800.raw',...
'/home/data/at15_42/raw/os75/at2009_022_36000.raw',...
'/home/data/at15_42/raw/os75/at2009_022_43200.raw',...
'/home/data/at15_42/raw/os75/at2009_022_50400.raw',...
'/home/data/at15_42/raw/os75/at2009_022_57600.raw',...
'/home/data/at15_42/raw/os75/at2009_022_64800.raw',...
'/home/data/at15_42/raw/os75/at2009_022_72000.raw',...
'/home/data/at15_42/raw/os75/at2009_022_79200.raw',...
'/home/data/at15_42/raw/os75/at2009_023_00000.raw',...
'/home/data/at15_42/raw/os75/at2009_023_07200.raw',...
'/home/data/at15_42/raw/os75/at2009_023_14400.raw',...
'/home/data/at15_42/raw/os75/at2009_023_21600.raw',...
'/home/data/at15_42/raw/os75/at2009_023_28800.raw',...
'/home/data/at15_42/raw/os75/at2009_023_36000.raw',...
'/home/data/at15_42/raw/os75/at2009_023_43200.raw',...
'/home/data/at15_42/raw/os75/at2009_023_50400.raw',...
'/home/data/at15_42/raw/os75/at2009_023_57600.raw',...
'/home/data/at15_42/raw/os75/at2009_023_64800.raw',...
'/home/data/at15_42/raw/os75/at2009_023_72000.raw',...
'/home/data/at15_42/raw/os75/at2009_023_79200.raw',...
'/home/data/at15_42/raw/os75/at2009_024_00000.raw',...
'/home/data/at15_42/raw/os75/at2009_024_07200.raw',...
'/home/data/at15_42/raw/os75/at2009_024_14400.raw',...
'/home/data/at15_42/raw/os75/at2009_024_21600.raw',...
'/home/data/at15_42/raw/os75/at2009_024_28800.raw',...
'/home/data/at15_42/raw/os75/at2009_024_36000.raw',...
'/home/data/at15_42/raw/os75/at2009_024_43200.raw',...
'/home/data/at15_42/raw/os75/at2009_024_50400.raw',...
'/home/data/at15_42/raw/os75/at2009_024_57600.raw',...
'/home/data/at15_42/raw/os75/at2009_024_64800.raw',...
'/home/data/at15_42/raw/os75/at2009_024_72000.raw',...
'/home/data/at15_42/raw/os75/at2009_024_79200.raw',...
'/home/data/at15_42/raw/os75/at2009_025_00000.raw',...
'/home/data/at15_42/raw/os75/at2009_025_07200.raw',...
'/home/data/at15_42/raw/os75/at2009_025_14400.raw',...
'/home/data/at15_42/raw/os75/at2009_025_21600.raw',...
'/home/data/at15_42/raw/os75/at2009_025_28800.raw',...
'/home/data/at15_42/raw/os75/at2009_025_36000.raw',...
'/home/data/at15_42/raw/os75/at2009_025_43200.raw',...
'/home/data/at15_42/raw/os75/at2009_025_50400.raw',...
'/home/data/at15_42/raw/os75/at2009_025_57600.raw',...
'/home/data/at15_42/raw/os75/at2009_025_64800.raw',...
'/home/data/at15_42/raw/os75/at2009_025_72000.raw',...
'/home/data/at15_42/raw/os75/at2009_025_79200.raw',...
'/home/data/at15_42/raw/os75/at2009_026_00000.raw',...
'/home/data/at15_42/raw/os75/at2009_026_07200.raw',...
'/home/data/at15_42/raw/os75/at2009_026_14400.raw',...
'/home/data/at15_42/raw/os75/at2009_026_21600.raw',...
'/home/data/at15_42/raw/os75/at2009_026_28800.raw',...
'/home/data/at15_42/raw/os75/at2009_026_36000.raw',...
'/home/data/at15_42/raw/os75/at2009_026_43200.raw',...
'/home/data/at15_42/raw/os75/at2009_026_50400.raw',...
'/home/data/at15_42/raw/os75/at2009_026_57600.raw',...
'/home/data/at15_42/raw/os75/at2009_026_64800.raw',...
'/home/data/at15_42/raw/os75/at2009_026_72000.raw',...
'/home/data/at15_42/raw/os75/at2009_026_79200.raw',...
'/home/data/at15_42/raw/os75/at2009_027_00000.raw',...
'/home/data/at15_42/raw/os75/at2009_027_07200.raw',...
'/home/data/at15_42/raw/os75/at2009_027_14400.raw',...
'/home/data/at15_42/raw/os75/at2009_027_21600.raw',...
'/home/data/at15_42/raw/os75/at2009_027_28800.raw',...
'/home/data/at15_42/raw/os75/at2009_027_36000.raw',...
'/home/data/at15_42/raw/os75/at2009_027_43200.raw',...
'/home/data/at15_42/raw/os75/at2009_027_50400.raw',...
'/home/data/at15_42/raw/os75/at2009_027_57600.raw',...
'/home/data/at15_42/raw/os75/at2009_027_64800.raw',...
'/home/data/at15_42/raw/os75/at2009_027_72000.raw',...
'/home/data/at15_42/raw/os75/at2009_027_79200.raw',...
'/home/data/at15_42/raw/os75/at2009_028_00000.raw',...
'/home/data/at15_42/raw/os75/at2009_028_07200.raw',...
'/home/data/at15_42/raw/os75/at2009_028_14400.raw',...
'/home/data/at15_42/raw/os75/at2009_028_21600.raw',...
'/home/data/at15_42/raw/os75/at2009_028_28800.raw',...
'/home/data/at15_42/raw/os75/at2009_028_36000.raw',...
'/home/data/at15_42/raw/os75/at2009_028_43200.raw',...
'/home/data/at15_42/raw/os75/at2009_028_50400.raw',...
'/home/data/at15_42/raw/os75/at2009_028_57600.raw',...
'/home/data/at15_42/raw/os75/at2009_028_64800.raw',...
'/home/data/at15_42/raw/os75/at2009_028_72000.raw',...
'/home/data/at15_42/raw/os75/at2009_028_79200.raw',...
'/home/data/at15_42/raw/os75/at2009_029_00000.raw',...
'/home/data/at15_42/raw/os75/at2009_029_07200.raw',...
'/home/data/at15_42/raw/os75/at2009_029_14400.raw',...
'/home/data/at15_42/raw/os75/at2009_029_21600.raw',...
'/home/data/at15_42/raw/os75/at2009_029_28800.raw',...
'/home/data/at15_42/raw/os75/at2009_029_36000.raw',...
'/home/data/at15_42/raw/os75/at2009_029_43200.raw',...
'/home/data/at15_42/raw/os75/at2009_029_50400.raw',...
'/home/data/at15_42/raw/os75/at2009_029_57600.raw',...
'/home/data/at15_42/raw/os75/at2009_029_64800.raw',...
'/home/data/at15_42/raw/os75/at2009_029_72000.raw',...
'/home/data/at15_42/raw/os75/at2009_029_79200.raw',...
'/home/data/at15_42/raw/os75/at2009_030_00000.raw',...
'/home/data/at15_42/raw/os75/at2009_030_07200.raw',...
'/home/data/at15_42/raw/os75/at2009_030_14400.raw',...
'/home/data/at15_42/raw/os75/at2009_030_21600.raw',...
'/home/data/at15_42/raw/os75/at2009_030_28800.raw',...
'/home/data/at15_42/raw/os75/at2009_030_36000.raw',...
'/home/data/at15_42/raw/os75/at2009_030_43200.raw',...
'/home/data/at15_42/raw/os75/at2009_030_50400.raw',...
'/home/data/at15_42/raw/os75/at2009_030_57600.raw',...
'/home/data/at15_42/raw/os75/at2009_030_64800.raw',...
'/home/data/at15_42/raw/os75/at2009_030_72000.raw',...
'/home/data/at15_42/raw/os75/at2009_030_79200.raw',...
'/home/data/at15_42/raw/os75/at2009_031_00000.raw',...
'/home/data/at15_42/raw/os75/at2009_031_07200.raw',...
'/home/data/at15_42/raw/os75/at2009_031_14400.raw',...
'/home/data/at15_42/raw/os75/at2009_031_21600.raw',...
'/home/data/at15_42/raw/os75/at2009_031_28800.raw',...
'/home/data/at15_42/raw/os75/at2009_031_36000.raw',...
'/home/data/at15_42/raw/os75/at2009_031_43200.raw',...
'/home/data/at15_42/raw/os75/at2009_031_50400.raw',...
'/home/data/at15_42/raw/os75/at2009_031_57600.raw',...
'/home/data/at15_42/raw/os75/at2009_031_64800.raw',...
'/home/data/at15_42/raw/os75/at2009_031_72000.raw',...
'/home/data/at15_42/raw/os75/at2009_031_79200.raw',...
'/home/data/at15_42/raw/os75/at2009_032_00000.raw',...
'/home/data/at15_42/raw/os75/at2009_032_07200.raw',...
'/home/data/at15_42/raw/os75/at2009_032_14400.raw',...
'/home/data/at15_42/raw/os75/at2009_032_21600.raw',...
'/home/data/at15_42/raw/os75/at2009_032_28800.raw',...
'/home/data/at15_42/raw/os75/at2009_032_36000.raw',...
'/home/data/at15_42/raw/os75/at2009_032_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);


     