% ***********************************************************************
% keratin_abs.m
% ***********************************************************************
%
% Data description:
% Ultraviolet absorptance [%] (245-420nm) of solid keratin over a distance of 4 um,
% with a resolution of 5nm
%
% ***********************************************************************
%
% Original data source:
%      E. G. Bendit and D. Ross. 1961. A technique for obtaining the ultra-violet
%      absorption spectrum of solid keratin. Appl. Spectroscopy 15, 4, 103–105
%
% Note that the original source provides absorbance data. The data below
% is converted to absorptance.
% ***********************************************************************

clear all

data0=[0.8020, 0.6217, 0.4651, 0.4366, 0.4414, 0.4603, 0.4864, 0.5102, 0.5125, 0.4603, 0.3583, 0.2254, 0.1519, 0.0807, 0.0451, 0.0190, 0.0024,0];

wave0 = [240.9249, 244.6243, 249.7110, 254.3353, 259.4220, 264.5087, 269.1329, 274.2197, 279.3064, 284.3931, 289.4798, 294.5665, 299.6532, 309.8266, 329.7110, 365.3179, 420.8092, 421];

wave = ceil(wave0(1)/5)*5:5:floor(wave0(end));
data = interp1(wave0,data0,wave);

fid=fopen('keratin_abs.txt','wb');
for i=1:length(wave)
    fprintf(fid,'%d  %3.4g \n',wave(i),data(i));
end
fclose(fid);


plot(wave,(1-10.^-data)*100,'b-','linewidth',1.5);
set(gca,'FontSize',14);
grid on
title('keratin','fontsize',14)
ylabel('absorptance (%)','fontsize',14);
xlabel('wavelength (nm)','fontsize',14);
set(gcf,'PaperUnits','inches','PaperPosition',[0 0 6 5]);
xlim([min(wave),max(wave)]);
pause
print('-dpng', '-r100','keratin_abs.png');
close 
