在天空中观测RA/Dec位置的方法



我是Skyfield的新手,一直在尝试根据地球上的位置和时间自动创建完整的天空星图。我试图创建一个与给定位置的天顶相对应的点,然后观察该点,如文档中的彗星示例所示:https://rhodesmill.org/skyfield/example-plots.html#drawing-a-finder-chart-for-comet-neowise

然而,我使用的方法生成了一个ICRF位置,这显然与observe((方法不兼容。我一直在读关于位置和参考系的文章,还没有完全理解在Skyfield中如何处理它们。有没有一种简单的方法可以转换ICRF的位置,使其与observe((兼容,或者有没有一个更简单的方法来生成以天顶为中心的星图?

以下是我的代码片段,主要取自链接中的示例:

import numpy as np
from matplotlib import pyplot as plt
from matplotlib.collections import LineCollection
from skyfield.api import Star, load, N, W, wgs84, Topos
from skyfield.constants import GM_SUN_Pitjeva_2005_km3_s2 as GM_SUN
from skyfield.data import hipparcos, mpc, stellarium
from skyfield.projections import build_stereographic_projection
from skyfield.positionlib import Astrometric, position_of_radec
from skyfield.vectorlib import VectorFunction, VectorSum
ts = load.timescale()
t = ts.utc(2019,9,13,20)
lat = 41.0
lon = 111.0
geographic = wgs84.latlon(latitude_degrees=lat*N, longitude_degrees=lon*W)
observer = geographic.at(t)
zenith = observer.from_altaz(alt_degrees=90, az_degrees=0)
zenith_ra, zenith_dec, dist = zenith.radec()
eph = load('de421.bsp')
sun = eph['sun']
earth = eph['earth']
viewloc = earth + wgs84.latlon(lat*N, lon*W)

# The Hipparcos mission provides our star catalog.
with load.open(hipparcos.URL) as f:
stars = hipparcos.load_dataframe(f)
url = ('https://raw.githubusercontent.com/Stellarium/stellarium/master'
'/skycultures/western_SnT/constellationship.fab')
with load.open(url) as f:
constellations = stellarium.parse_constellations(f)
edges = [edge for name, edges in constellations for edge in edges]
edges_star1 = [star1 for star1, star2 in edges]
edges_star2 = [star2 for star1, star2 in edges]

# We will center the chart on the zenith.
barycentric = earth.at(t)
center_position = position_of_radec(zenith_ra.hours, zenith_dec.degrees)
astrometric = Astrometric(center_position.position.au) # Not sure what is needed as an argument here
center = barycentric.observe(astrometric)
projection = build_stereographic_projection(center)
field_of_view_degrees = 45.0
limiting_magnitude = 7.0

尝试直接使用天顶位置作为绘图的中心:

projection = build_stereographic_projection(zenith)

看看这是否会将正确的恒星放在结果图的中心。如果没有,请尝试将结果粘贴为图像,我们可以进一步探索!

最新更新