function [sum_Edf,dist_E] = buoyDist(day)
    switch day
        case 'march2'
            fn = '../../waveData/xy029p101_201903020000-201903032359'; %Day of visit
        case 'march1'
            fn = '../../waveData/xy029p101_201903010000-201903022359'; %Day before
        otherwise
            disp('hey dumby that is not an option. I dont know how to spell but you dont know how to type.');
            return;
    end
    [r,stepError] = readBuoyFile(fn);
    fs = 1.28;
    N30 = 30*60*fs;
    Ns = size(r,1);     % number of smaples.
    Ng = floor(Ns/N30); % number of 30 minute groups of samples.
    Nfft = 128;         % the rest assumes N30/Nfft is an integer.
    Ne = N30/Nfft;      % number of FFT's in a 30 minute ensamble. 
    eta = reshape(r(1:Ng*N30,3)/100,Nfft,Ne,Ng);
    eta = eta - mean(eta,1);
    error = sum(reshape(stepError(1:Ng*N30),N30,Ng));
    
    mean_eta2   = squeeze(mean(mean(eta.^2)));
    
    dist_E = NaN(Nfft/2,Ng);
    
    df = fs/Nfft;
    for ng = 1:Ng
        if error(ng)==0
            H = fft(squeeze(eta(:,:,ng)));
            dist_E(:,ng) = (2/(Nfft*fs))*mean(abs(H((1:Nfft/2)+1,:)).^2,2);
        end
    end 
    sum_Edf = sum(dist_E)*df;
    
    figure(1)
    surf(10*log10(dist_E))
    
    figure(3)
    ng = 1:Ng;
    plot(ng,sum_Edf, 'o',ng, mean_eta2)
    legend({'$\sum E\Delta f$','$\langle\eta^2\rangle$'},'interpreter','latex')
    graphToPDF('varDensity.pdf',4,2) 
end