function b = posori(a);
%
% posori: puts orientation in 0 to 2*pi interval
% On input:
%     a: 2D array of angles
% On output:
%     b: 2D array of angles in range [0,2*pi]
% Call:
%     b = posori(a);
%

[m,n] = size(a);
b = zeros(m,n);
for ii = 1:m
  for jj = 1:n
    if a(ii,jj) < 0
      b(ii,jj) = a(ii,jj) + 2*pi;
    end
    if a(ii,jj) > 0
      b(ii,jj) = a(ii,jj);
    end
  end
end
