OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
j2000_to_mod.py
Go to the documentation of this file.
1 def j2000_to_mod(iy,idy,sec):
2  # Get J2000 to MOD (precession) transformation
3 
4  # Arguments:
5  # Name Type I/O Description
6  # --------------------------------------------------------
7  # iy I I Year, four digits
8  # idy I I Day of year
9  # sec R*8 I Seconds of day
10  # j2mod(3,3) R O J2000 to MOD matrix
11  # ported from IDL (Fred Patt), Liang Hong, 9/20/2019
12  # Liang Hong, 3/24/2020, array calculation
13 
14  import numpy as np
15  from hawknav.jd import jd
16 
17  t = jd(iy,np.ones(np.shape(iy)),idy) - 2451545.50 + sec/86400.0
18  t = t/36525.0
19 
20  j2mod = np.zeros((np.size(iy),3,3))
21  zeta0 = np.deg2rad(( 2306.2181*t + 0.302*t*t + 0.018*t*t*t ))/3600.0
22  thetap = np.deg2rad(( 2004.3109*t - 0.4266*t*t - 0.04160*t*t*t ))/3600.0
23  xip = np.deg2rad(( 2306.2181*t + 1.095*t*t + 0.018*t*t*t ))/3600.0
24 
25  j2mod[:,0,0] = -np.sin(zeta0)*np.sin(xip) + np.cos(zeta0)*np.cos(xip)*np.cos(thetap)
26  j2mod[:,1,0] = -np.cos(zeta0)*np.sin(xip) - np.sin(zeta0)*np.cos(xip)*np.cos(thetap)
27  j2mod[:,2,0] = -np.cos(xip)*np.sin(thetap)
28  j2mod[:,0,1] = np.sin(zeta0)*np.cos(xip) + np.cos(zeta0)*np.sin(xip)*np.cos(thetap)
29  j2mod[:,1,1] = np.cos(zeta0)*np.cos(xip) - np.sin(zeta0) * np.sin(xip) * np.cos(thetap)
30  j2mod[:,2,1] = -np.sin(xip)*np.sin(thetap)
31  j2mod[:,0,2] = np.cos(zeta0)*np.sin(thetap)
32  j2mod[:,1,2] = -np.sin(zeta0)*np.sin(thetap)
33  j2mod[:,2,2] = np.cos(thetap)
34 
35  return j2mod
def j2000_to_mod(iy, idy, sec)
Definition: j2000_to_mod.py:1
Definition: jd.py:1