Finding stars in a narrow section of sky

All about writing scripts for Celestia in Lua and the .cel system
Avatar
Topic author
Chuft-Captain
Posts: 1767
Joined: 18.12.2005
With us: 13 years 6 months

Finding stars in a narrow section of sky

Post #1by Chuft-Captain » 11.02.2013, 00:58

Does anyone know of any celX method(s) that would enable the efficient identification of all stars in a narrow section of sky (let's say a 1 deg FOV) out to a specified distance?
Imagine pointing the hubble space telescope at an empty section of sky... how can we find out which stars (perhaps too faint or distant to be rendered) are in that cone of space out to thousands or even millions of parsecs.

By "efficient", I mean fast enough to execute within a render cycle. ie, without iterating through celestia:stars()

I believe that internally Celestia must have efficient "location aware" data-structures / methods which would allow this, but I don't believe they are exposed to CELX.
For example, when moving or rotating the observer, Celestia clearly knows which stars are in the FOV and is able to re-calculate and re-display their positions in real time, without processing the entire stars database on each render-cycle.
"Is a planetary surface the right place for an expanding technological civilization?"
-- Gerard K. O'Neill (1969)

CATALOG SYNTAX HIGHLIGHTING TOOLS LAGRANGE POINTS

ngx
Posts: 4
Joined: 08.10.2011
With us: 7 years 8 months
Location: Slovakia

Re: Finding stars in a narrow section of sky

Post #2by ngx » 21.04.2013, 07:27

Hi,

i was looking for something simmilar some time ago, but unfortunately, so far i didn't find any other method than scanning through the all stars at least once. I cannot be sure, becouse i didn't study the code, but I think Celestia could have the object's name defined as a particular object attribute, so it would be displayed if you get close to the object or the object is in the visible area. The proximity and visibility status would be provided to the object by a graphical engine, so basically observer wouldn'n need to know objects positions, each object would know observer's position (and camera) instead.

I was thinking about something like this: As far as i know, the only way for .celx to obtain celestia's star data (including position) is getting star object by it's internal number (correct me if i'm wrong). If you mark big amount of stars in a sequence, you can see that they are not positioned randomly, they are positioned in some "blocks". It means that there has to be some order which, i believe, can be somehow addressed by your position and your view angle. After some analysis you could divide the star's database into some positioned sectors, in example celestial north, south, 0-90,90-180 degrees etc. Then you could narrow your search only to some few numbers in certain intervals designated by your position and heading. In example, if you are heading north, with view within 20 - 110 degrees you wouldn't scan southern parts of the galaxy and 180 - 270 quorter (and rest two of course...). If the area is narrow enough, scan could be accomplished in a tick or two. You could also print out the file with already analysed index data and create an initial static (probably quite big) data table out of it. The data table would be loaded - much faster than the scan - on the script start.

Of course this attitude has also drawbacks:
First, you would anyway have to scan the whole database in the beginning to get initial star position data, only after this scan and the analysis part you could use faster position based methods.

Then second, observer's position change would be a bit tricky to avoid need for complete re-scan with each move. Again, maybe pre-created data table would help it. Then, observer's move vector would have to be re-computed with each move within celestia's coordinates system.

Anyway, if you find some good method, please post it, i'd be interested. Thanx!


Return to “Scripting”

Who is online

Users browsing this forum: 1 guest