function load_link_ci(fname)

fid = fopen(fname);
data = fscanf(fid,'time=%f,link=%d|%d,x=%f,y=%f,thetaDeg=%f,Cxx=%f,Cxy=%f,Cyy=%f,Cxt=%f,Cyt=%f,Ctt=%f ', [12 inf])';
fclose(fid);

[data,order] = sortrows(data,[2 3 1]);

N = size(data,1);

Covs = zeros(3,3,N);
D = zeros(1,N);
T = zeros(1,N);

for i=1:N
    cov = [
        data(i,7) data(i,8) data(i,10);
        data(i,8) data(i,9) data(i,11);
        data(i,10) data(i,11) data(i,12); ];
    Covs(:,:,i) = cov;
    D(i) = det(cov);
    T(i) = det(cov(1:2,1:2));
end


maxlink = max(data(:,3));

k=0;
for a = 0:maxlink-1
    for b = a+1:maxlink
        good = find(data(:,2) == a & data(:,3) == b);
        if (~isempty(good))
            k = k + 1;
            result(k).a = a;
            result(k).b = b;
            result(k).name = sprintf('%d,%d',a,b);
            result(k).tab = data(good,4:6);
            result(k).cab = Covs(:,:,good);
            result(k).det = D(good); 
            result(k).T = T(good);
            result(k).time = data(good,1) - data(1,1);
        end
    end
end


figure(4)
clf
for k = 1:length(result)
    semilogy(result(k).time,result(k).det.^(1/6),'linestyle','-','marker','.');
    hold on
end
hold off
grid on
xlabel('time (sec)')
ylabel('det(\Sigma_{ij})')

return

print -depsc z:/my_papers/atlas_nav/ci_link_convergence.eps