

        % create  a text file with statistics from the ping_headcor correction
        % call it from load, read hcorr.asc (post_headcorr) or ens_hcorr.asc
        %


         %% no diary written %% 
        
            set(0,'defaultfigureposition',[0 0 1 1])
            set(0,'defaultfiguremenubar','none')
            set(0,'defaultfiguretoolbar','none')
            

        yearbase = 2007;

        comment = 'heading from ashtech applied to ensembles';

        hcorfile = 'ens_hcorr.asc';
        hcorr_inst = 'ashtech';

        if exist(hcorfile)
           print_hcorstats('yearbase', yearbase,...
                           'stats_ddrange', 1,...
                           'hcorfile', hcorfile,...
                           'comment', comment,...
                           'outfile', 'hcorr_stats.txt');
        else
          fid = fopen('hcorr_stats.txt', 'w');
          fprintf(fid, 'no heading correction applied \n')
          fclose(fid)
        end

     