chandra_maneuver
¶
- chandra_maneuver.maneuver.NSM_attitude(att, time)¶
Calculate the closest normal sun mode attitude for the specified starting attitude
att
andtime
.- Parameters:
att – attitude that can initialize a Quat()
time – time in a valid Chandra.Time format
- Returns:
NSM attitude quaternion
- Return type:
Quat
- chandra_maneuver.maneuver.attitudes(att1, att2, step=300, tstart=0, exact_steps=False)¶
Calculate the maneuver profile of the spacecraft and return time, attitude quaternions, and sun pitch.
By default the time steps are calculated to be the closest possible to the specified
step
while maintaining an even spacing between the start and end of the maneuver. Ifexact_steps
is True then the time steps are exactly as specified and there will be one uneven step at the end.Example usage:
>>> import chandra_maneuver >>> atts = chandra_maneuver.attitudes((0,0,0), (10,20,30)) >>> atts.pitch array([ 79.64483 , 81.90894478, 89.10262574, 95.10617367, 96.57590726]) >>> atts.q1 array([ 0. , 0.03083816, 0.13619809, 0.23923962, 0.26853582])
- Parameters:
att1 – initial attitude (Quat, 3 element RA,Dec,Roll, or 4 element quaternion)
att2 – final attitude (Quat, 3 element RA,Dec,Roll, or 4 element quaternion)
step – time separation of returned attitudes (seconds)
tstart – maneuver start time (CxoTime compatible)
exact_steps – use the exact time
step
- Return type:
numpy.recarray [ time, q1, q2, q3, q4, pitch]
- chandra_maneuver.maneuver.duration(att1, att2)¶
Calculate the duration of a maneuver.
Example usage:
>>> import chandra_maneuver >>> chandra_maneuver.duration((0,0,0), (20,20,20)) 1141.4469982300088
- Parameters:
att1 – initial attitude (Quat, 3 element RA,Dec,Roll, or 4 element quaternion)
att2 – final attitude (Quat, 3 element RA,Dec,Roll, or 4 element quaternion)
- Return type:
float seconds
- chandra_maneuver.maneuver.get_eigenaxis(A)¶
Calculate the rotation eigenaxis from first three components of quaternion
A
- Parameters:
A – quaternion as a 4 element numpy
- Return type:
3 element numpy
- chandra_maneuver.maneuver.get_quaternions(atts)¶
Get a list of quaternions from the specified
atts
attitudes.- Parameters:
atts – recarray of the attitudes, times and pitches
- Returns:
list of corresponding Quat objects
- chandra_maneuver.maneuver.inject_errors(atts, att_err, bias_err)¶
Inject errors into
atts
corresponding to an initial attitude erroratt_err
and bias errorbias_err
.The
bias_err
input can have shape (3, len(atts)) to allow for a time varying bias error.- Parameters:
atts – recarray of the attitudes, times and pitches
att_err – initial attitude error (roll, pitch, yaw in arcsec)
bias_err – bias error (roll, pitch, yaw in arcsec/sec)
- Returns:
recarray array of the attitudes, times and pitches
- chandra_maneuver.maneuver.make_phi_dphi(delta, J, eps, tau, s)¶
Given a time array, the maneuver parameters, and a unit vector, calculate the manever phi and dphi in the different segments of the maneuver
- Parameters:
delta –
J –
eps –
tau –
s – time array
- Return type:
tuple (phi, dphi, d2phi)
- chandra_maneuver.maneuver.profile(q_init, q_final)¶
Calculate the parameters/profile of a maneuver, given initial and final attitude quaternions
Parameters¶
- q_initQuat, 3 element RA,Dec,Roll, or 4 element quaternion
Initial quaternion
- q_finalQuat, 3 element RA,Dec,Roll, or 4 element quaternion
Final quaternion
Returns¶
- Tmfloat
Duration of maneuver in seconds
- Jfloat
Maximum angular acceleration in rad/sec**3 (MAYBE)
- epsfloat
Maximum angular velocity in rad/sec (MAYBE)
- taufloat
Time at which maximum angular velocity occurs in seconds (MAYBE)
- manvr_quat4-element ndarray
q_final / q_init which defines the maneuver quaternion