% ***********************************************************************
% waterCombinedR.m
% ***********************************************************************
%
% Data description:
% Refractive index (real part) of water (200-2500nm)
% Note that in the original SPLITS this range is runcated at 1100nm, but is otherwise identical.
% Prepared by: Mark Iwanchyshyn on March 2019
%
% ***********************************************************************
%
% Original data sources:
% 
% Lower range (200-395nm):
% 	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) 
%
% 	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
%
%
% Upper range (400-2500nm)
% 	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
lower_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
];
lower_wave = 200:5:395;

upper_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 
1.327 
1.327 
1.327 
1.327 
1.327 
1.327 
1.326 
1.326 
1.326 
1.326 
1.326 
1.326 
1.326 
1.326 
1.326 
1.326 
1.325 
1.325 
1.325 
1.325 
1.325 
1.325 
1.325 
1.325 
1.325 
1.325 
1.325 
1.325 
1.325 
1.325 
1.325 
1.324 
1.324 
1.324 
1.324 
1.324 
1.324 
1.324 
1.324 
1.324 
1.324 
1.324 
1.324 
1.324 
1.323 
1.323 
1.323 
1.323 
1.323 
1.323 
1.323 
1.323 
1.323 
1.323 
1.323 
1.322 
1.322 
1.322 
1.322 
1.322 
1.322 
1.322 
1.322 
1.321 
1.321 
1.321 
1.321 
1.321 
1.321 
1.321 
1.321 
1.321 
1.321 
1.321 
1.321 
1.321 
1.32 
1.32 
1.32 
1.32 
1.32 
1.32 
1.32 
1.32 
1.32 
1.319 
1.319 
1.319 
1.319 
1.319 
1.319 
1.319 
1.319 
1.319 
1.319 
1.318 
1.318 
1.318 
1.318 
1.318 
1.318 
1.318 
1.318 
1.318 
1.318 
1.317 
1.317 
1.317 
1.317 
1.317 
1.316 
1.316 
1.316 
1.316 
1.316 
1.316 
1.315 
1.315 
1.315 
1.315 
1.315 
1.314 
1.314 
1.314 
1.314 
1.314 
1.314 
1.314 
1.314 
1.314 
1.314 
1.314 
1.314 
1.314 
1.314 
1.313 
1.313 
1.313 
1.312 
1.312 
1.312 
1.312 
1.312 
1.312 
1.312 
1.312 
1.312 
1.311 
1.311 
1.311 
1.311 
1.311 
1.311 
1.31 
1.31 
1.31 
1.31 
1.31 
1.31 
1.31 
1.31 
1.31 
1.309 
1.309 
1.309 
1.309 
1.309 
1.308 
1.308 
1.308 
1.307 
1.307 
1.307 
1.307 
1.306 
1.306 
1.306 
1.306 
1.306 
1.306 
1.306 
1.306 
1.306 
1.306 
1.306 
1.305 
1.305 
1.305 
1.305 
1.305 
1.304 
1.304 
1.304 
1.304 
1.303 
1.303 
1.303 
1.303 
1.302 
1.302 
1.302 
1.302 
1.302 
1.301 
1.301 
1.301 
1.301 
1.3 
1.3 
1.3 
1.299 
1.299 
1.298 
1.298 
1.298 
1.297 
1.297 
1.297 
1.296 
1.296 
1.296 
1.295 
1.295 
1.295 
1.294 
1.294 
1.294 
1.294 
1.293 
1.293 
1.293 
1.292 
1.292 
1.291 
1.291 
1.29 
1.29 
1.289 
1.289 
1.288 
1.287 
1.287 
1.286 
1.286 
1.285 
1.285 
1.284 
1.284 
1.283 
1.283 
1.283 
1.282 
1.282 
1.282 
1.281 
1.281 
1.281 
1.28 
1.28 
1.28 
1.279 
1.279 
1.278 
1.278 
1.277 
1.277 
1.276 
1.276 
1.275 
1.275 
1.274 
1.274 
1.273 
1.272 
1.272 
1.271 
1.27 
1.269 
1.269 
1.268 
];
upper_wave = 400:5:2500;

data = [lower_data; upper_data];
wave = [lower_wave, upper_wave];

fid=fopen('sand_waterCombinedR.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',3);
axis([min(wave) max(wave) 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_waterCombinedR.png');
close 
   



