def nodeEpochsCalc(paramsDI,omegaDIoffset):
"""
Calculate the epochs for the Ascending and Descending nodes, might be in different orbital
periods and AN/DN might be the wrong order, but should work for plotting... I hope...
"""
taAtNodes = [-1.0*paramsDI[9]+omegaDIoffset,180.0-1.0*paramsDI[9]+omegaDIoffset]
nodeEpochs = []
for ta in taAtNodes:
if ta<0.0:
ta =ta+360.0
elif ta>360:
ta =ta-360.0
TA_s_rad = ta*(np.pi/180.0)
top = np.sqrt(1.0-paramsDI[4])*np.sin(TA_s_rad/2.0)
btm = np.sqrt(1.0+paramsDI[4])*np.cos(TA_s_rad/2.0)
ATAN_rad = np.arctan2(top, btm)
#NOTE: both math.atan2 and np.arctan2 tried with same results, both produce negatives rather than continuous 0-360
#thus, must correct for negative outputs
if ATAN_rad<0:
ATAN_rad = ATAN_rad+(2.0*np.pi)
M_s_rad = ATAN_rad*2.0-paramsDI[4]*np.sin(ATAN_rad*2.0)
delta_t = (M_s_rad*paramsDI[7]*days_per_year)/(2.0*np.pi)
nodeEpochs.append(paramsDI[5]+delta_t)
return nodeEpochs
评论列表
文章目录