% ******************************************************************************
% ice_k.m
% ******************************************************************************
%
% Data Description:
% refractive index (imaginary 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 = [
6.407000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.000000e-11
2.182500e-11
2.365000e-11
2.517000e-11
2.669000e-11
2.902000e-11
3.135000e-11
3.637500e-11
4.140000e-11
5.204000e-11
6.268000e-11
7.753500e-11
9.239000e-11
1.124450e-10
1.325000e-10
1.640500e-10
1.956000e-10
2.408500e-10
2.861000e-10
3.516500e-10
4.172000e-10
5.030500e-10
5.889000e-10
6.962500e-10
8.036000e-10
9.398000e-10
1.076000e-09
1.242500e-09
1.409000e-09
1.611000e-09
1.813000e-09
2.051000e-09
2.289000e-09
2.564000e-09
2.839000e-09
3.150000e-09
3.461000e-09
3.810000e-09
4.159000e-09
4.544500e-09
4.930000e-09
5.330000e-09
5.730000e-09
6.310000e-09
6.890000e-09
7.735000e-09
8.580000e-09
9.490000e-09
1.040000e-08
1.130000e-08
1.220000e-08
1.325000e-08
1.430000e-08
1.545000e-08
1.660000e-08
1.775000e-08
1.890000e-08
1.990000e-08
2.090000e-08
2.245000e-08
2.400000e-08
2.650000e-08
2.900000e-08
3.170000e-08
3.440000e-08
3.735000e-08
4.030000e-08
4.165000e-08
4.300000e-08
4.610000e-08
4.920000e-08
5.395000e-08
5.870000e-08
6.475000e-08
7.080000e-08
7.830000e-08
8.580000e-08
9.390000e-08
1.020000e-07
1.100000e-07
1.180000e-07
1.260000e-07
1.340000e-07
1.370000e-07
1.400000e-07
1.415000e-07
1.430000e-07
1.440000e-07
1.450000e-07
1.480000e-07
1.510000e-07
1.670000e-07
1.830000e-07
1.990000e-07
2.150000e-07
2.400000e-07
2.650000e-07
3.000000e-07
3.350000e-07
3.635000e-07
3.920000e-07
4.060000e-07
4.200000e-07
4.320000e-07
4.440000e-07
4.590000e-07
4.740000e-07
4.925000e-07
5.110000e-07
5.320000e-07
5.530000e-07
5.775000e-07
6.020000e-07
6.785000e-07
7.550000e-07
8.405000e-07
9.260000e-07
1.023000e-06
1.120000e-06
1.225000e-06
1.330000e-06
1.475000e-06
1.620000e-06
1.810000e-06
2.000000e-06
2.125000e-06
2.250000e-06
2.290000e-06
2.330000e-06
2.330000e-06
2.330000e-06
2.250000e-06
2.170000e-06
2.065000e-06
1.960000e-06
1.885000e-06
1.810000e-06
1.775000e-06
1.740000e-06
1.735000e-06
1.730000e-06
1.715000e-06
1.700000e-06
1.730000e-06
1.760000e-06
1.790000e-06
1.820000e-06
1.930000e-06
2.040000e-06
2.145000e-06
2.250000e-06
2.270000e-06
2.290000e-06
2.665000e-06
3.040000e-06
3.440000e-06
3.840000e-06
4.305000e-06
4.770000e-06
5.265000e-06
5.760000e-06
6.235000e-06
6.710000e-06
7.685000e-06
8.660000e-06
9.430000e-06
1.020000e-05
1.075000e-05
1.130000e-05
1.175000e-05
1.220000e-05
1.255000e-05
1.290000e-05
1.305000e-05
1.320000e-05
1.335000e-05
1.350000e-05
1.340000e-05
1.330000e-05
1.325000e-05
1.320000e-05
1.320000e-05
1.320000e-05
1.315000e-05
1.310000e-05
1.315000e-05
1.320000e-05
1.320000e-05
1.320000e-05
1.330000e-05
1.340000e-05
1.365000e-05
1.390000e-05
1.405000e-05
1.420000e-05
1.450000e-05
1.480000e-05
1.530000e-05
1.580000e-05
1.660000e-05
1.740000e-05
1.860000e-05
1.980000e-05
2.711000e-05
3.442000e-05
4.700500e-05
5.959000e-05
8.119500e-05
1.028000e-04
1.272000e-04
1.516000e-04
1.801556e-04
2.112909e-04
2.527455e-04
2.942000e-04
3.417000e-04
3.892000e-04
4.368600e-04
4.845600e-04
5.138000e-04
5.384250e-04
5.503091e-04
5.430818e-04
5.352091e-04
5.247545e-04
5.143000e-04
5.045083e-04
4.947167e-04
4.822364e-04
4.679636e-04
4.535120e-04
4.387920e-04
4.240720e-04
4.093520e-04
3.946320e-04
3.795250e-04
3.638375e-04
3.481500e-04
3.324625e-04
3.167750e-04
3.053538e-04
2.967769e-04
2.882000e-04
2.796231e-04
2.710462e-04
2.642892e-04
2.602622e-04
2.562351e-04
2.522081e-04
2.481811e-04
2.441541e-04
2.401270e-04
2.361000e-04
2.308500e-04
2.256000e-04
2.203500e-04
2.151000e-04
2.098500e-04
2.046000e-04
2.003250e-04
1.960500e-04
1.917750e-04
1.875000e-04
1.837500e-04
1.800000e-04
1.762500e-04
1.725000e-04
1.687500e-04
1.650000e-04
1.628667e-04
1.607333e-04
1.586000e-04
1.564667e-04
1.543333e-04
1.522000e-04
1.508125e-04
1.494250e-04
1.480375e-04
1.466500e-04
1.452625e-04
1.438750e-04
1.424875e-04
1.411000e-04
1.392833e-04
1.374667e-04
1.356500e-04
1.338333e-04
1.320167e-04
1.302000e-04
1.306000e-04
1.310000e-04
1.324500e-04
1.339000e-04
1.377000e-04
1.432000e-04
1.532000e-04
1.632000e-04
1.865500e-04
2.099000e-04
2.332500e-04
2.566000e-04
3.071000e-04
3.576000e-04
4.081000e-04
4.908500e-04
5.736000e-04
6.563500e-04
7.483158e-04
8.541053e-04
9.598947e-04
1.065684e-03
1.160737e-03
1.248632e-03
1.336526e-03
1.424421e-03
1.478211e-03
1.523474e-03
1.568737e-03
1.614000e-03
1.620500e-03
1.627000e-03
1.633500e-03
1.640000e-03
1.621500e-03
1.603000e-03
1.584500e-03
1.566000e-03
1.540286e-03
1.514571e-03
1.488857e-03
1.463143e-03
1.421619e-03
1.376143e-03
1.330667e-03
1.285190e-03
1.232143e-03
1.174048e-03
1.115952e-03
1.057857e-03
9.989636e-04
9.388727e-04
8.787818e-04
8.186909e-04
7.586000e-04
7.119800e-04
6.653600e-04
6.187400e-04
5.721200e-04
5.255000e-04
4.947500e-04
4.640000e-04
4.332500e-04
4.025000e-04
3.827500e-04
3.630000e-04
3.432500e-04
3.235000e-04
3.103000e-04
2.971000e-04
2.839000e-04
2.707000e-04
2.627167e-04
2.547333e-04
2.467500e-04
2.387667e-04
2.307833e-04
2.228000e-04
2.180250e-04
2.132500e-04
2.084750e-04
2.037000e-04
2.026000e-04
2.035000e-04
2.056500e-04
2.078000e-04
2.124500e-04
2.171000e-04
2.262750e-04
2.354500e-04
2.446250e-04
2.538000e-04
2.688000e-04
2.838000e-04
2.988000e-04
3.138000e-04
3.318000e-04
3.498000e-04
3.678000e-04
3.858000e-04
4.041250e-04
4.224500e-04
4.407750e-04
4.591000e-04
4.740000e-04
4.889000e-04
5.038000e-04
5.187000e-04
5.291500e-04
5.396000e-04
5.500500e-04
5.605000e-04
5.692750e-04
5.780500e-04
5.868250e-04
5.956000e-04
6.031750e-04
6.107500e-04
6.183250e-04
6.259000e-04
6.352500e-04
6.446000e-04
6.539500e-04
6.633000e-04
6.726500e-04
6.820000e-04
6.908750e-04
6.997500e-04
7.086250e-04
7.175000e-04
7.263750e-04
7.352500e-04
7.441250e-04
7.530000e-04
];

fid = fopen('ice_k.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 1e-11 1e-2]);
set(gca, 'FontSize', 14);
grid on
title('Ice', 'fontsize', 14);
ylabel('extinction coefficient', 'fontsize', 14);
xlabel('wavelength (nm)', 'fontsize', 14);
set(gcf, 'PaperUnits', 'inches', 'PaperPosition', [0 0 6 5]);
pause
print('-dpng', '-r100', 'ice_k.png');
close;
