% ***********************************************************************
% pheomelanin_extinction.m
% ***********************************************************************
%
% Data description:
% The extinction coefficient of pheomelanin in [cm^-1, mg/ml^1]
% (215-825nm), 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=[47.193, 46.140, 44.738, 43.161, 41.586, 40.183, 38.608, 37.204, 35.803, 34.576, 34.224, 33.170, 31.765, 30.711, 29.831, 28.599, 27.545, 26.490, 25.437, 23.856, 22.273, 20.516, 18.760, 17.179, 15.947, 14.361, 12.952, 11.890, 10.478, 9.5940, 8.3590, 7.4720, 6.0540, 4.9880, 3.9190, 3.0240, 1.5890, 1.7560, 1.3850, 1.1870, 0.9930, 0.7970, 0.6050, 0.4050, 0.5620, 0.3740, 0.3610, 0.1700, 0.1630];

wave0 = [213.54, 217.92, 222.25, 226.55, 228.59, 232.91, 234.95, 241.54, 243.61, 247.96, 250.18, 256.82, 263.41, 270.05, 276.71, 285.60, 292.24, 298.88, 303.26, 312.08, 323.18, 334.25, 343.05, 351.88, 360.76, 376.38, 387.50, 403.20, 418.85, 430.04, 443.45, 459.17, 481.61, 501.83, 524.32, 549.09, 591.91, 600.98, 625.84, 652.98, 675.59, 700.47, 720.81, 750.22, 770.62, 786.44, 802.28, 820.37, 829.42];

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

fid=fopen('pheomelanin_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('pheomelanin','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','pheomelanin_extinction.png');
close 
   



