OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
get_nut.py
Go to the documentation of this file.
1 def get_nut(iyr,day):
2  # Program to get nutation matrix for TOD-to-MOD conversion
3 
4  # Calling Arguments:
5 
6  # Name Type I/O Description
7  # -------- ---- --- -----------
8  # iyr I*4 I Year
9  # day I*4 I Day of year
10  # xnut(3,3) R*8 O Nutation 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  from hawknav.gha2000 import ephparms,nutate
17 
18  xnut = np.zeros((np.size(iyr),3,3))
19  imon = 1
20  iday = np.round(day)
21  t = jd(iyr,imon,iday) - 2451545.50 + day - iday
22  [xls,gs,xlm,omega] = ephparms(t)
23  [dpsi,eps,epsm] = nutate(t,xls,gs,xlm,omega)
24 
25  dpsi_rad = np.deg2rad(dpsi)
26  epsm_rad = np.deg2rad(epsm)
27  eps_rad = np.deg2rad(eps)
28 
29  xnut[:,0,0] = np.cos(dpsi_rad)
30  xnut[:,0,1] = -np.sin(dpsi_rad)*np.cos(epsm_rad)
31  xnut[:,0,2] = -np.sin(dpsi_rad)*np.sin(epsm_rad)
32  xnut[:,1,0] = np.sin(dpsi_rad)*np.cos(eps_rad)
33  xnut[:,1,1] = np.cos(dpsi_rad)*np.cos(eps_rad)*np.cos(epsm_rad) \
34  + np.sin(eps_rad)*np.sin(epsm_rad)
35  xnut[:,1,2] = np.cos(dpsi_rad)*np.cos(eps_rad)*np.sin(epsm_rad) \
36  - np.sin(eps_rad)*np.cos(epsm_rad)
37  xnut[:,2,0] = np.sin(dpsi_rad)*np.sin(eps_rad)
38  xnut[:,2,1] = np.cos(dpsi_rad)*np.sin(eps_rad)*np.cos(epsm_rad) \
39  - np.cos(eps_rad)*np.sin(epsm_rad)
40  xnut[:,2,2] = np.cos(dpsi_rad)*np.sin(eps_rad)*np.sin(epsm_rad) \
41  + np.cos(eps_rad)*np.cos(epsm_rad)
42 
43  return xnut
def get_nut(iyr, day)
Definition: get_nut.py:1
Definition: jd.py:1
short int nutate(double tjd, short int fn1, double *pos, double *pos2)
int ephparms(double t, double &xls, double &gs, double &xlm, double &omega)