function analyze_this_T5_8(info, dirs)

% read measurements
Murl        = 'http://opendap.deltares.nl/thredds/dodsC/opendap/deltares/deltaflume2006_dune_erosion/';
NCFileName  = [Murl info.run '.nc'];
x           = nc_varget(NCFileName,'cross_shore_profile');
zb          = nc_varget(NCFileName,'altitude');
t           = nc_varget(NCFileName,'time_profile');

% filter out everything after 6 hrs
t       = t(t<=6*3600)/3600;
zb      = zb(t<=6*3600,:);

% read dimensions
d       = xb_read_dims;
[m i]   = closest(1000+t*3600, d.t);

% read input
xbi     = xb_read_input(pwd);
zs0     = max([0 xs_get(xbi,'zs0') max(xs_get(xbi,'zs0file.tide'))]);

% read output
xbo1    = xb_read_output(pwd, 'vars', {'zb'}, 'index', i-1);
xbo2    = xb_read_output(pwd, 'vars', {'zb'});
xbo3    = xb_read_output(pwd, 'vars', {'zs' 'zb' 'H' 'u' 'ue' 'urms' 'hh_var'});

% analyze output
xbb     = xb_get_morpho(xbo2, 'level', zs0);

[sed, A] = xb_get_sedero(x,zb);

% plot output
xb_plot_profile(xbo1, ...
    'measured', [x zb']);

xb_write_plot(gcf, dirs.output, 'profiles');

id = find(strcmp({xbb.data.name}, 'ero'),1); % find which row contains 'ero'
xbb.data(id).value = abs(xbb.data(id).value); %take abs of erosion - seems to solve problem with pictures, quick & dirty fix

xb_plot_morpho(xbb, ...
    'dz', [x zb(end,:)'-zb(1,:)'], ...
    'ero', [t A']);

xb_write_plot(gcf, dirs.output, 'morpho');

% remove all but the first and last outputs
for iv = 2:length(xbo1.data)
    if length(size(xbo1.data(iv).value)) == 3
        xbo1.data(iv).value = xbo1.data(iv).value([1 end],:,:);
    end
end

xb_plot_profile(xbo1,'measured',[x zb(end,:)'])
title(['profiles ' info.test ' ' info.run], 'interpreter', 'none')
xb_write_plot(gcf, dirs.output, 'final_profiles')