% ***********************************************************************
% water_sac_380_725.m
% ***********************************************************************
%
% Data description:
% The absorption coefficient of water in [cm^-1] (380-725nm), with a
% resolution of 5nm.
%
% Prepared by: Tenn Francis Chen on March 2011
% Modified by: Petri Varsa on June 2020
%
% ***********************************************************************
%
% 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.
%
% ***********************************************************************
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];

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];

fid=fopen('sacWVIS.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_sac_380_725.png');
close 
   



