%Lamp at 4.75V 1.671I
%TEC/fan supply @ 12.75V, 0.544A
%Hi Gain, Int7400, readout, 600, delay 1.2us, Rate 500KHz
%7500 ref, sample, 2400 dark
%Array temp 25C, RT = 74.7F
d=load('Dark_2024_09_03_13_33_18.csv');
%Reference is manually pressed PTFE, 2 layers, ~0.215%", 0.112" and 0.093"
r=load('ref_2024_09_03_13_38_39.csv');
%Sample is manually pressed PTFE + Glucose (~10% glucose by wt), ~0.112"
%reference and sample set directly on Illumination probe surface, pick up
%probe set so peak signal is 4.0V.
s=load('ref_and_glu_2024_09_03_13_32_54.csv');
sm=mean(s(:,10:265));%signal starts at px 10
rm=mean(r(:,9:264));%signal starts at px 9
dm=mean(d(:,10:265));%signal starts at px 10
gvector = -log10((sm-dm)./(rm-dm));
%protowave = l=11.7764/4*x+1228.8955-(11.7764/4*55.19);
fig(2,1)=figure('WindowState','maximized');
set(fig(2,1),'PaperPosition',[.25 .25 10.5 8],'PaperOrientation','landscape','PaperSize',[11 8.5])
plot(protowave(1:256),gvector,'LineWidth',2)
set(fig(2,1).CurrentAxes,'XGrid','on','YGrid','on','GridAlpha',.3,'FontSize',18);
xlabel('Wavelength (nm)');ylabel('Absorbance (au)');title('CoraLuma Prototype G-Vector: Glucose in PTFE (10%glucose by wt), Lo Gain')

%save gvector 