Hi Guys,
The attachment is a csv data file describing the location and brightness of 15448 stars. The original file was over 20 megs and contained lots of data about 119000 stars. I extracted only the brightest stars, of magnitude 7 or brighter.
The program uses a few functions from the Enhancements pack to access fields in the csv file. Naturally, you would have to edit the path shown in line 9 where I have "E:\TFF\shortlist.csv" to the path where you place the attached file.
All I do is create triangle objects whose size and brightness are based on the magnitude of each star. I only have it loading the first 5000 stars because creating 15000 objects is just too much for my system. It was taking over 30 seconds just to start up, but with 5000, it starts up in seconds. You can change the "for star =" loop to "5000 to 10000" or "10000 to 15000" to see other parts of the sky.
Its fun to scroll around on because the data is real and you will recognize some constellations pretty clearly. Orion is easy to spot. I have left & right arrow keys and page up and page down to scroll around and up & down arrow keys to zoom in and out. Q quits or just hit escape.
The point of this exercise was just to see if I could access the data and turn it into something recognizable. Next, I'd like to figure out how to set them up in a realistic 3d space. The original database has distance, colortype and all sorts of other data.
If you're interested the original 20 meg dataset can be downloaded here:
http://astronexus.com/files/downloads/hygxyz.csv.gz
Rem Project: Astro
Rem Created: Thursday, November 14, 2013
Rem ***** Main Source File *****
Separator$ = ","
g = 60 : g2 = g/2
OPEN DATA FILE "E:\TFF\shortlist.csv", Separator$, 1
rem Stars = GET DATA FILE ROW COUNT( 1 )
For star = 1 to 5000
MAG$ = GET DATA FILE CELL( 1, 1, star )
M = Val(MAG$)+2 : size = (8-M)*3
C = Int(255-(M*40))
RA$ = GET DATA FILE CELL( 1, 2, star )
DEC$ = GET DATA FILE CELL( 1, 3, star )
x = -(val(ra$)*300)+800
y = (val(dec$)*24)-250
Make Object Triangle star,0,0,0,size,size,0,0,size,0
Color Object star,rgb(C,C,C)
Position Object star,x,y,1500
Next star
CLOSE DATA FILE 1
Make camera 1
Backdrop on
color backdrop 1,rgb(0,0,0)
Do
If scancode() = 16 then exit
If scancode() = 203 then xa = xa - g
If scancode() = 205 then xa = xa + g
If scancode() = 201 then ya = ya + g2
If scancode() = 209 then ya = ya - g2
If scancode() = 200 then za = za + g
If scancode() = 208 then za = za - g
Position Camera 1,xa,ya,za
sync
winapi sleep 20
loop
End
The answer to Life, the Universe, and Everything? "Tea for Two". Deep Thought was Dyslexic.