% ***********************************************************************
% uro_acid_abs.m
% ***********************************************************************
%
% Data description:
%
% Ultraviolet absorptance [%] (205-325nm) of 15 umole/L of urocanic acid over a distance of 1 cm, 
% with a resolution of 5nm
%
% ***********************************************************************
%
% Original data source:
%
%     A. R. Young. 1997. Chromophores in human skin. Phys. Med. Biol. 42, 5,
%     789.
%
% Note that the original source provides absorbance data. The data below
% has been converted to absorptance.
% 
% ***********************************************************************

clear all

data0=[0.1038,0.1117,0.1150,0.1162,0.1184,0.1207,0.1195,0.1263,0.1624,0.2188,0.2650,0.2831,0.2853,0.2820,0.2470,0.2030,0.1534,0.1060,0.0620,0.0305,0.0124,0.0023,0];

wave0 = [200.4808,204.8077,208.1731,209.1346,214.9038,221.6346,230.7692,236.5385,244.2308,251.9231,258.1731,262.9808,265.3846,268.2692,275.0000,280.2885,285.0962,290.8654,298.0769,305.2885,312.0192,321.1538,327.4038];

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

fid=fopen('uro_acid_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('urocanic acid','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','uro_acid_abs.png');
close 
