% ***********************************************************************
% eumelanin_extinction.m
% ***********************************************************************
%
% Data description:
% The extinction coefficient of lutein in [cm^-1, mg/ml^1] (380-520nm),
% with a resolution of 5nm.
%
% Prepared by: Boris Kravchenko on June 2016
%
% ***********************************************************************
%
% Original data source:
%      F.P. Zscheile, J.W. White, B.W. Beadle, and J.R. Roach, The preparation
%      and absorption spectra of five pure carotenoid pigments, Plant Physiology 17
%      (1942), no. 3, 331-346.
% 
% ***********************************************************************

clear all
data0=[42.0,51.0,67.0,80.0,90.0,103.0,120.0,150.0,175.0,175.0,172.0,195.0,235.0,254.0,242.0,220.0,190.0,190.0,200.0,230.0,225.0,178.0,100.0,60.0,30.0,15.0,8.0,5.0,3.0];

wave0 = [380, 385, 390, 395, 400, 405, 410, 415, 420, 425, 430, 435, 440, 445, 450, 455, 460, 465, 470, 475, 480, 485, 490, 495, 500, 505, 510, 515, 520];

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

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


plot(wave,data,'b-','linewidth',1.5);
set(gca,'FontSize', 14);
grid on
title('lutein','fontsize',14)
ylabel('extinction coefficient (cm^{-1}(mg/ml)^{-1})','fontsize',14);
xlabel('wavelength (nm)','fontsize',14);
xlim([min(wave),max(wave)]);
set(gcf,'PaperUnits','inches','PaperPosition',[0 0 6 5]);


print('-dpng', '-r100','lutein_extinction.png');
close 
   



