% ***********************************************************************
% eumelanin_extinction.m
% ***********************************************************************
%
% Data description:
% The extinction coefficient of eumelanin in [cm^-1, mg/ml^1] (210-820nm),
% with a resolution of 5nm.
%
% Prepared by: Tenn Francis Chen on March 2011
%
% ***********************************************************************
%
% Original data source:
%      T. Sarna, HM Swartz, The physical properties of melanins, in "The
%      Pigmentary System", ed. JJ Nordlund et al., Oxford University Press,
%      1988
% 
%      Published by Oregon Medical Laser Center
%      http://omlc.ogi.edu/spectra/melanin/extcoeff.html
%
% ***********************************************************************
clear all
data0=[41.900, 40.667, 39.082, 37.145, 35.383, 33.445, 31.507, 29.392, 27.277, 25.338, 23.575, 22.517, 20.578, 18.639, 16.523, 13.878, 11.938, 10.173, 8.9370, 6.9950, 5.7580, 4.5200, 3.9880, 3.2800, 2.7460, 2.2140, 2.0340, 1.8540, 1.6750, 1.4960, 1.4940];

wave0 = [209.99, 212.21, 218.91, 223.36, 230.06, 239.00, 245.70, 261.38, 279.30, 294.99, 312.92, 324.13, 342.06, 357.75, 382.42, 407.07, 431.74, 458.67, 483.36, 523.76, 550.70, 588.87, 615.82, 642.77, 680.96, 712.41, 734.88, 764.09, 782.06, 804.53, 820.26];

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

fid=fopen('eumelanin_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('eumelanin','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]);

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



