OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
propagate.py
Go to the documentation of this file.
1 def propagate(rates):
2  # Procedure to propagate angular rates to generate quaternions
3  # input: rates
4  # output: quats
5  # reference: propagate.pro by Fred Patt
6  # ported to Python by Liang Hong, 2/19/2020
7  # updated by Liang Hong, 12/3/2020
8 
9  import numpy as np
10  from hawknav.qprod import qprod
11 
12  nr = np.shape(rates)[0]
13  quats = np.zeros((nr+1,4))
14 
15  quats[0,:] = [0.0,0.0,0.0,1.0]
16  qr = np.zeros((nr,4))
17 
18  qr[:,0:3] = np.sin(rates/2.0)
19  qr[:,3] = np.sqrt(1.0 - np.sum(qr[:,0:3]**2,axis=1))
20 
21  for i in range(0,nr):
22  qt = qprod(quats[i,:],qr[i,:])
23  qt = qt/np.sqrt(np.sum(qt*qt)) # LH , 12/3/2020
24  quats[i+1,:] = qt
25 
26  return quats
Definition: qprod.py:1
def propagate(rates)
Definition: propagate.py:1