function analyze_this(info, dirs)

% read dimensions
d = xb_read_dims;

% read output
xbo = xs_peel(xb_read_output(pwd, 'vars', {'maxzs' 'minzs' 'zb' 'rugau*'}));
pt = xs_peel(xb_read_output(pwd,'vars',{'point_zs','point_xz','point_yz','pointtime','pointtypes'}));
rugid = find(pt.pointtypes);
pointtime = pt.pointtime;

% tuba's values
l       = 20;
g       = 9.81;
ho      = 0.1*(4./pi)*20;
H       = .02*ho;
T       = l/sqrt(g*ho);

% read measurements
load(fullfile(dirs.data, 'etat1.dat'));
load(fullfile(dirs.data, 'etat2.dat'))
load(fullfile(dirs.data, 'etat3.dat'));
load(fullfile(dirs.data, 'etat4.dat'));
load(fullfile(dirs.data, 'etat5.dat'));
load(fullfile(dirs.data, 'etamin.dat'));
load(fullfile(dirs.data, 'etamax.dat'));

t       = 0:0.04:(length(etat1)-1)*0.04;
[i,j]   = max(etat1);
corr    = t(j)/T;

% plot measurements
fh = figure;

subplot(121); hold on;
plot(t/T-corr,etat1/H+20,'r--');
plot(t/T-corr,etat2/H+15,'r--');
plot(t/T-corr,etat3/H+10,'r--');
plot(t/T-corr,etat4/H+5,'r--');
plot(t/T-corr,etat5/H,'r--');

grid on;

meas1_1 = [t/T-corr; etat1'/H]';
meas1_2 = [t/T-corr; etat2'/H]';
meas1_3 = [t/T-corr; etat3'/H]';
meas1_4 = [t/T-corr; etat4'/H]';
meas1_5 = [t/T-corr; etat5'/H]';

subplot(122); hold on;

plot([1:length(etamax)]/length(etamax)*2,etamax/H,'r--')
plot([1:length(etamax)]/length(etamax)*2,etamin/H,'r--')

meas2 = [[1:length(etamax)]/length(etamax)*2;etamax'/H]';

% out values
l       = 8;
g       = 9.81;
ho      = 0.1*(4./pi)*l;
H       = .02*ho;
T       = l/sqrt(g*ho);
[i,j]   = max(pt.point_zs(:,rugid(5)));
corr    = pointtime(j)/T;

subplot(121); hold on;

plot(pointtime/T-corr, pt.point_zs(:,rugid(5))/H+20);
plot(pointtime/T-corr,pt.point_zs(:,rugid(4))/H+15);
plot(pointtime/T-corr, pt.point_zs(:,rugid(3))/H+10);
plot(pointtime/T-corr, pt.point_zs(:,rugid(2))/H+5);
plot(pointtime/T-corr, pt.point_zs(:,rugid(1))/H);

set(gca,'Box','on');

set(gca,'ytick',(-5:5:25))
vi=['-5';' 0';' 0';' 0';' 0';' 0';' 5'];
set(gca,'yticklabel',vi)

set(gca,'xtick',(-5:5:20))
vi=['-5';' 0';' 5';'10';'15';'20'];
set(gca,'xticklabel',vi)

xlabel('t/T');
ylabel('\zeta/H')

comp1_1 = [pointtime/T-corr pt.point_zs(:,rugid(1))/H];
comp1_2 = [pointtime/T-corr pt.point_zs(:,rugid(2))/H];
comp1_3 = [pointtime/T-corr pt.point_zs(:,rugid(3))/H];
comp1_4 = [pointtime/T-corr pt.point_zs(:,rugid(4))/H];
comp1_5 = [pointtime/T-corr pt.point_zs(:,rugid(5))/H];

zsmax = nan(1,d.ny);
zsmin = nan(1,d.ny);
for j=1:d.ny;
  zsmax(j)=xbo.maxzs(end,j,max(find(xbo.maxzs(end,j,:)>xbo.zb(end,j,:)+0.005)));
  zsmin(j)=xbo.minzs(end,j,max(find(xbo.minzs(end,j,:)>xbo.zb(end,j,:)+0.005)));
end

subplot(122); hold on;
plot([1:d.ny]/d.ny*2,zsmax/H)
plot([1:d.ny]/d.ny*2,zsmin/H)

xlabel('y/L_y');
ylabel('\zeta/H');

comp2 = [[1:d.ny]/d.ny*2;zsmax/H]';

% save plot
xb_write_plot(fh, dirs.output, 'fig1');

% error table
errorstats = [Inf Inf Inf Inf; -Inf -Inf -Inf -Inf; 0 0 0 0];

[r2,sci,relbias,bss]=xb_skill(comp1_1,meas1_1,[],'var','rugau001');
errorstats(1,:)=min([errorstats(1,:);r2,sci,relbias,bss]);
errorstats(2,:)=max([errorstats(2,:);r2,sci,relbias,bss]);
[r2,sci,relbias,bss]=xb_skill(comp1_2,meas1_2,[],'var','rugau002');
errorstats(1,:)=min([errorstats(1,:);r2,sci,relbias,bss]);
errorstats(2,:)=max([errorstats(2,:);r2,sci,relbias,bss]);
[r2,sci,relbias,bss]=xb_skill(comp1_3,meas1_3,[],'var','rugau003');
errorstats(1,:)=min([errorstats(1,:);r2,sci,relbias,bss]);
errorstats(2,:)=max([errorstats(2,:);r2,sci,relbias,bss]);
[r2,sci,relbias,bss]=xb_skill(comp1_4,meas1_4,[],'var','rugau004');
errorstats(1,:)=min([errorstats(1,:);r2,sci,relbias,bss]);
errorstats(2,:)=max([errorstats(2,:);r2,sci,relbias,bss]);
[r2,sci,relbias,bss]=xb_skill(comp1_5,meas1_5,[],'var','rugau005');
errorstats(1,:)=min([errorstats(1,:);r2,sci,relbias,bss]);
errorstats(2,:)=max([errorstats(2,:);r2,sci,relbias,bss]);

[r2,sci,relbias,bss]=xb_skill(comp2,meas2,[],'var','maxrunup');
errorstats(3,:)=[r2,sci,relbias,bss];

pname = fullfile(dirs.output, 'tab1.tex');
matrix2latex(errorstats, 'filename', pname, ...
    'rowlabel', {'Timeseries (min)', 'Timeseries (max)', 'Max. runup'}, ...
    'collabel', {'$R^2$','Sci','Rel. bias','BSS'}, ...
    'format', {'%s', '%4.2f', '%4.2f', '%4.2f', '%4.2f'});