pro angles,x,y,theta
;+
; NAME
;  angles.pro  
;
; PURPOSE
;  To produce an array of azimuthal angles, theta, with respect 
;  to an origin x,y.
;
; CALLING SEQUENCE
;  angles,x,y,theta
;
; INPUT
;  x : x coordinate of origin
;  y : y coordinate of origin
;
; OUTPUT
;  theta : array of azimuthal angles
;
; OPTIONAL OUTPUT
;  none 	
;
; OPTIONAL KEYWORD INPUT
;  none	
;
; RESTRICTION
;  some
;
; HISTORY
;  Written CAF 12 Nov 95 : caf@mssl.ucl.ac.uk
;-

       nx=512.
       ny=512.
       theta=90.-(180.*atan(rebin((findgen(nx)-x),nx,ny)/ $
       (rebin(reform((findgen(ny)-y),1,ny),nx,ny)))/!pi)   
      theta(*,0:y)=theta(*,0:y)+180.                
      theta(0:x-1.,y)=180.          
      theta(x:nx-1.,y)=0.
 win,theta
 tvscl,theta
 end
