function [angle2]=zeroto2pi(psibmatrix)
angle2=psibmatrix;
[nx ny]=size(psibmatrix);
for i=1:nx
for j=1:ny
    psib=psibmatrix(i,j);
%  returns an angle between zero and 2pi
        for ii=1:100                      %there's got to be a better way
            if psib<0,                   %  modulo 360
            psib=psib+2*pi;       %  Need all beams between 0 and 2pi
            end
        end
        for ii=1:100
        if psib>2*pi, 
            psib=psib-2*pi;
        end
        end
        angle2(i,j)=psib;
end
end
