Page 1 of 1

The stars.dat file (the thread)

Posted: 26.10.2004, 14:59
by Aphex_Twin
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...)?

Posted: 26.10.2004, 15:31
by selden
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.

Posted: 26.10.2004, 15:54
by Guest
I want to fiddle with it, build an HR diagram search for statistically interesting things.

Posted: 26.10.2004, 16:04
by symaski62
:( CVS stars.dat

celestia.exe ERROR :evil:


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

error

mais :evil: stars.dat !!

Posted: 26.10.2004, 16:41
by selden
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

Posted: 26.10.2004, 22:14
by symaski62
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 ????? :?

Posted: 26.10.2004, 22:25
by selden
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 ?

Posted: 26.10.2004, 22:56
by symaski62
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

Posted: 27.10.2004, 09:35
by Aphex
Ok, so where can I find a detailed description of the stars.dat file format for celestia 1.3.2?

Posted: 27.10.2004, 10:16
by piellepi
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

Posted: 27.10.2004, 10:38
by selden
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());