function y=W2(theta,nominal_angle);
%
% 2005.12
% Emmanuel Boss
% emmanuel.boss@maine.edu
% School of Marine Sciences, University of Maine, USA
%
% Calculates the angular weighting function for Eco-type sensors.
%
%
% INPUT
% scattering angle                              (theta)    [degree]
% Center angle for backscattering               (nominal_angle)    [degree]

% OUTPUT
% weighting function                            (y)

%angular responsivity of Eco type sensor.
Eco125=[0 0;90 0;105 0;110 0.005;112 0.01;114 0.015;116 0.02;120 0.035;122.5 0.045;...
        125 0.055;126 0.057;127 0.055;130 0.045;133 0.035;135 0.027;137.5 0.02;...
        141 0.01;143 0.005;145 0.002;147 0;160 0;180 0];
W2=[Eco125(:,1)+nominal_angle-125,Eco125(:,2)];
y=interp1(W2(:,1),W2(:,2),theta,'cubic');
y=y.*sin(theta*pi/180);
