% lookskin1.m
% loads spectrum --> nm, skin, std, R
%
% M = (S T G D)/(S Tstd Gstd D) 
%   = T/Tstd*G/Gstd = T * constant

figure(1); clf
set(figure(1),'position',[31    42   580   755],'color','w')
sz = 18;

dinm = 3;

%%%%% Fig 1.1
subplot(2,1,1)
name = 'skin1';
Mskin = getSpectrum(name);
nm = Mskin(:,1);
skin = Mskin(:,2);
i=1; while nm(i)<400; i=i+1; end; i400 = i;
while nm(i)<900; i=i+1; end; i900 = i;
base = mean(skin(10:100));
skin = skin - base;
plot(nm, skin,'r-','linewidth',2)
hold on
%
name = 'std1';
Mstd = getSpectrum(name);
std = Mstd(:,2)*3;
base = mean(std(10:100));
std = std - base;
plot(nm, std,'b-','linewidth',2)
set(gca,'fontsize',sz,'linewidth',2)
xlabel('wavelength [nm]')
ylabel('M')
text(600,650,'Measurements','fontsize',sz)
axis([400 900 -100 700])
legend('skin','std',1)


%%%%% Fig 1.2
subplot(2,1,2)
Rstd = 0.60;
R = skin./std*Rstd;
plot(nm, R,'r-','linewidth',2)
set(gca,'fontsize',sz,'linewidth',2)
xlabel('wavelength [nm]')
ylabel('T = M T_s_t_d/GG')
text(600, 0.9,'Reflectance','fontsize',sz)
axis([400 900 0 1])

