有效地绘制星图 [英] Plotting a star chart efficiently

查看:275
本文介绍了有效地绘制星图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想以可视化的形式显示可以包含成千上万个条目的天文星表。目录通常只包含一个恒星列表,以及每个恒星的球坐标和其他数据。球坐标系指右上角(0-360度或0-24小时)和偏角(-90度至+90度)。这对应于经度和纬度,只是在天球而不是地球的表面上。

I'd like to visualize astronomical star catalogues that can contain hundreds of thousands of entries. The catalogues usually consist of simply a list of stars, with spherical coordinates and other data for each star. By spherical coordinates I mean right ascension (0-360 degrees or 0-24 hours) and declination (-90 degrees to +90 degrees). This corresponds to longitude and latitude, just on the celestial sphere instead of Earth's surface.

我想绘制目录中位于特定星体内部的所有恒星视场,由中心(以球坐标表示),视场的大小(以度为单位)和投影(例如,立体投影)定义。

I'd like to plot all the stars in the catalogue that are located inside a certain field of view, defined by the center (in spherical coordinates) and the size of the field of view (in degrees) and the projection (e.g. stereographic projection).

绘制通过查看整个目录并仅检查每个恒星是否在视场之内来对恒星进行效率非常低。

Plotting the stars by going through the whole catalogue and just checking whether each star is inside the field of view or not is very inefficient.

我该如何做得更多有效率吗?

推荐答案


  1. 对于现代的gfx卡,仍然可以管理300K(及以上)星号...

因此您可以尝试加载它们都以VBO / VAO的形式存在gfx中,而仅将渲染/剪切保留为gfx。我以这种方式使用 Hipparcos(118322星)而没有问题,而每个星都是透明的四边形。您只需要预先计算四边形即可在渲染之前查看位置(仅一次)。这是我其中一个应用的屏幕截图,其中 Hipparcos 以这种方式用作背景星标(在RT中)

So you can try to load them all to gfx as VBO/VAO and leave the render/clipping to gfx alone. I use Hipparcos (118322 stars) in this way without problems while each star is a transparent Quad. You just need to pre-compute the quads to view position prior to rendering (just once). Here screenshot from one of my apps where Hipparcos is used in this manner as background stars (in RT)

您还可以使用几何着色器来简化很多事情(可以只发送点,甚至发送 Ra,Dec,Distance 而不是Quads),但这会将目标gfx硬件限制为仅支持那些几何着色器。

You can also use geometry shaders to ease up things a lot (can send just points or even Ra,Dec,Distance instead of Quads) but this will limit your Target gfx HW to only those supporting geometry shaders.

如果您有更多的星星那么您的硬件就可以处理然后使用排序后的数据集

大多数目录按 Ra或Dec 进行排序。您可以通过以下方式使用它:

Most catalogs are sorted by Ra or Dec. You can use this by:


  1. 选择视图区域 min(Ra,Dec),max(Ra ,Dec)

  2. 让我们假设您的数据按 Ra 升序排序

  3. 先找到 i0 ,其中star [i0] .Ra> = min.Ra


    • 使用二进制搜索!!!

  1. select view area min(Ra,Dec),max(Ra,Dec)
  2. let assume your data is sorted by Ra ascending
  3. find first i0 where star[i0].Ra>=min.Ra
    • use binary search !!!

  • 使用二进制搜索!!!

测试 min.Dec< = star [i] .Dec < =最大值Dec ,如果是,则将其渲染。

test if min.Dec <= star[i].Dec <= max.Dec and if yes then render it.

即使速度不够快,您也需要使用空间细分

将数据集划分为较小的数据集。在根据选定的视图区域进行渲染之前,仅使用该区域附近的数据集。这将大大降低处理的数据量。

So divide your dataset to smaller ones. And prior to rendering according to selected view area use only datasets near that area. This will lower the amound of data processed significantly.

这篇关于有效地绘制星图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆