OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
bore_sight.py
Go to the documentation of this file.
1 '''
2 Created on Nov 19, 2015
3 
4 @author: rhealy
5 '''
6 import numpy as np
7 
8 def bore_sight(dth):
9  import math as m
10 
11  cx=m.cos(dth[0])
12  sx=m.sin(dth[0])
13  cy=m.cos(dth[1])
14  sy=m.sin(dth[1])
15  cz=m.cos(dth[2])
16  sz=m.sin(dth[2])
17 
18 # print('bore_sight:',cx,sx,cy,sy,cz,sz)
19 
20  rot = np.zeros((3,3))
21 
22  rot[0,:]=[cy*cz,cy*sz,-sy]
23  rot[1,:]=[sx*sy*cz-cx*sz,sx*sy*sz+cx*cz,cy*sx]
24  rot[2,:]=[cx*sy*cz+sx*sz,cx*sy*sz-sx*cz,cy*cx]
25 
26  return rot
27 
28 if __name__ == '__main__':
29  rad2Deg = 180.0/np.pi
30  deg2Rad = np.pi/180.0
31  as2Deg = 1.0/3600.0
32  as2Rad = as2Deg*deg2Rad
33 
34  r_hico_bs = np.zeros((3))
35  r_hico_bs[0] = -0.9957
36  r_hico_bs[1] = 0.0268
37  r_hico_bs[2] = -0.0128
38  rot = bore_sight(r_hico_bs*deg2Rad)
39 # print('rot=',str(rot))
40  r_hico_to_iss = np.zeros((3,3))
41  r_hico_to_iss[0][0] = -1.0
42  r_hico_to_iss[1][1] = -1.0
43  r_hico_to_iss[2][2] = 1.0
44 # print('r_iss:',r_hico_to_iss)
45 # print(np.dot(r_hico_to_iss,rot))
def bore_sight(dth)
Definition: bore_sight.py:8