gpt4 book ai didi

python - 坐标还原python

转载 作者:太空宇宙 更新时间:2023-11-04 05:32:47 25 4
gpt4 key购买 nike

如何计算特定日期和时间在某个站点(经度、纬度)的观察者的星星位置(ra、dec)?我需要在计算中包含所有元素的完整坐标还原(恒星自行、大气压力和温度...)

我尝试使用 pyephem,但我不确定我能否完成。

import ephem

polaris = ephem.readdb("Polaris,f|M|F7,2:31:48.704,89:15:50.72,2.02,1")

polaris.compute('2016/3/1 16:22:56')

print polaris.a_ra
print polaris.a_dec

我也尝试过 astroplan,我认为我更接近解决方案,但仍然不知道如何在减少后获得坐标并添加自行。

import astropy.units as u
from astropy.coordinates import EarthLocation
from astropy.coordinates import SkyCoord
from pytz import timezone
from astroplan import Observer
from astropy.time import Time
from astroplan import FixedTarget
import numpy as np
import astropy.units as u
from astroplan.plots import plot_sky
from astroplan.plots import plot_parallactic
from astroplan.plots import plot_airmass
import matplotlib.pyplot as plt
from astroplan import FixedTarget


longitude = '21d33m20.4s'
latitude = '+43d08m24.6s'
elevation = 1150 * u.m
time = Time('2015-06-16 12:00:00')

location = EarthLocation.from_geodetic(longitude, latitude, elevation)

observer = Observer(name='Name',
location=location,
pressure=0.615 * u.bar,
relative_humidity=0.11,
temperature=0 * u.deg_C,
timezone=timezone('Europe/Belgrade'),
description="..")



coordinates = SkyCoord('2h31m48.704s', '89d15m50.72s', frame = 'icrs')
polaris = FixedTarget(name='Polaris', coord=coordinates)

plot_airmass(polaris, observer, time)

ax = plt.gca()
box = ax.get_position()
ax.set_position([box.x0, box.y0, box.width * 0.8, box.height * 0.8])

plt.legend(loc=1, bbox_to_anchor=(1.35, 1))
plt.show()

最佳答案

您可能想尝试 Skyfield,它是 PyEphem 的继任者,已接近 1.0。虽然 PyEphem 的底层库不存储自行,但如果要应用自行,则必须在输入期间移动所有星星,而 Skyfield 会根据 Star 对象本身中存储的运动动态地执行此操作.您正在考虑的减少在 Skyfield 中看起来像这样:

from skyfield.api import load, Star
ts = load.timescale()
t = ts.utc(2016, 4, 16, 15, 30)
planets = load('de421.bsp')
earth = planets['earth']
boston = earth.topos(longitude_degrees=(21, 33, 20.4),
latitude_degrees=(+43, 8, 24.6))
barnard = Star(ra_hours=(17, 57, 48.49803),
dec_degrees=(4, 41, 36.2072),
ra_mas_per_year=-798.71,
dec_mas_per_year=+10337.77,
parallax_mas=545.4,
radial_km_per_s=-110.6)
astrometric = boston.at(t).observe(barnard)
ra, dec, distance = astrometric.radec()
print(ra)
print(dec)
apparent = astrometric.apparent()
ra, dec, distance = apparent.radec()
print(ra)
print(dec)
alt, az, distance = apparent.altaz(temperature_C=25.0,
pressure_mbar=1013.25)
print(alt)
print(az)

更多文档位于 http://rhodesmill.org/skyfield/如果你好奇的话!

关于python - 坐标还原python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36583121/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com