%AnalyseMCPeeling01point 
%To analyse the fibre prob collection data from a mandarin mua=0.01, point laser source

%note has the shifting bug see p105 of lab book
[G1.m00,G1.d00] = ExamineDMC2('MC bigmac 3400000 02-Feb-2001 1020.dmc');
[G1.m15,G1.d15] = ExamineDMC2('MC bigmac 3411500 02-Feb-2001 0912.dmc');
[G1.m47,G1.d47] = ExamineDMC2('MC bigmac 3414700 08-Feb-2001 0306.dmc');
[G1.m90,G1.d90] = ExamineDMC2('MC imago 419000 08-Feb-2001 0650.dmc');

scale = 1000;
x = [.25:.5:49.75]; %0.5mm blocks placed in the center of each over a 50mm model (100 cells)
figure
hold on
title('Point source 0.01 absorbance First set');
plot(x,G1.d00.CFibreiso(1:100)*scale,'b-')
plot(x,G1.d15.CFibreiso(1:100)*scale,'r--')
plot(x,G1.d47.CFibreiso(1:100)*scale,'k-.')
plot(x,G1.d90.CFibreiso(1:100)*scale,'g:')

plot(x,G1.d00.CFibre(1:100)*scale,'b-')
plot(x,G1.d15.CFibre(1:100)*scale,'r--')
plot(x,G1.d47.CFibre(1:100)*scale,'k-.')
plot(x,G1.d90.CFibre(1:100)*scale,'g:')
set(gca,'YScale','log')
set(gca,'YLim', [1,10^7]);

%second set note has the shifting bug  see p105 of lab book and use ver 2 of ExamineDMC
[G2.m00,G2.d00] = ExamineDMC2('MC bigmac 3400000 18-Feb-2001 1658.dmc');
[G2.m15,G2.d15] = ExamineDMC2('MC bigmac 3411500 24-Feb-2001 1138.dmc');
[G2.m47,G2.d47] = ExamineDMC2('MC bigmac 3414700 24-Feb-2001 0630.dmc');
[G2.m90,G2.d90] = ExamineDMC2('MC bigmac 3419000 02-Mar-2001 0034.dmc');
scale = 1000;
x = [.25:.5:49.75]; %0.5mm blocks placed in the center of each over a 50mm model (100 cells)
figure
hold on
title('Point source 0.01 absorbance Second set');
plot(x,G2.d00.CFibreiso(1:100)*scale,'b-')
plot(x,G2.d15.CFibreiso(1:100)*scale,'r--')
plot(x,G2.d47.CFibreiso(1:100)*scale,'k-.')
plot(x,G2.d90.CFibreiso(1:100)*scale,'g:')

plot(x,G2.d00.CFibre(1:100)*scale,'b-')
plot(x,G2.d15.CFibre(1:100)*scale,'r--')
plot(x,G2.d47.CFibre(1:100)*scale,'k-.')
plot(x,G2.d90.CFibre(1:100)*scale,'g:')
set(gca,'YScale','log')
set(gca,'YLim', [1,10^7]);

%third set the bug was corrected for these.
[G3.m00,G3.d00] = ExamineDMC('MC bigmac 3400000 15-Mar-2001 1628.dmc');
[G3.m15,G3.d15] = ExamineDMC('MC bigmac 3411500 15-Mar-2001 1508.dmc');
[G3.m47,G3.d47] = ExamineDMC('MC bigmac 3414700 25-Mar-2001 1059.dmc');
[G3.m90,G3.d90] = ExamineDMC('MC bigmac 3419000 24-Mar-2001 2335.dmc');
scale = 1000;
x = [.25:.5:49.75]; %0.5mm blocks placed in the center of each over a 50mm model (100 cells)
figure
hold on
title('Point source 0.01 absorbance Third set');
plot(x,G3.d00.CFibreiso(1:100)*scale,'b-')
plot(x,G3.d15.CFibreiso(1:100)*scale,'r--')
plot(x,G3.d47.CFibreiso(1:100)*scale,'k-.')
plot(x,G3.d90.CFibreiso(1:100)*scale,'g:')

plot(x,G3.d00.CFibre(1:100)*scale,'b-')
plot(x,G3.d15.CFibre(1:100)*scale,'r--')
plot(x,G3.d47.CFibre(1:100)*scale,'k-.')
plot(x,G3.d90.CFibre(1:100)*scale,'g:')
set(gca,'YScale','log')
set(gca,'YLim', [1,10^7]);

%now lets combine them to reduce the noise

Combined.A00CFibre =G1.d00.CFibre+G2.d00.CFibre+G3.d00.CFibre;
Combined.A15CFibre =G1.d15.CFibre+G2.d15.CFibre+G3.d15.CFibre;
Combined.A47CFibre =G1.d47.CFibre+G2.d47.CFibre+G3.d47.CFibre;
Combined.A90CFibre =G1.d90.CFibre+G2.d90.CFibre+G3.d90.CFibre;
Combined.A00CFibreiso =G1.d00.CFibreiso+G2.d00.CFibreiso+G3.d00.CFibreiso;
Combined.A15CFibreiso =G1.d15.CFibreiso+G2.d15.CFibreiso+G3.d15.CFibreiso;
Combined.A47CFibreiso =G1.d47.CFibreiso+G2.d47.CFibreiso+G3.d47.CFibreiso;
Combined.A90CFibreiso =G1.d90.CFibreiso+G2.d90.CFibreiso+G3.d90.CFibreiso;
scale = 184; %to make the isofibre start at 1*10^6
figure
hold on
title('Point source 0.01 absorbance Combined Sets');
plot(x,Combined.A00CFibre(1:100)*scale,'k-')
plot(x,Combined.A15CFibre(1:100)*scale,'k--')
plot(x,Combined.A47CFibre(1:100)*scale,'k-.')
plot(x,Combined.A90CFibre(1:100)*scale,'k:')

plot(x,Combined.A00CFibreiso(1:100)*scale,'k-')
plot(x,Combined.A15CFibreiso(1:100)*scale,'k--')
plot(x,Combined.A47CFibreiso(1:100)*scale,'k-.')
plot(x,Combined.A90CFibreiso(1:100)*scale,'k:')
set(gca,'YScale','log')
set(gca,'YLim', [1,10^6]);

%lets look at the ratio of the 34deg probe to the omni-directional probe
figure
hold on;
title('Ration of the 34deg. probe to the omni-directional probe');
plot(x,Combined.A00CFibre(1:100)./Combined.A00CFibreiso(1:100));
plot(x,Combined.A15CFibre(1:100)./Combined.A15CFibreiso(1:100));
plot(x,Combined.A47CFibre(1:100)./Combined.A47CFibreiso(1:100));
plot(x,Combined.A90CFibre(1:100)./Combined.A90CFibreiso(1:100));

%same as but, put them all on a set of subplots
figure
subplot(2,2,1)
hold on;
hold on;
title('Ratio of the 34deg. probe to the omni-directional probe');
plot(x,Combined.A00CFibre(1:100)./Combined.A00CFibreiso(1:100));
plot(x,Combined.A15CFibre(1:100)./Combined.A15CFibreiso(1:100));
plot(x,Combined.A47CFibre(1:100)./Combined.A47CFibreiso(1:100));
plot(x,Combined.A90CFibre(1:100)./Combined.A90CFibreiso(1:100))

subplot(2,2,2)
hold on
title('Ratio of the 34deg. probe to the omni-directional probe Semi-log');
plot(x,Combined.A00CFibre(1:100)./Combined.A00CFibreiso(1:100));
plot(x,Combined.A15CFibre(1:100)./Combined.A15CFibreiso(1:100));
plot(x,Combined.A47CFibre(1:100)./Combined.A47CFibreiso(1:100));
plot(x,Combined.A90CFibre(1:100)./Combined.A90CFibreiso(1:100));
semi;

subplot(2,2,3)
hold on;
title('Ratio of the omni-directional probe to the 34deg. probe');
plot(x,Combined.A00CFibreiso(1:100)./Combined.A00CFibre(1:100));
plot(x,Combined.A15CFibreiso(1:100)./Combined.A15CFibre(1:100));
plot(x,Combined.A47CFibreiso(1:100)./Combined.A47CFibre(1:100));
plot(x,Combined.A90CFibreiso(1:100)./Combined.A90CFibre(1:100));

subplot(2,2,4)
hold on;
title('Ratio of the omni-directional probe to the 34deg. probe Semi-log');
plot(x,Combined.A00CFibreiso(1:100)./Combined.A00CFibre(1:100));
plot(x,Combined.A15CFibreiso(1:100)./Combined.A15CFibre(1:100));
plot(x,Combined.A47CFibreiso(1:100)./Combined.A47CFibre(1:100));
plot(x,Combined.A90CFibreiso(1:100)./Combined.A90CFibre(1:100));
semi;