The stars.dat file (the thread)

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
Aphex_Twin

The stars.dat file (the thread)

Post #1by Aphex_Twin » 26.10.2004, 14:59

I've been fiddling with the said file and some questions cropped up.

As it sais in the readme.txt:

the first 4 bytes are an integer value of the number of stars in the database

Following are:

1) 4 byte int - catalogue number
2) 4 byte float - right ascension
3) 4 byte float - declination
4) 4 byte float - parallax
5) 2 byte int - apparent magnitude
6) 2 byte int - stellar class
7) 1 byte - parallax error

Now the first time I plugged in the numbers I received plausible numbers for star number and the catalogue number of the first star, from then on bogus informations. After a few frustrating moments I decided to skip a few bytes here and there. Apparently, there is another 4 byte segment between 1) and 2).

Questions:
What comes between 1) and 2) ?
What are the specific units of measurement of the variables (RA, DEC, PARALLAX...)?

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #2by selden » 26.10.2004, 15:31

Aphex_Twin,

You might want to consider registering so you can edit and/or delete your posts. No personal information is required.

What do you want to do with stars.dat?

If you're just interested in the information that it contains, you probably should download the text version of the file, which is available at http://cvs.sourceforge.net/viewcvs.py/celestia/celestia/data/stars.txt?rev=1.1&view=log.

The format of the binary file is quite different in the next version of Celestia.
Selden

Guest

Post #3by Guest » 26.10.2004, 15:54

I want to fiddle with it, build an HR diagram search for statistically interesting things.

symaski62
Posts: 610
Joined: 01.05.2004
Age: 41
With us: 20 years 6 months
Location: france, divion

Post #4by symaski62 » 26.10.2004, 16:04

:( CVS stars.dat

celestia.exe ERROR :evil:


http://cvs.sourceforge.net/viewcvs.py/c ... /stars.dat

error

mais :evil: stars.dat !!
windows 10 directX 12 version
celestia 1.7.0 64 bits
with a general handicap of 80% and it makes much d' efforts for the community and s' expimer, thank you d' to be understanding.

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #5by selden » 26.10.2004, 16:41

symaski62,

As you've been told several times, the most recent versions of stars.dat (v1.19 - v1.21) are in the new format. Right now you need to rebuild Celestia from the CVS source code archive in order to be able to use it. The text file corresponding to v1.21 is available from SourceForge's CVS server. Hopefully a Windows PreRelease of the next version of Celestia (using the new file) will be available in the not too distant future.

stars.dat v1.18 is in the old format. The old format is what is used by Celestia v1.3.2 and previous versions. Unfortunately, the text file corresponding to v1.18 is not available from SourceForge's CVS server.

Aphex,

You might want to investigate MostlyHarmless. It's a variant of Celestia which includes SQL. See http://mostlyharmless.sourceforge.net/index.htm
Selden

symaski62
Posts: 610
Joined: 01.05.2004
Age: 41
With us: 20 years 6 months
Location: france, divion

Post #6by symaski62 » 26.10.2004, 22:14

CVS...
stars.dat V1.18 granthutchison :) 8) => 2.74Mo
stars.dat V1.19 cjlaurel :evil: ERROR => 2.14Mo
stars.dat V1.20 cjlaurel :evil: ERROR => 2.14Mo
stars.dat V1.21 granthutchison :evil: ERROR => 2.14Mo


http://mostlyharmless.sourceforge.net/index.htm
downloads ????? :?
windows 10 directX 12 version
celestia 1.7.0 64 bits
with a general handicap of 80% and it makes much d' efforts for the community and s' expimer, thank you d' to be understanding.

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #7by selden » 26.10.2004, 22:25

Je r?p?te:

stars.dat v1.18 est pour Celestia v1.3.2
Il n'est pas pour v1.4.0

stars.dat v1.21 est pour Celestia v1.4.0
Il n'est pas pour v1.3.2

Que ne comprenez-vous pas ?
Selden

symaski62
Posts: 610
Joined: 01.05.2004
Age: 41
With us: 20 years 6 months
Location: france, divion

Post #8by symaski62 » 26.10.2004, 22:56

selden wrote:Je r?p?te:

stars.dat v1.18 est pour Celestia v1.3.2
Il n'est pas pour v1.4.0

stars.dat v1.21 est pour Celestia v1.4.0
Il n'est pas pour v1.3.2

Que ne comprenez-vous pas ?


http://www.celestiaproject.net/forum/viewtopic ... 4466#44466

je fait !! merci
windows 10 directX 12 version
celestia 1.7.0 64 bits
with a general handicap of 80% and it makes much d' efforts for the community and s' expimer, thank you d' to be understanding.

Aphex

Post #9by Aphex » 27.10.2004, 09:35

Ok, so where can I find a detailed description of the stars.dat file format for celestia 1.3.2?

Avatar
piellepi M
Posts: 124
Joined: 25.09.2003
Age: 69
With us: 21 years 2 months
Location: Rome, Italy

Post #10by piellepi » 27.10.2004, 10:16

Hi Celestians!

As an old programmer I would have suggested (but I always fogot :( ) to rename the file stars.dat for the new version of Celestia. :D
This is a rule of thumb when , during the development of a program, it happens that ancillary files need a thorough revision, making old versions inconsistent with the new one: the easiest thing to do is to rename the file and/or its extention, without bothering about version numbers :roll: .

BTW files with ".dat" extension in my PC are related to M$ Multimedia Player!
Personally I don't like ".dat" extension: in my >20 years old computer carreer I encountered tons of different files with such an extention: obviously no one was correlated to the others 8O .
Some of them were binary, others were textual, and other were mixed binary-textual: I don't bother knowing about Multimedia Player files :? .

Thanks for your attention
Pierluigi

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #11by selden » 27.10.2004, 10:38

Aphex,

You'll have to peruse the code.

The sourcecode for the program which creates the binary database file is at http://cvs.sourceforge.net/viewcvs.py/celestia/celestia/src/tools/stardb/makestardb.cpp?rev=1.6&view=log

Briefly, here's the code fragment which writes an entry:

Code: Select all

        writeUint(out, catalogNumber);
        writeFloat(out, x);
        writeFloat(out, y);
        writeFloat(out, z);
        writeShort(out, (int16) (absMag * 256.0f));
        writeUshort(out, sc.pack());
Selden


Return to “Development”