ska_quatutil

ska_quatutil.quatutil.eci2radec(eci)[source]

Convert from ECI vector(s) to RA, Dec. The input eci value can be an array of 3-vectors having shape (3,N) in which case the output RA, Dec will be arrays of length N.

Parameters

eci – ECI as 3-vector or (3,N) array

Return type

list ra, dec (degrees)

ska_quatutil.quatutil.quat_x_to_vec(vec, method='radec')[source]

Generate quaternion that rotates X-axis into vec.

The method parameter can take one of three values: “shortest”, “keep_z”, or “radec” (default). The “shortest” method takes the shortest path between the two vectors. The “radec” method does the transformation as the corresponding (RA, Dec, Roll=0) attitude. The “keep_z” method does a roll about X-axis (followed by the “shortest” path) such that the transformed Z-axis is in the original X-Z plane. In equations:

T: "shortest" quaternion taking X-axis to vec
Rx(theta): Rotation by theta about X-axis = [[1,0,0], [0,c,s], [0,-s,c]]
Z: Z-axis [0,0,1]

[T * Rx(theta) * Z]_y = 0
T[1,1] * sin(theta) + T[1,2]*cos(theta) = 0
theta = atan2(T[1,2], T[1,1])
Parameters
  • vec – Input 3-vector

  • method – method for determining path (shortest|keep_z|radec)

Returns

Quaternion object

ska_quatutil.quatutil.radec2eci(ra, dec)[source]

Convert from RA,Dec to ECI. The input ra and dec values can be 1-d arrays of length N in which case the output ECI will be an array with shape (3,N).

Parameters
  • ra – Right Ascension (degrees)

  • dec – Declination (degrees)

Returns

numpy array ECI (3-vector or 3xN array)

ska_quatutil.quatutil.radec2yagzag(ra, dec, q)[source]

Given RA, Dec, and pointing quaternion, determine ACA Y-ang, Z-ang. The input ra and dec values can be 1-d arrays in which case the output yag and zag will be corresponding arrays of the same length.

Parameters
  • ra – Right Ascension (degrees)

  • dec – Declination (degrees)

  • q – Quaternion

Return type

list yag, zag (degrees)

ska_quatutil.quatutil.yagzag2radec(yag, zag, q)[source]

Given ACA Y-ang, Z-ang and pointing quaternion determine RA, Dec. The input yag and zag values can be 1-d arrays in which case the output ra and dec will be corresponding arrays of the same length.

Parameters
  • yag – ACA Y angle (degrees)

  • zag – ACA Z angle (degrees)

  • q – Quaternion

Return type

list ra, dec (degrees)