healpy.rotator.Rotator¶

class healpy.rotator.Rotator(rot=None, coord=None, inv=None, deg=True, eulertype='ZYX')

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
rotNone or sequence

Describe the rotation by its euler angle. See euler_matrix_new().

coordNone or sequence of str

Describe the coordinate system transform. If rot is also given, the coordinate transform is applied first, and then the rotation.

invbool

If True, the inverse rotation is defined. (Default: False)

degbool

If True, angles are assumed to be in degree. (Default: True)

eulertypestr

The Euler angle convention used. See euler_matrix_new().

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)
1.66742286715
>>> print(phi_ecl)
-1.62596400306
>>> theta_ecl, phi_ecl = Rotator(coord='ge')(theta_gal, phi_gal) # In one line
>>> print(theta_ecl)
1.66742286715
>>> print(phi_ecl)
-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(self, \*args, \*\*kwds) Rotate the given vector or direction using the inverse matrix. __call__(self, \*args, \*\*kwds) Use the rotator to rotate either spherical coordinates (theta, phi) or a vector (x,y,z). angle_ref(self, \*args, \*\*kwds) Compute the angle between transverse reference direction of initial and final frames do_rot(self, i) Returns True if rotation is not (close to) identity. rotate_alm(self, alm[, lmax, mmax, inplace]) Rotate Alms with the transform defined in the Rotator object rotate_map_alms(self, m[, …]) Rotate a HEALPix map to a new reference frame in spherical harmonics space rotate_map_pixel(self, m) Rotate a HEALPix map to a new reference frame in pixel space
 get_inverse