在星图上显示 GPS 卫星位置

发布于 2024-12-01 16:20:36 字数 900 浏览 0 评论 0原文

我已经解析了星历数据,以便获取在我当前位置上方可见的卫星的 ECEF(或纬度/经度)位置。我希望在我的 C# 程序中的天空图中显示这些位置。
我在 GUI 中添加了一个图片框,并尝试缩放要显示的 x/y 值,但我不相信所显示的位置是相对于我当前位置的。
有谁有关于如何执行此操作的示例或示例代码吗?
我正在 C# winform 中执行此操作。

private const double CENTER = 110;    //center of drawing (pixels)
private double SCALE_FACTOR = 89.0 / 90.0;  //pixels from 90deg to 0 on drawing
.
.
.
private void drawSatellitePos(int svPrn, double elevation, double azimuth)  //radians
{
    double r = 90.0 - ConvertRadiansToDeg(elevation);
    double theta = 90.0 - ConvertRadiansToDeg(azimuth);
    theta = ConvertDegToRadians(theta);             

    double xLocation = CENTER + SCALE_FACTOR * r * Math.Cos(theta);
    double yLocation = CENTER + SCALE_FACTOR * r * Math.Sin(theta);

    Console.WriteLine("{0}:  x: {1}   Y: {2}", svPrn, xLocation, yLocation);

    Point point = new Point((int)xLocation, (int)yLocation);
}

I have parsed ephemeris data in order to get the ECEF (or lat/long) positions of satellites visible above my current location. I would love to display those locations in a sky plot in my C# program.
I added a picture box to my GUI and attempted to scale the x/y values to display but i don't believe the locations that are being displayed are relative to my current location.
Does anyone have any examples or sample code on how to do this?
I'm doing it in a C# winform.

private const double CENTER = 110;    //center of drawing (pixels)
private double SCALE_FACTOR = 89.0 / 90.0;  //pixels from 90deg to 0 on drawing
.
.
.
private void drawSatellitePos(int svPrn, double elevation, double azimuth)  //radians
{
    double r = 90.0 - ConvertRadiansToDeg(elevation);
    double theta = 90.0 - ConvertRadiansToDeg(azimuth);
    theta = ConvertDegToRadians(theta);             

    double xLocation = CENTER + SCALE_FACTOR * r * Math.Cos(theta);
    double yLocation = CENTER + SCALE_FACTOR * r * Math.Sin(theta);

    Console.WriteLine("{0}:  x: {1}   Y: {2}", svPrn, xLocation, yLocation);

    Point point = new Point((int)xLocation, (int)yLocation);
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

颜漓半夏 2024-12-08 16:20:36

celestrak.com 的 TS Kelso 有一篇关于卫星跟踪和轨道的精彩系列文章
坐标系。 本文介绍了如何将卫星位置转换为
特定地点(地心)坐标。 (您可能需要将您的
从 ECEF 坐标(纬度/经度,随地球旋转)到 ECI(惯性
坐标,相对于星星固定)以使用凯尔索公式。

基本思想是计算给定位置的卫星和观察者位置
ECI 坐标中的瞬时,然后定义“东”、“北”和“上”基向量
对于该时刻的特定地点坐标系(考虑到地球的
扁率),然后将卫星位置转换为视角(方位角和
从观测地点看到的海拔(或赤经和赤纬)。

T.S. Kelso of celestrak.com has an excellent series of articles on satellite tracking and orbital
coordinate systems. This article explains how to convert satellite positions to
site-specific (topocentric) coordinates. (You'll probably need to convert your
ephemeris from ECEF coordinates (lat/long, rotates with earth) to ECI (inertial
coordinates, fixed with respect to the stars) to use Kelso's formulas.

The basic idea is to compute both the satellite and observer positions at a given
instant in ECI coordinates, then define the "east", "north", and "up" basis vectors
for the site-specific coordinate system at that instant (accounting for the earth's
oblateness), then convert the satellite position into look angles (azimuth and
elevation, or right ascension and declination) as seen from the observing site.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文