//plot summary of forFilter results
d=fscanfMat("collected.txt");
p = unique(d(:,1));
ch = unique(d(:,3));
nP = size(p,1);
nCh = size(d,1) / nP;

t = matrix(d(:,2), nCh, nP);
t = t(1,:)';
w = matrix(d(:,4), nCh, nP);

clf;
for i=1:nP; //pulse
	for j=1:2; //filter
		for k=1:4; //thing
			a=d(d(:,1) == p(i),(j*4)+k);
			subplot(2,2,k);
			plot2d(ch, a, i);
			if j==2;
				ax=gca();
				ax.children(1).children(1).line_style = 2;
			end;
		end;
	end;
end;

lgnd = [];
for i=1:nP; //pulse
	for j=1:2; //filter
		lgnd = [lgnd; string(p(i)) + " filter " + string(j+1)+"A"];
	end;
end;
subplot(2,2,3);
legend(lgnd);

f=gcf();
f.children(:).y_label.text = "Percentage Intensity";
f.children(:).x_label.text = "Channel (0=outboard edge)";
f.children(4).title.text = "PC of transmitted light, that is lin. pol. full EC sigma";
f.children(3).title.text = "PC of transmitted light, that is other lin. pol.";
f.children(2).title.text = "PC of transmitted light, that is unpolarised";
f.children(1).title.text = "PC of lin. pol. full EC sigma transmitted.";

xs2svg(0,"/work/ipp/pres/aug/forFilters/summary.svg");

