【问题标题】:Visualization of satellite track retrieved with pyephem is off使用 pyephem 检索的卫星轨迹的可视化已关闭
【发布时间】:2016-01-18 10:46:47
【问题描述】:

使用下面的代码,并使用 pyephem 和 fastkml,我想从 TLE 中提取卫星的地面轨迹。代码如下:

import numpy as np
import ephem
import datetime as dt
from fastkml import kml
from shapely.geometry import Point, LineString, Polygon

name = "ISS (ZARYA)"             
line1 = "1 25544U 98067A   16018.27038796  .00010095  00000-0  15715-3 0  9995"
line2 = "2 25544  51.6427  90.6544 0006335  30.9473  76.2262 15.54535921981506"

tle_rec = ephem.readtle(name, line1, line2)

start_dt = dt.datetime.today()
intervall = dt.timedelta(minutes=1)

timelist = []
for i in range(100):
    timelist.append(start_dt + i*intervall)

positions = []
for t in timelist:
    tle_rec.compute(t)
    positions.append((tle_rec.sublong,tle_rec.sublat,tle_rec.elevation))

k = kml.KML()
ns = '{http://www.opengis.net/kml/2.2}'
p = kml.Placemark(ns, 'Sattrack', 'Test', '100 Minute Track')
p.geometry =  LineString(positions)#, tesselate=1,altitudemode="absolute")
k.append(p)

with open("test.kml", 'w') as kmlfile:
    kmlfile.write(k.to_string())

遗憾的是,当我将 kml 加载到 Google 地球时,轨迹如下所示:

有什么想法会出错吗?

【问题讨论】:

    标签: kml google-earth pyephem


    【解决方案1】:

    您的地面轨迹是一个环绕 0°N(赤道)和 0°E(格林威治以南,几内亚湾附近)位置的环路。这表明您正在使用以弧度表示的角度,最多可以达到大约 6.2 的值,并将它们传递给以度为单位的绘图软件。

    您应该先尝试将它们转换为度数:

    positions.append((tle_rec.sublong / ephem.degree,
                      tle_rec.sublat / ephem.degree,
                      tle_rec.elevation))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-11-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多