% ***********************************************************************
% water2.m
% ***********************************************************************
%
% Data description:
% refractive index (real part) of water (200-1100nm), 
% 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
%
% ***********************************************************************
%
% 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
%
% ***********************************************************************
%
% graph generate using Matlab 2014
%
% ***********************************************************************

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
1.344743437
1.344276087
1.343826808
1.343394598
1.342978519
1.342577700
1.342191330
1.341818648
1.341458946
1.341111560
1.340775867
1.340451287
1.340137270
1.339833303
1.339538904
1.339253618
1.338977016
1.338708696
1.338448276
1.338195398
1.337949723
1.337710928
1.337478711
1.337252785
1.337032877
1.336818730
1.336610098
1.336406749
1.336208463
1.336015029
1.335826250
1.335641934
1.335461901
1.335285980
1.335114007
1.334945825
1.334781285
1.334620244
1.334462568
1.334308127
1.334156795
1.334008455
1.333862993
1.333720301
1.333580274
1.333442813
1.333307822
1.333175210
1.333044889
1.332916774
1.332790785
1.332666844
1.332544876
1.332424810
1.332306576
1.332190109
1.332075343
1.331962219
1.331850676
1.331740658
1.331632109
1.331524977
1.331419211
1.331314761
1.331211580
1.331109622
1.331008843
1.330909199
1.330810649
1.330713154
1.330616675
1.330521174
1.330426616
1.330332965
1.330240187
1.330148249
1.330057120
1.329966769
1.329877166
1.329788282
1.329700089
1.329612559
1.329525666
1.329439385
1.329353690
1.329268558
1.329183964
1.329099886
1.329016301
1.328933189
1.328850526
1.328768294
1.328686472
1.328605041
1.328523981
1.328443275
1.328362904
1.328282851
1.328203098
1.328123629
1.328044427
1.327965477
1.327886763
1.327808270
1.327729982
1.327651886
1.327573967
1.327496212
1.327418606
1.327341136
1.327263790
1.327186554
1.327109416
1.327032364
1.326955385
1.326878469
1.326801602
1.326724775
1.326647975
1.326571192
1.326494416
1.326417635
1.326340839
1.326264017
1.326187161
1.326110259
1.326033303
1.325956282
1.325879187
1.325802009
1.325724739
1.325647367
1.325569885
1.325492283
1.325414554
1.325336687
1.325258676
1.325180512
1.325102185
1.325023689
1.324945015
];

fid=fopen('riW2.txt','wb');
wave = 200:5:1100;
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 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','water2.png');
close 
   



