使用Skyfield的月球结点的经度 [英] Longitude of lunar nodes using Skyfield

查看:252
本文介绍了使用Skyfield的月球结点的经度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Skyfield找出月球节点升/降的经度,但无法在文档中找到任何参考.是否有可能? 另外,任何JPL文件是否已经提供了此数据?

I am trying to find out the longitude of ascending/descending moon nodes using Skyfield but unable to find any reference in documentation. Is it possible? Also do any of the JPL Files provide this data already?

推荐答案

更新:

Skyfield的历书模块现在直接支持此计算!请参阅:月球节点

Skyfield’s almanac module now supports this computation directly! See: Lunar Nodes

原始答案,针对那些需要这些细节的人:

至少很容易找到相对于J2000黄道的日期,这对于远离2000年的日期也可能是合适的,因为我认为只有黄道经度的定义会随着时间的流逝而变化,而纬度却不会(节点关心的是什么)?

It is easy to at least find them relative to the J2000 ecliptic — which might be fine for dates far from the year 2000 as well, since I think that only the definition of ecliptic longitude changes with the passing years, but not latitude (which is what the nodes care about)?

无论如何,您都必须先这样做.假设您要升序节点.它必须在接下来的30天内发生,因为这不止是月球的完整轨道,所以让我们来看看月球纬度从负转为正的那一天:

In any case, you'd precede like this. Let's say you want the ascending node. It must happen within the next 30 days, because that's more than a full orbit of the Moon, so let's look for the day on which the latitude of the Moon passes from negative to positive:

from skyfield.api import load
ts = load.timescale()
eph = load('de421.bsp')
earth = eph['earth']
moon = eph['moon']

t = ts.utc(2018, 1, range(14, 14 + 30))
lat, lon, distance = earth.at(t).observe(moon).ecliptic_latlon()
angle = lat.radians

for i in range(len(angle)):
    if angle[i] < 0 and angle[i+1] > 0:
        break

print(t[i].utc_jpl(), angle[i])
print(t[i+1].utc_jpl(), angle[i+1])

结果是发现升序节点必须在1月31日的某个时间发生:

The result is the discovery that the ascending node must happen sometime on January 31st:

A.D. 2018-Jan-31 00:00:00.0000 UT -0.0188679292421
A.D. 2018-Feb-01 00:00:00.0000 UT 0.00522392011676

要找到确切的时间,请安装SciPy库,并要求其求解器之一找到该值达到零的确切时间.您只需创建一个将数字转换为Skyfield时间,然后将角度转换为纯数字的小函数,即可接收数字并返回数字:

To find the exact time, install the SciPy library, and ask one of its solvers to find the exact time at which the value reaches zero. You just have to create a little function that takes a number and returns a number, by converting the number to a Skyfield time and then the angle back to a plain number:

from scipy.optimize import brentq

def f(jd):
    t = ts.tt(jd=jd)
    angle, lon, distance = earth.at(t).observe(moon).ecliptic_latlon()
    return angle.radians

node_t = brentq(f, t[i].tt, t[i+1].tt)
print(ts.tt(jd=node_t).utc_jpl())

结果应该是节点的确切时刻:

The result should be the exact moment of the node:

A.D. 2018-Jan-31 18:47:54.5856 UT

这篇关于使用Skyfield的月球结点的经度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆