% ***********************************************************************
% water_absorption.m
% ***********************************************************************
%
% Data description:
% The absorption coefficient of water in [cm^-1] (380-2500nm), with a
% resolution of 5nm.
%
% Prepared by: Tenn Francis Chen on March 2011
%
% ***********************************************************************
%
% Original data source:
% 
%      380-725 nm
%      R.M. Pope and E.S. Fry,
%      "Absorption spectrum (380-700nm) of pure water. II.
%      Integrating cavity measurements,"
%      Applied Optics, V. 36, N. 33, pp. 8710-8723, November, 1997.
%
%      730-2500 nm
%      K.F. Palmer and D. Williams,
%      "Optical Properties of water in the near infrared,"
%      Journal of the Optical Society of America, V.64, pp. 1107-1110,
%      August, 1974.
%
% ***********************************************************************
clear all
data=[0.000113, 0.000094, 0.000085, 0.000081, 0.000066, 0.000053, 0.000047, 0.000044, 0.000045, 0.000048, 0.000049, 0.000053, 0.000063, 0.000075, 0.000092, 0.000096, 0.000098, 0.000101, 0.000106, 0.000114, 0.000127, 0.000136, 0.000150, 0.000173, 0.000204, 0.000256, 0.000325, 0.000396, 0.000409, 0.000417, 0.000434, 0.000452, 0.000474, 0.000511, 0.000565, 0.000596, 0.000619, 0.000642, 0.000695, 0.000772, 0.000896, 0.001100, 0.001351, 0.001672, 0.002224, 0.002577, 0.002644, 0.002678, 0.002755, 0.002834, 0.002916, 0.003012, 0.003108, 0.003250, 0.003400, 0.003710, 0.004100, 0.004290, 0.004390, 0.004480, 0.004650, 0.004860, 0.005160, 0.005590, 0.006240, 0.00704, 0.00827, 0.01007, 0.01231, 0.01489,0.0186, 0.0238, 0.02548, 0.02716, 0.0279, 0.02765, 0.02682, 0.02586, 0.02492, 0.02405, 0.02317, 0.02238, 0.02162, 0.02088, 0.02025, 0.01963, 0.01927, 0.01933, 0.0199, 0.02409, 0.02828, 0.03193, 0.03475, 0.03757, 0.03952, 0.04089, 0.04225, 0.04436, 0.04696, 0.04956, 0.05253, 0.05575, 0.05897, 0.06266, 0.06707, 0.07147, 0.07759, 0.09053, 0.1035, 0.1164, 0.1363, 0.158, 0.193, 0.238, 0.298, 0.3667, 0.4412, 0.4827, 0.5023, 0.5106, 0.502, 0.4855, 0.469, 0.4425, 0.416, 0.3835, 0.351, 0.318, 0.285, 0.2605, 0.2359, 0.2161, 0.1975, 0.1829, 0.1711, 0.1621, 0.1574, 0.1527, 0.148, 0.1533, 0.1586, 0.1639, 0.1725, 0.1833, 0.1953, 0.212, 0.2287, 0.26, 0.295, 0.3418, 0.4355, 0.5293, 0.6778, 0.8402, 0.985, 1.06, 1.135, 1.188, 1.207, 1.226, 1.236, 1.243, 1.25, 1.25, 1.25, 1.25, 1.24, 1.23, 1.22, 1.203, 1.187, 1.17, 1.15, 1.13, 1.11, 1.098, 1.085, 1.073, 1.085, 1.104, 1.122, 1.167, 1.229, 1.291, 1.359, 1.456, 1.554, 1.651, 1.806, 1.977, 2.148, 2.43, 2.88, 3.33, 3.78, 4.203, 4.618, 5.034, 5.45, 6.418, 7.387, 8.355, 9.781, 13.04, 16.29, 19.55, 22.4, 24.67, 26.93, 29.19, 31.05, 31.3, 31.55, 31.47, 30.9, 30.33, 29.76, 29.19, 28.61, 27.26, 25.72, 24.17, 22.63, 21.15, 19.76, 18.37, 16.99, 15.6, 14.84, 14.08, 13.32, 12.56, 11.91, 11.42, 10.94, 10.45, 9.97, 9.546, 9.21, 8.875, 8.54, 8.204, 7.923, 7.679, 7.435, 7.191, 6.947, 6.744, 6.603, 6.463, 6.323, 6.182, 6.055, 5.98, 5.905, 5.83, 5.755, 5.68, 5.65, 5.65, 5.65, 5.65, 5.65, 5.65, 5.75, 5.85, 5.95, 6.05, 6.15, 6.276, 6.504, 6.732, 6.961, 7.189, 7.417, 7.649, 7.896, 8.143, 8.39, 8.637, 8.884, 9.131, 9.255, 9.349, 9.442, 9.473, 9.46, 9.447, 9.52, 9.72, 9.92, 10.12, 10.32, 10.52, 10.72, 14.8, 21.47, 28.15, 34.82, 41.49, 48.16, 54.83, 62.49, 70.8, 79.11, 87.43, 95.74, 104.1, 112.4, 120.7, 122.7, 120.5, 118.3, 116.1, 113.9, 111.6, 109.4, 104.9, 99.82, 94.71, 89.61, 84.51, 79.41, 74.3, 69.2, 66.25, 63.3, 60.35, 57.4, 54.44, 51.49, 48.54, 45.59, 43.67, 42, 40.33, 38.67, 37, 35.33, 33.67, 32, 30.67, 29.85, 29.03, 28.2, 27.38, 26.56, 25.74, 24.92, 24.09, 23.48, 23.17, 22.86, 22.56, 22.25, 21.94, 21.63, 21.33, 21.02, 20.71, 20.41, 20.1, 19.79, 19.48, 19.4, 19.65, 19.89, 20.14, 20.39, 20.63, 20.88, 21.13, 21.37, 21.62, 21.87, 22.11, 22.36, 22.61, 22.85, 23.24, 23.83, 24.43, 25.02, 25.62, 26.21, 26.8, 27.4, 27.99, 28.59, 29.18, 30.21, 31.35, 32.48, 33.62, 34.75, 35.89, 37.03, 38.16, 39.3, 40.44, 41.57, 43.3, 45.17, 47.04, 48.91, 50.78, 52.65, 54.52, 56.39, 58.26, 60.13, 62, 64.03, 66.67, 69.31, 71.95, 74.59, 77.22, 79.86, 82.5, 85.14, 87.78, 90.42, 93.06, 95.7];

wave = [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, 525, 530, 535, 540, 545, 550, 555, 560, 565, 570, 575, 580, 585, 590, 595, 600, 605, 610, 615, 620, 625, 630, 635, 640, 645, 650, 655, 660, 665, 670, 675, 680, 685, 690, 695, 700, 705, 710, 715, 720, 725, 730, 735, 740, 745, 750, 755, 760, 765, 770, 775, 780, 785, 790, 795, 800, 805, 810, 815, 820, 825, 830, 835, 840, 845, 850, 855, 860, 865, 870, 875, 880, 885, 890, 895, 900, 905, 910, 915, 920, 925, 930, 935, 940, 945, 950, 955, 960, 965, 970, 975, 980, 985, 990, 995, 1000, 1005, 1010, 1015, 1020, 1025, 1030, 1035, 1040, 1045, 1050, 1055, 1060, 1065, 1070, 1075, 1080, 1085, 1090, 1095, 1100, 1105, 1110, 1115, 1120, 1125, 1130, 1135, 1140, 1145, 1150, 1155, 1160, 1165, 1170, 1175, 1180, 1185, 1190, 1195, 1200, 1205, 1210, 1215, 1220, 1225, 1230, 1235, 1240, 1245, 1250, 1255, 1260, 1265, 1270, 1275, 1280, 1285, 1290, 1295, 1300, 1305, 1310, 1315, 1320, 1325, 1330, 1335, 1340, 1345, 1350, 1355, 1360, 1365, 1370, 1375, 1380, 1385, 1390, 1395, 1400, 1405, 1410, 1415, 1420, 1425, 1430, 1435, 1440, 1445, 1450, 1455, 1460, 1465, 1470, 1475, 1480, 1485, 1490, 1495, 1500, 1505, 1510, 1515, 1520, 1525, 1530, 1535, 1540, 1545, 1550, 1555, 1560, 1565, 1570, 1575, 1580, 1585, 1590, 1595, 1600, 1605, 1610, 1615, 1620, 1625, 1630, 1635, 1640, 1645, 1650, 1655, 1660, 1665, 1670, 1675, 1680, 1685, 1690, 1695, 1700, 1705, 1710, 1715, 1720, 1725, 1730, 1735, 1740, 1745, 1750, 1755, 1760, 1765, 1770, 1775, 1780, 1785, 1790, 1795, 1800, 1805, 1810, 1815, 1820, 1825, 1830, 1835, 1840, 1845, 1850, 1855, 1860, 1865, 1870, 1875, 1880, 1885, 1890, 1895, 1900, 1905, 1910, 1915, 1920, 1925, 1930, 1935, 1940, 1945, 1950, 1955, 1960, 1965, 1970, 1975, 1980, 1985, 1990, 1995, 2000, 2005, 2010, 2015, 2020, 2025, 2030, 2035, 2040, 2045, 2050, 2055, 2060, 2065, 2070, 2075, 2080, 2085, 2090, 2095, 2100, 2105, 2110, 2115, 2120, 2125, 2130, 2135, 2140, 2145, 2150, 2155, 2160, 2165, 2170, 2175, 2180, 2185, 2190, 2195, 2200, 2205, 2210, 2215, 2220, 2225, 2230, 2235, 2240, 2245, 2250, 2255, 2260, 2265, 2270, 2275, 2280, 2285, 2290, 2295, 2300, 2305, 2310, 2315, 2320, 2325, 2330, 2335, 2340, 2345, 2350, 2355, 2360, 2365, 2370, 2375, 2380, 2385, 2390, 2395, 2400, 2405, 2410, 2415, 2420, 2425, 2430, 2435, 2440, 2445, 2450, 2455, 2460, 2465, 2470, 2475, 2480, 2485, 2490, 2495, 2500];

fid=fopen('water_absorption.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('water','fontsize',14)
ylabel('absorption coefficient (cm^{-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','water_absorption.png');
close 
   



