% ***********************************************************************
% sand_waterIOR_1.m
% ***********************************************************************
%
% Data description:
% refractive index (real part) of water (200-395nm), 
% calculated from formula from 
% The International Association for the Properties of Water and Steam
% (resolution of 5nm) 
%
% Prepared by: Tenn Francis Chen on December 2010, modified February 2014
%
% ***********************************************************************
%
% Original data source:
% 
% Release on the Refractive Index of Ordinary Water Substance as a Function
% of Wavelength, Temperature and Pressure, The International Association
% for the Properties of Water and Steam (IAPWS), Erlangen, Germany, 
% September 1997 (7 pages).
%
% temperature: 0 degrees C
% pressure   : 1 MPa
% density    : 1000.300697 kg m^-3
%
% ***********************************************************************
clear all
data=[
1.425650742
1.418060336
1.411462308
1.405672321
1.400549678
1.395985005
1.391891913
1.388201198
1.384856725
1.381812446
1.379030212
1.376478125
1.374129297
1.371960891
1.369953382
1.368089966
1.366356101
1.364739136
1.363228008
1.361813001
1.360485544
1.359238047
1.358063763
1.356956674
1.355911397
1.354923098
1.353987426
1.353100453
1.352258627
1.351458722
1.350697809
1.349973215
1.349282501
1.348623437
1.347993976
1.347392240
1.346816500
1.346265165
1.345736765
1.345229941
];

fid=fopen('sand_waterIOR_1.txt','wb');
wave = 200:5:395;
for i=1:length(wave)
    fprintf(fid,'%d  %3.4g \n',wave(i),data(i));
end
fclose(fid);


plot(wave,data,'b-','linewidth',3);
axis([200 395 1.2 1.5]);
set(gca,'FontSize', 14);
grid on
title('Water','fontsize',14)
ylabel('refractive index','fontsize',14);
xlabel('wavelength (nm)','fontsize',14);
set(gcf,'PaperUnits','inches','PaperPosition',[0 0 6 5]);
pause
print('-dpng', '-r100','sand_waterIOR_1.png');
close 
   



