如何在特定日期和时间为某个观测站(经度,纬度)的观测者计算恒星的位置(ra,dec)?我需要将所有包含在计算中的元素(星体的正确运动,大气压和温度...)进行完全坐标缩减。
我尝试过使用pyephemem,但不确定是否可以完成。
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/