Rotation operator, including astronomical coordinate systems.
This class provides tools for spherical rotations. It is meant to be used in the healpy library for plotting, and for this reason reflects the convention used in the Healpix IDL library.
Parameters : | rot : None or sequence
coord : None or sequence of str
inv : bool
deg : bool
eulertype : str
|
---|
Examples
>>> r = Rotator(coord=['G','E']) # Transforms galactic to ecliptic coordinates
>>> theta_gal, phi_gal = np.pi/2., 0.
>>> theta_ecl, phi_ecl = r(theta_gal, phi_gal) # Apply the conversion
>>> print theta_ecl, phi_ecl
1.66742286715 -1.62596400306
>>> theta_ecl, phi_ecl = Rotator(coord='ge')(theta_gal, phi_gal) # In one line
>>> print theta_ecl, phi_ecl
1.66742286715 -1.62596400306
>>> vec_gal = np.array([1, 0, 0]) #Using vectors
>>> vec_ecl = r(vec_gal)
>>> print vec_ecl
[-0.05488249 -0.99382103 -0.09647625]
Attributes
mat | The matrix representing the rotation. |
coordin | The input coordinate system. |
coordout | The output coordinate system. |
coordinstr | The input coordinate system in str. |
coordoutstr | The output coordinate system in str. |
rots | The sequence of rots defining the rotation. |
coords | The sequence of coords defining the rotation. |
Methods
I(*args, **kwds) | Rotate the given vector or direction using the inverse matrix. |
__call__(*args, **kwds) | Use the rotator to rotate either spherical coordinates (theta, phi) or a vector (x,y,z). |
angle_ref(*args, **kwds) | Compute the angle between transverse reference direction of initial and final frames |
do_rot(i) | Returns True if rotation is not (close to) identity. |
get_inverse() |