function position
%
%            Deirdre Byrne, L-DEO, 4 Jan 1997
%                 dbyrne@ldeo.columbia.edu
%
%
%  Part of the staplot package. For instructions, see sta_info.m.

global sta lon_var lat_var
g = [0 0];
if ~isempty(lon_var)
    eval(['global ' lon_var]);
    g(1) = 1;
end
if ~isempty(lat_var)
    eval(['global ' lat_var]);
    g(2) = 1;
end
if all(g == 1)
  if~isempty(eval(lon_var))  & ~isempty(eval(lat_var))
    eval(['x = ' lon_var '(sta);']);
    eval(['y = ' lat_var '(sta);']);
    for i = 1:length(sta)
      la = ' ';
      if y(i) > 0
	la = 'N';
      elseif y(i) < 0
	la = 'S';
      end
      ln = ' ';
      if x(i) > 0 & x(i) <= 180
	ln = 'E';
      elseif x(i) < 0 | x(i) > 180
	ln = 'W';
      end
    str = sprintf('%7.4f%1s %8.4f%1s',y(i),la,x(i),ln);
    disp(str)
    end
  else
    return
  end
end
