% Compare counts with zscat (a la Fig 3(b) in manuscript)
% WHS

% Zscat -------------------------------------------------------------------
zscat = load('beads_dec04\zsc_diw_122004_3.LOG');
zscat_s = std(zscat);
zscat = load('beads_dec04\zsc_diw_122104_1.asc')';

% 2um BEADS ---------------------------------------------------------------
beads_2um = load('beads_dec04\beads_2u_7.log');
% transmission
rr = zscat(33)/zscat(36);
tau_2um = beads_2um(:,33)./rr./beads_2um(:,36);
% beads corrected for tau
beads_2um(:,1:32) = beads_2um(:,1:32)./repmat(tau_2um,1,32);

% 100um BEADS -------------------------------------------------------------
beads_100um = load('beads_dec04\beads_100u_7.log');
% transmission
rr = zscat(33)/zscat(36);
tau_100um = beads_100um(:,33)./rr./beads_100um(:,36);
% beads corrected for tau
beads_100um(:,1:32) = beads_100um(:,1:32)./repmat(tau_100um,1,32);



set(0, 'DefaultLineLineWidth', 0.75)
set(0, 'DefaultLineMarkerSize', 10)
set(0, 'DefaultAxesLineWidth', 0.75)
set(0, 'DefaultTextFontSize', 8)
set(0, 'DefaultAxesFontSize', 8)
set(0, 'DefaultTextHorizontalAlignment', 'center')
set(0, 'DefaultAxesBox', 'on')

figure, hold on	
set(gcf, 'paperunits', 'inches', 'papersize', [3.1 3.1])
set(gcf, 'paperpositionmode', 'manual', 'paperposition', [0.05 0.05 3.0 3.0])

hl1 = plot(zscat(1:32),'k.-')
plot(repmat(zscat(1:32)+3.*zscat_s(1:32),2,1)','k--')
plot(repmat(zscat(1:32)-3.*zscat_s(1:32),2,1)','k--')
		
hl2 = plot(mean(beads_2um(:,1:32))','b.-')
plot(prctile(beads_2um(:,1:32),95),'b--')
plot(prctile(beads_2um(:,1:32),5),'b--')
		
hl3 = plot(mean(beads_100um(:,1:32))','r.-')
plot(prctile(beads_100um(:,1:32),95),'r--')
plot(prctile(beads_100um(:,1:32),5),'r--')
		
set(gca, 'yscale','log', 'ylim', [3 2000])
set(gca, 'xgrid','on', 'xlim',[0 33], 'xtick',[10 20 30])

text(16,20, 'zscat')
text(6,800, '100\mum (100g)')
text(24,900, '2\mum (2g)')

xlabel('Detector ring, i')
ylabel('cscat_i [counts]')

%print(gcf, '-depsc', 'fig-lisstcounts')





