% ******************************************************************************
% ice_n.m
% ******************************************************************************
%
% Data Description:
% refractive index (real part) of ice (200-2500nm),
% linearly interpolated from original data (resolution of 5nm)
%
% Prepared by: Petri Varsa on November, 2016
%
% ******************************************************************************
%
% Original data source:
%
% Stephen G. Warren and Richard E. Brandt, Optical constants of ice from the
% ultraviolet to the microwave: A revised compilation
% Journal of Geophysical Research: Atmospheres, Vol. 113, Issue D14, July 2008
%
% ******************************************************************************
clear all;
data = [
1.392850e+00
1.386273e+00
1.380100e+00
1.376450e+00
1.372800e+00
1.369150e+00
1.365500e+00
1.361850e+00
1.358200e+00
1.354550e+00
1.350900e+00
1.349200e+00
1.347500e+00
1.345800e+00
1.344100e+00
1.342400e+00
1.340700e+00
1.339000e+00
1.337300e+00
1.335600e+00
1.333900e+00
1.333000e+00
1.332100e+00
1.331200e+00
1.330300e+00
1.329400e+00
1.328500e+00
1.327600e+00
1.326700e+00
1.325800e+00
1.324900e+00
1.324325e+00
1.323750e+00
1.323175e+00
1.322600e+00
1.322025e+00
1.321450e+00
1.320875e+00
1.320300e+00
1.319850e+00
1.319400e+00
1.318950e+00
1.318500e+00
1.318100e+00
1.317700e+00
1.317350e+00
1.317000e+00
1.316650e+00
1.316300e+00
1.316000e+00
1.315700e+00
1.315400e+00
1.315100e+00
1.314800e+00
1.314500e+00
1.314250e+00
1.314000e+00
1.313750e+00
1.313500e+00
1.313250e+00
1.313000e+00
1.312800e+00
1.312600e+00
1.312350e+00
1.312100e+00
1.311900e+00
1.311700e+00
1.311550e+00
1.311400e+00
1.311200e+00
1.311000e+00
1.310800e+00
1.310600e+00
1.310450e+00
1.310300e+00
1.310150e+00
1.310000e+00
1.309850e+00
1.309700e+00
1.309550e+00
1.309400e+00
1.309250e+00
1.309100e+00
1.308950e+00
1.308800e+00
1.308650e+00
1.308500e+00
1.308400e+00
1.308300e+00
1.308150e+00
1.308000e+00
1.307900e+00
1.307800e+00
1.307700e+00
1.307600e+00
1.307450e+00
1.307300e+00
1.307200e+00
1.307100e+00
1.307000e+00
1.306900e+00
1.306800e+00
1.306700e+00
1.306600e+00
1.306500e+00
1.306350e+00
1.306200e+00
1.306100e+00
1.306000e+00
1.305950e+00
1.305900e+00
1.305800e+00
1.305700e+00
1.305600e+00
1.305500e+00
1.305400e+00
1.305300e+00
1.305200e+00
1.305100e+00
1.305000e+00
1.304900e+00
1.304800e+00
1.304700e+00
1.304650e+00
1.304600e+00
1.304500e+00
1.304400e+00
1.304300e+00
1.304200e+00
1.304100e+00
1.304000e+00
1.303950e+00
1.303900e+00
1.303800e+00
1.303700e+00
1.303600e+00
1.303500e+00
1.303400e+00
1.303300e+00
1.303250e+00
1.303200e+00
1.303100e+00
1.303000e+00
1.302900e+00
1.302800e+00
1.302750e+00
1.302700e+00
1.302600e+00
1.302500e+00
1.302400e+00
1.302300e+00
1.302250e+00
1.302200e+00
1.302100e+00
1.302000e+00
1.301950e+00
1.301900e+00
1.301800e+00
1.301700e+00
1.301600e+00
1.301500e+00
1.301450e+00
1.301400e+00
1.301300e+00
1.301200e+00
1.301100e+00
1.301000e+00
1.300950e+00
1.300900e+00
1.300800e+00
1.300700e+00
1.300600e+00
1.300500e+00
1.300400e+00
1.300300e+00
1.300250e+00
1.300200e+00
1.300100e+00
1.300000e+00
1.299900e+00
1.299800e+00
1.299750e+00
1.299700e+00
1.299600e+00
1.299500e+00
1.299400e+00
1.299300e+00
1.299200e+00
1.299100e+00
1.299050e+00
1.299000e+00
1.298900e+00
1.298800e+00
1.298700e+00
1.298600e+00
1.298500e+00
1.298400e+00
1.298300e+00
1.298200e+00
1.298100e+00
1.298000e+00
1.297950e+00
1.297900e+00
1.297800e+00
1.297700e+00
1.297600e+00
1.297500e+00
1.297400e+00
1.297300e+00
1.297200e+00
1.297100e+00
1.297000e+00
1.296900e+00
1.296800e+00
1.296700e+00
1.296600e+00
1.296500e+00
1.296400e+00
1.296300e+00
1.296200e+00
1.296100e+00
1.296000e+00
1.295900e+00
1.295800e+00
1.295700e+00
1.295600e+00
1.295500e+00
1.295400e+00
1.295300e+00
1.295200e+00
1.295100e+00
1.295000e+00
1.294900e+00
1.294750e+00
1.294600e+00
1.294500e+00
1.294400e+00
1.294250e+00
1.294100e+00
1.294000e+00
1.293900e+00
1.293800e+00
1.293700e+00
1.293550e+00
1.293400e+00
1.293250e+00
1.293100e+00
1.293000e+00
1.292900e+00
1.292789e+00
1.292673e+00
1.292536e+00
1.292400e+00
1.292264e+00
1.292127e+00
1.292060e+00
1.292010e+00
1.291933e+00
1.291850e+00
1.291764e+00
1.291673e+00
1.291582e+00
1.291491e+00
1.291400e+00
1.291317e+00
1.291233e+00
1.291118e+00
1.290982e+00
1.290852e+00
1.290732e+00
1.290612e+00
1.290492e+00
1.290372e+00
1.290250e+00
1.290125e+00
1.290000e+00
1.289875e+00
1.289750e+00
1.289619e+00
1.289485e+00
1.289350e+00
1.289215e+00
1.289081e+00
1.288941e+00
1.288792e+00
1.288643e+00
1.288495e+00
1.288346e+00
1.288197e+00
1.288049e+00
1.287900e+00
1.287750e+00
1.287600e+00
1.287450e+00
1.287300e+00
1.287150e+00
1.287000e+00
1.286825e+00
1.286650e+00
1.286475e+00
1.286300e+00
1.286133e+00
1.285967e+00
1.285800e+00
1.285633e+00
1.285467e+00
1.285300e+00
1.285133e+00
1.284967e+00
1.284800e+00
1.284633e+00
1.284467e+00
1.284300e+00
1.284112e+00
1.283925e+00
1.283737e+00
1.283550e+00
1.283362e+00
1.283175e+00
1.282987e+00
1.282800e+00
1.282600e+00
1.282400e+00
1.282200e+00
1.282000e+00
1.281800e+00
1.281600e+00
1.281350e+00
1.281100e+00
1.280900e+00
1.280700e+00
1.280500e+00
1.280200e+00
1.279950e+00
1.279700e+00
1.279475e+00
1.279250e+00
1.279025e+00
1.278800e+00
1.278533e+00
1.278267e+00
1.278000e+00
1.277750e+00
1.277500e+00
1.277250e+00
1.277005e+00
1.276768e+00
1.276532e+00
1.276295e+00
1.276105e+00
1.275947e+00
1.275789e+00
1.275632e+00
1.275474e+00
1.275316e+00
1.275158e+00
1.275000e+00
1.274850e+00
1.274700e+00
1.274550e+00
1.274400e+00
1.274200e+00
1.274000e+00
1.273800e+00
1.273600e+00
1.273410e+00
1.273219e+00
1.273029e+00
1.272838e+00
1.272610e+00
1.272371e+00
1.272133e+00
1.271895e+00
1.271643e+00
1.271381e+00
1.271119e+00
1.270857e+00
1.270582e+00
1.270286e+00
1.269991e+00
1.269695e+00
1.269400e+00
1.269060e+00
1.268720e+00
1.268380e+00
1.268040e+00
1.267700e+00
1.267350e+00
1.267000e+00
1.266650e+00
1.266300e+00
1.265925e+00
1.265550e+00
1.265175e+00
1.264800e+00
1.264425e+00
1.264050e+00
1.263675e+00
1.263300e+00
1.262900e+00
1.262500e+00
1.262100e+00
1.261700e+00
1.261300e+00
1.260900e+00
1.260450e+00
1.260000e+00
1.259550e+00
1.259100e+00
1.258700e+00
1.258200e+00
1.257750e+00
1.257300e+00
1.256850e+00
1.256400e+00
1.255925e+00
1.255450e+00
1.254975e+00
1.254500e+00
1.254000e+00
1.253500e+00
1.253000e+00
1.252500e+00
1.251975e+00
1.251450e+00
1.250925e+00
1.250400e+00
1.249850e+00
1.249300e+00
1.248750e+00
1.248200e+00
1.247625e+00
1.247050e+00
1.246475e+00
1.245900e+00
1.245300e+00
1.244700e+00
1.244100e+00
1.243500e+00
1.242850e+00
1.242200e+00
1.241550e+00
1.240900e+00
1.240225e+00
1.239550e+00
1.238875e+00
1.238200e+00
1.237450e+00
1.236700e+00
1.235950e+00
1.235200e+00
1.234450e+00
1.233700e+00
1.232862e+00
1.232025e+00
1.231187e+00
1.230350e+00
1.229513e+00
1.228675e+00
1.227838e+00
1.227000e+00
];

fid = fopen('ice_n.txt', 'wb');
wave = zeros(461);
for i=1:461
    wave(i) = 195 + i*5;
    fprintf(fid, '%d %3.4e\n', wave(i), data(i));
end
fclose(fid);
semilogy(wave, data, 'b-', 'linewidth', 3);
axis([195 2505 1.20 1.40]);
set(gca, 'FontSize', 14);
grid on
title('Ice', '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', 'ice_n.png');
close;
