% ***********************************************************************
% sand_waterIOR_2.m
% ***********************************************************************
%
% Data description:
% refractive index (real part) of water (400-1100nm), 
% linearly interpolated from original data (resolution of 5nm) 
%
% Prepared by: Gladimir V. G. Baranoski on November 2008
% Modified by: T. Francis Chen on February 2014
%
% ***********************************************************************
%
% Original data source:
% 
% 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=[
1.346 
1.345 
1.344 
1.343 
1.342 
1.341 
1.34 
1.339 
1.338 
1.338 
1.337 
1.336 
1.336 
1.335 
1.335 
1.334 
1.334 
1.334 
1.334 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.331 
1.331 
1.331 
1.331 
1.331 
1.331 
1.331 
1.331 
1.331 
1.331 
1.331 
1.33 
1.33 
1.33 
1.33 
1.33 
1.33 
1.33 
1.33 
1.33 
1.33 
1.33 
1.33 
1.33 
1.33 
1.329 
1.329 
1.329 
1.329 
1.329 
1.329 
1.329 
1.329 
1.329 
1.329 
1.329 
1.329 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.327 
1.327 
1.327 
1.327 
1.327
];

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


plot(wave,data,'b-','linewidth',3);
axis([400 1100 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_2.png');
close 
   




