1 回答

TA貢獻1839條經驗 獲得超15個贊
好問題!我應該在https://rhodesmill.org/skyfield/searches.html添加一個新部分來解釋減去兩個經度或赤經時看到的這種常見行為。解開這個謎團的關鍵是觀察角度差在輸出中作為幻影合相出現的某一時刻發生了什么。我附上了一個腳本,它會為您在金星和畢宿五之間打印的第一個事件打印此內容:
2020-02-07 Difference: -19.33880215224481 Venus RA: 23.93746881891146 2020-02-08 Difference: 4.5908654129343995 Venus RA: 0.007801253732248779
角度差在 -19.3 和 4.6 之間跳躍,這應該會立即引起我們的懷疑,因為它們只是完全相同角度的兩個不同名稱!您可以通過將 24.0 加到 -19.3 來確認這一點,您將得出一個非常接近 4.6 的角度(給出或考慮金星在一天內完成的實際運動)。
為什么結果會在天空中完全相同的角度差異的兩個別名之間跳躍?
答案在上面打印的第二個事實中:金星的 RA。不連續恰好發生在金星恰好穿過 0h 赤經的那一刻!盡管 23.93746881891146 和 0.007801253732248779 幾乎是相同的角度,但它們相差 24.0,因為它們橫跨天空中我們重新命名赤經的位置。
我下面的腳本還顯示了一個說明情況的情節:
您可以在頂部圖中看到,正是在金星將其 RA 重置為零的確切時刻,RA 差異在相同的四個半小時內從一個別名跳到另一個別名 24.0 小時RA 的差異。
解決方案?
角度差異需要限制在 [-12h, +12h) 之類的范圍內,以強制為每個可能的角度值選擇一個首選別名。在 Python 中,正如您在下面的腳本中所見,典型的操作是:
(ra1.hours - ra2.hours + 12.0) % 24.0 - 12.0
這在上面的第二個圖中顯示為“改進的差異”,它不僅正確地隱藏了 2 月 7 日的不連續性,不再讓它看起來像一個事件,而且現在它在接近尾聲時正確地識別了金星和畢宿五之間的對沖2020 年(在圖的右邊緣)之前僅顯示為超過 -12.0 的差異,但現在作為角度差異的關鍵時刻閃耀。
最后,此腳本會檢查反對意見并將其從搜索結果中過濾掉。您還會發現一些可能的 Python 代碼調整,您可能會在繼續使用 Python 編碼時考慮這些調整。開始:
from skyfield.searchlib import find_maxima, find_minima, find_discrete
from skyfield.api import Star, load
from datetime import datetime, date,timedelta
import pytz
planets = load('de430t.bsp')
earth = planets['earth']
stars = [
['Aldebaran', (4, 35, 55.2), (16, 30, 33)],
['Regulus', (10, 8, 22.3), (11, 58, 2)],
['Pollux', (7, 45, 18.9), (28, 1, 34)],
['Antares', (16, 29, 24.4), (-26, 25, 55)],
]
ts = load.timescale(builtin=True)
t0 = ts.utc(2020, 1, 1)
t1 = ts.utc(2021, 1, 1)
# Exploring the first bad result for Venus and Aldebaran.
star = Star(ra_hours=stars[0][1], dec_degrees=stars[0][2])
for utc in (2020, 2, 7), (2020, 2, 8):
t = ts.utc(*utc)
ra1, _, _ = planets['earth'].at(t).observe(star).radec()
ra2, _, _ = planets['earth'].at(t).observe(planets['venus']).radec()
print(t.utc_strftime('%Y-%m-%d'),
'Difference:', ra1.hours - ra2.hours,
'Venus RA:', ra2.hours)
# Plot showing how to protect an angular difference against discontinuity.
import matplotlib.pyplot as plt
t = ts.utc(2020, 1, range(365))
e = planets['earth'].at(t)
star = Star(ra_hours=stars[0][1], dec_degrees=stars[0][2])
ra1, _, _, = e.observe(star).radec()
ra2, _, _, = e.observe(planets['venus']).radec()
fig, (ax, ax2) = plt.subplots(2, 1)
ax.plot(t.J, ra2.hours, label='Venus RA')
ax.plot(t.J, ra1.hours - ra2.hours, label='RA difference')
ax.set(xlabel='Year', ylabel='Hours')
ax.grid()
ax.legend()
ax2.plot(t.J, ra2.hours, label='Venus RA')
ax2.plot(t.J, (ra1.hours - ra2.hours + 12.0) % 24.0 - 12.0,
label='Improved difference')
ax2.set(xlabel='Year', ylabel='Hours')
ax2.grid()
ax2.legend()
fig.savefig('tmp.png')
# So we need to force the difference into the range [-12 hours .. +12 hours]
def difference(t):
e = earth.at(t)
ra11, dec11, distance = e.observe(object).radec()
ra12, dec12, distance2 = e.observe(planets[target1]).radec()
diff = (ra11.hours - ra12.hours + 12.0) % 24.0 - 12.0
return diff >= 0
difference.rough_period = 1.0
for name, ra_hms, dec_dms in stars:
object = Star(ra_hours=ra_hms, dec_degrees=dec_dms)
target1 = 'venus'
t, b = find_discrete(t0, t1, difference)
if len(t) == 0:
break
print (f"{name} and {target1}")
for a, b in zip(t, b):
e = earth.at(a)
ra1, dec1, _ = e.observe(object).radec('date')
ra2, dec2, _ = e.observe(planets[target1]).radec('date')
if abs(ra1.hours - ra2.hours) > 6.0:
continue # ignore oppositions
print(f"Diff: {ra1.hours - ra2.hours:.4f}, ra_{name}: {ra1.hours}, ra_{target1}: {ra2.hours}")
print(f"{a.utc_iso()},{dec1._degrees - dec2._degrees}")
print()
現在打印的事件是:
Aldebaran and venus
Diff: -0.0014, ra_Aldebaran: 4.617748605529591, ra_venus: 4.619169121320681
2020-04-17T20:25:49Z,-10.136618155920797
Diff: -0.0007, ra_Aldebaran: 4.617892691238804, ra_venus: 4.618562784294269
2020-06-08T07:56:08Z,-4.921187477025711
Diff: -0.0001, ra_Aldebaran: 4.618000948409604, ra_venus: 4.618129623302464
2020-07-12T06:44:16Z,-0.9622868107603999
Regulus and venus
Diff: 0.0000, ra_Regulus: 10.157702949500333, ra_venus: 10.157697096607553
2020-10-02T23:42:45Z,0.09034295610918264
Pollux and venus
Diff: 0.0012, ra_Pollux: 7.776229220287636, ra_venus: 7.775002995218732
2020-09-01T16:39:22Z,8.68200041253418
Antares and venus
Diff: 0.0008, ra_Antares: 16.511260401870718, ra_venus: 16.51042838802181
2020-12-23T00:34:39Z,-5.652225570418828
我相信這可以解決并糾正您的問題!
添加回答
舉報