% ***********************************************************************
% deoxy_hemoglobin_extinction.m
% ***********************************************************************
%
% Data description:
% The extinction coefficient of deoxy-hemoglobin in [cm^-1/(mol/L)]
% (250-1000nm), with a resolution of 5nm.
%
% Prepared by: Tenn Francis Chen on March 2011
%
% ***********************************************************************
%
% Original data source:
%      Compiled by Scott Prahl using data from
%      * W. B. Gratzer, Med. Res. Council Labs, Holly Hill, London
%      * N. Kollias, Wellman Laboratories, Harvard Medical School, Boston
% 
%      Published by Oregon Medical Laser Center
%      http://omlc.ogi.edu/spectra/hemoglobin/index.html
%
% ***********************************************************************
clear all
data0=[112736, 112736, 112736, 113824, 115040, 116296, 117564, 118876, 120208, 121544, 122880, 123096, 121952, 120808, 119840, 118872, 117628, 114820, 112008, 107140, 98364, 91636, 85820, 77100, 69444, 64440, 61300, 58828, 56908, 57620, 59156, 62248, 65344, 68312, 71208, 74508, 78284, 82060, 85592, 88516, 90856, 93192, 95532, 99792, 104476, 108472, 110996, 113524, 116052, 118752, 122092, 125436, 128776, 132120, 133632, 134940, 136044, 136972, 137900, 138856, 139968, 141084, 142196, 143312, 144424, 145232, 145232, 148668, 153908, 159544, 167780, 180004, 191540, 202124, 212712, 223296, 236188, 253368, 270548, 287356, 303956, 321344, 342596, 363848, 385680, 407560, 429880, 461200, 481840, 500840, 528600, 552160, 552160, 547040, 501560, 413280, 363240, 282724, 237224, 173320, 103292, 62640, 36170, 30698.8, 25886.4, 23388.8, 20891.2, 19260.8, 18142.4, 17025.6, 16156.4, 15310, 15048.4, 14792.8, 14657.2, 14550, 14881.2, 15212.4, 15543.6, 15898, 16684, 17469.6, 18255.6, 19041.2, 19891.2, 20862, 21832.8, 22803.6, 23774.4, 24745.2, 25773.6, 26936.8, 28100, 29263.2, 30426.4, 31589.6, 32851.2, 34397.6, 35944, 37490, 39036.4, 40584, 42088, 43592, 45092, 46592, 48148, 49708, 51268, 52496, 53412, 54080, 54520, 54540, 54164, 53788, 52276, 50572, 48828, 46948, 45072, 43340, 41716, 40092, 38467.6, 37020, 35676.4, 34332.8, 32851.6, 31075.2, 28324.4, 25470, 22574.8, 19800, 17058.4, 14677.2, 13622.4, 12567.6, 11513.2, 10477.6, 9443.6, 8591.2, 7762, 7344.8, 6927.2, 6509.6, 6193.2, 5906.8, 5620, 5366.8, 5148.8, 4930.8, 4730.8, 4602.4, 4473.6, 4345.2, 4216.8, 4088.4, 3965.08, 3857.6, 3750.12, 3642.64, 3535.16, 3427.68, 3320.2, 3226.56, 3140.28, 3053.96, 2967.68, 2881.4, 2795.12, 2708.84, 2627.64, 2554.4, 2481.16, 2407.92, 2334.68, 2261.48, 2188.24, 2115, 2051.96, 2000.48, 1949.04, 1897.56, 1846.08, 1794.28, 1741, 1687.76, 1634.48, 1583.52, 1540.48, 1497.4, 1454.36, 1411.32, 1368.28, 1325.88, 1285.16, 1244.44, 1203.68, 1152.8, 1102.2, 1102.2, 1102.2, 1101.76, 1100.48, 1115.88, 1161.64, 1207.4, 1266.04, 1333.24, 1405.24, 1515.32, 1541.76, 1560.48, 1560.48, 1548.52, 1508.44, 1459.56, 1410.52, 1361.32, 1311.88, 1262.44, 1213, 1163.56, 1114.8, 1075.44, 1036.08, 996.72, 957.36, 921.8, 890.8, 859.8, 828.8, 802.96, 782.36, 761.72, 743.84, 737.08, 730.28, 723.52, 717.08, 711.84, 706.6, 701.32, 696.08, 693.76, 693.6, 693.48, 693.32, 693.2, 693.04, 692.92, 692.76, 692.64, 692.48, 692.36, 692.2, 691.96, 691.76, 691.52, 691.32, 691.08, 690.88, 690.64, 692.44, 694.32, 696.2, 698.04, 699.92, 701.8, 705.84, 709.96, 714.08, 718.2, 722.32, 726.44, 729.84, 733.2, 736.6, 739.96, 743.6, 747.24, 750.88, 754.52, 758.16, 761.84, 765.04, 767.44, 769.8, 772.16, 774.56, 776.92, 778.4, 778.04, 777.72, 777.36, 777.04, 776.64, 772.36, 768.08, 763.84, 752.28, 737.56, 722.88, 708.16, 693.44, 678.72, 660.52, 641.08, 621.64, 602.24, 583.4, 568.92, 554.48, 540.04, 525.56, 511.12, 495.36, 473.32, 451.32, 429.32, 415.28, 402.28, 389.288, 374.944, 359.656, 344.372, 329.084, 313.796, 298.508, 283.22, 267.932, 252.648, 237.36, 222.072, 206.784];

wave0 = [250, 252, 254, 256, 258, 260, 262, 264, 266, 268, 270, 272, 274, 276, 278, 280, 282, 284, 286, 288, 290, 292, 294, 296, 298, 300, 302, 304, 306, 308, 310, 312, 314, 316, 318, 320, 322, 324, 326, 328, 330, 332, 334, 336, 338, 340, 342, 344, 346, 348, 350, 352, 354, 356, 358, 360, 362, 364, 366, 368, 370, 372, 374, 376, 378, 380, 382, 384, 386, 388, 390, 392, 394, 396, 398, 400, 402, 404, 406, 408, 410, 412, 414, 416, 418, 420, 422, 424, 426, 428, 430, 432, 434, 436, 438, 440, 442, 444, 446, 448, 450, 452, 454, 456, 458, 460, 462, 464, 466, 468, 470, 472, 474, 476, 478, 480, 482, 484, 486, 488, 490, 492, 494, 496, 498, 500, 502, 504, 506, 508, 510, 512, 514, 516, 518, 520, 522, 524, 526, 528, 530, 532, 534, 536, 538, 540, 542, 544, 546, 548, 550, 552, 554, 556, 558, 560, 562, 564, 566, 568, 570, 572, 574, 576, 578, 580, 582, 584, 586, 588, 590, 592, 594, 596, 598, 600, 602, 604, 606, 608, 610, 612, 614, 616, 618, 620, 622, 624, 626, 628, 630, 632, 634, 636, 638, 640, 642, 644, 646, 648, 650, 652, 654, 656, 658, 660, 662, 664, 666, 668, 670, 672, 674, 676, 678, 680, 682, 684, 686, 688, 690, 692, 694, 696, 698, 700, 702, 704, 706, 708, 710, 712, 714, 716, 718, 720, 722, 724, 726, 728, 730, 732, 734, 736, 738, 740, 742, 744, 746, 748, 750, 752, 754, 756, 758, 760, 762, 764, 766, 768, 770, 772, 774, 776, 778, 780, 782, 784, 786, 788, 790, 792, 794, 796, 798, 800, 802, 804, 806, 808, 810, 812, 814, 816, 818, 820, 822, 824, 826, 828, 830, 832, 834, 836, 838, 840, 842, 844, 846, 848, 850, 852, 854, 856, 858, 860, 862, 864, 866, 868, 870, 872, 874, 876, 878, 880, 882, 884, 886, 888, 890, 892, 894, 896, 898, 900, 902, 904, 906, 908, 910, 912, 914, 916, 918, 920, 922, 924, 926, 928, 930, 932, 934, 936, 938, 940, 942, 944, 946, 948, 950, 952, 954, 956, 958, 960, 962, 964, 966, 968, 970, 972, 974, 976, 978, 980, 982, 984, 986, 988, 990, 992, 994, 996, 998, 1000];

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

fid=fopen('deoxy_hemoglobin_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('deoxy-hemoglobin','fontsize',14)
ylabel('molar extinction coefficient (cm^{-1}/(mol/L))','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','deoxy_hemoglobin_extinction.png');
close 
   



