%% Interpolate 1-D array from 2-D array for coefficients matrix;
%
%%

function fi_year = coeff_for_year(f_avr);


	days_in_year = 366;
	f_tmp =[f_avr f_avr f_avr;f_avr f_avr f_avr; f_avr f_avr f_avr];
	[X,Y] = meshgrid([15 :days_in_year/12:days_in_year*3-15],[1:288*3]);
	[XI,YI] = meshgrid([1:days_in_year*3],[1:288*3]);
	fi_tmp1 = interp2(X,Y,f_tmp',XI,YI,'spline');
	fi_avr = fi_tmp1([288+1:288*2],[days_in_year+1:days_in_year*2]);
	for i=1:days_in_year; 
		fi_year([1+(i-1)*288 :(i)*288],1) = fi_avr(:,i); 
	end;
%plot(fi_year);
