Celestia uses *.dat-files as basic database for stars (stars.dat).
Can anybody tell me the structure of .dat-files?
Is an editor available?
Thanx in front,
Malachias
structure of or editor for *.dat files
-
- Developer
- Posts: 1863
- Joined: 21.11.2002
- With us: 22 years 3 months
First 4 bytes: number of records as a long integer
Each record thereafter occupies 25 bytes, as follows.
Hipparcos catalogue number: 4 bytes, long integer
HD catalogue number: 4 bytes, long integer (value -1 if no HD number)
Right ascension (hours): 4 bytes, floating point
Declination (degrees): 4 bytes, floating point
Parallax (milliarcseconds): 4 bytes, floating point
Apparent magnitude*256: 2 bytes, short integer
Spectral & Luminosity classes: 2 bytes, coded as four nybbles (see below)
Parallax error (?): 1 byte, not at present used by Celestia
The nybbles are coded as follows:
Nybble 1 (star type)
0: Main sequence / giant / supergiant
1: White dwarf
2: Neutron star
3: Black hole
Nybble 2 (spectral class)
0: O
1: B
2: A
3: F
4: G
5: K
6: M
7: R
8: S
9: N
10: WC
11: WN
Nybble 3 (spectral subclass)
0-9
Nybble 4 (luminosity class)
0: Ia-0
1: Ia
2: 1b
3: II
4: III
5: IV
6: V
7: VI
Chris has recently added support for spectral classes L and T to Celestia, but I don't know if that has also been added to the code that interprets stars.dat.
The nybble info above comes from T Guilpain's Celestia page at http://members.fortunecity.com/guilpain/index_uk.htm, the link to "Stars.dat". Several things on that page seem like they're mistaken to me (although it might just be my French letting me down) but I can confirm that much of the nybble data above are correct - although I haven't run into any neutron stars, black holes or the more exotic spectral classes.
When read as a string into Windows, Guilpain's nybbles 1 & 2 appear after nybbles 3 & 4 - it'll be a big-endian/little-endian thing, no doubt
.
Grant
Each record thereafter occupies 25 bytes, as follows.
Hipparcos catalogue number: 4 bytes, long integer
HD catalogue number: 4 bytes, long integer (value -1 if no HD number)
Right ascension (hours): 4 bytes, floating point
Declination (degrees): 4 bytes, floating point
Parallax (milliarcseconds): 4 bytes, floating point
Apparent magnitude*256: 2 bytes, short integer
Spectral & Luminosity classes: 2 bytes, coded as four nybbles (see below)
Parallax error (?): 1 byte, not at present used by Celestia
The nybbles are coded as follows:
Nybble 1 (star type)
0: Main sequence / giant / supergiant
1: White dwarf
2: Neutron star
3: Black hole
Nybble 2 (spectral class)
0: O
1: B
2: A
3: F
4: G
5: K
6: M
7: R
8: S
9: N
10: WC
11: WN
Nybble 3 (spectral subclass)
0-9
Nybble 4 (luminosity class)
0: Ia-0
1: Ia
2: 1b
3: II
4: III
5: IV
6: V
7: VI
Chris has recently added support for spectral classes L and T to Celestia, but I don't know if that has also been added to the code that interprets stars.dat.
The nybble info above comes from T Guilpain's Celestia page at http://members.fortunecity.com/guilpain/index_uk.htm, the link to "Stars.dat". Several things on that page seem like they're mistaken to me (although it might just be my French letting me down) but I can confirm that much of the nybble data above are correct - although I haven't run into any neutron stars, black holes or the more exotic spectral classes.
When read as a string into Windows, Guilpain's nybbles 1 & 2 appear after nybbles 3 & 4 - it'll be a big-endian/little-endian thing, no doubt

Grant
Last edited by granthutchison on 21.07.2003, 21:01, edited 2 times in total.
-
- Developer
- Posts: 1863
- Joined: 21.11.2002
- With us: 22 years 3 months
-
- Site Admin
- Posts: 4211
- Joined: 28.01.2002
- With us: 23 years 1 month
- Location: Seattle, Washington, USA
granthutchison wrote:Thanks! And 12 is reserved for stars with unknown spectral class?chris wrote:The brown dwarf types L and T are represented by nibble 2 values of 13 and 14, respectively.
Grant
Yes . . . And that leaves just one value left for any new spectral types. Though we could always appropriate another one of the star type values to get another 16 spectral types.
--Chris
-
- Posts: 1386
- Joined: 06.06.2003
- With us: 21 years 8 months
chris wrote:The brown dwarf types L and T are represented by nibble 2 values of 13 and 14, respectively.
--Chris
Chris, if you're after brown dwarf textures, have you seen this site?
http://spider.ipac.caltech.edu/staff/da ... rison.html
Should give you some ideas - there's a fair bit of difference in appearance between L dwarfs and T dwarfs.
-
- Posts: 1386
- Joined: 06.06.2003
- With us: 21 years 8 months
chris wrote:I hadn't seen that before . . . thanks for the link!
No prob. Though BDs are pretty complicated beasties, they look more like M-type stars in the first few hundred million years of their lives, and then cool down through L and then T after core fusion stops. So if you ever want to include the system age, you'd have to take that evolution into account.
If you want more technical info on this, check out:
The Theory of Brown Dwarfs and Extrasolar Giant Planets, Burrows et al., Reviews of Modern Physics, volume 73, 719-765 (2001).
( http://zenith.as.arizona.edu/~burrows/p ... -final.pdf )
-
- Developer
- Posts: 1863
- Joined: 21.11.2002
- With us: 22 years 3 months
Makes me think about white dwarf spectra, which are complicated by having old and new styles. From a quick glance through, Hipparcos seems to provide only old-style data, but we'd need new style in order to know the temperaturechris wrote:Yes . . . And that leaves just one value left for any new spectral types. Though we could always appropriate another one of the star type values to get another 16 spectral types.

But Nybbles 2 3 & 4 could accommodate almost all the necessary information for both spectral styles, if their interpretation was different when Nybble 1 indicates a white dwarf. Something like:
Nybble 2 (spectral class)
0: O
1: B
2: A
3: F
4: G
5: K
6: M
7: C
8: Z
9: Q
10: P
11: H
12: ?
13:X
14:V
Nybble 3 (optional secondary spectral class information)
(Same as 2 but 12 indicates a null value)
Nybble 4 (temperature code)
0-15
I guess it would be possible to automate the task of extracting new-style spectral data for Hipparcos objects from a white dwarf database, and slotting them into the current format of stars.dat.
The temperature of the white dwarf could be extracted as either 50400 divided by the temperature code, or some (very broad

Grant
-
- Site Admin
- Posts: 4211
- Joined: 28.01.2002
- With us: 23 years 1 month
- Location: Seattle, Washington, USA
granthutchison wrote:I guess it would be possible to automate the task of extracting new-style spectral data for Hipparcos objects from a white dwarf database, and slotting them into the current format of stars.dat.
The temperature of the white dwarf could be extracted as either 50400 divided by the temperature code, or some (very broad) temperature estimate based on the old spectral class.
So what is the new style?
There are lots of options . . . there's nothing that says that the various nibble's need to have exactly the same meaning for every type of star. We could use 12 bits for the temperature of a white dwarf, for example.
--Chris
-
- Developer
- Posts: 1863
- Joined: 21.11.2002
- With us: 22 years 3 months
Old style was simply DO, DB, DA etc, matching spectral characteristics of the dwarfs to corresponding spectral characteristics on the main sequence. But there was a realisation that in evolved stars like white dwarfs the spectral characteristics didn't have the same correlation with temperature that they did in the main sequence. So the new spectral classes provide spectral information and temperature information separately:
DA: H
DB: He I
DC: continuous spectrum
DO: He II + He I or H
DZ: metals present
DQ: carbon present
DP: magnetic stars with polarized light
DH: magnetic stars without polarized light
DX: peculiar or unclassifiable
DV: variable
For stars with multiple features you can add letters together, so that
you'll see DAZ, DQP, DXV and so on. Three letters are permitted, but seem to be pretty rare - only one instance caught my eye while leafing through the WD list in Lang's Astrophysical Data: Planets and Stars.
Temperature information is given by adding a number to the spectral class - the temperature having been deduced from other properties of the spectrum apart from the mere strength of the lines. The number used is the nearest integer to 50400/T. Since the coolest white dwarfs are probably below 4000K, this would mean that the temperature number could go up to 13 or so.
So the full spectral info might be something like: DXP9.
Backward compatibility with the previous method of spectral classification led me to leave the O-M sequence undisturbed above and simply tack the necessary new letters on to the end of the sequence.
I doubt if it would be worth trying to cater for the rare third spectral letter - if it's omitted, the spectrum would be no less inaccurate than the main sequence stars for which Celestia currently trims off e's and p's or rounds to the nearest whole-number subclass.
Grant
DA: H
DB: He I
DC: continuous spectrum
DO: He II + He I or H
DZ: metals present
DQ: carbon present
DP: magnetic stars with polarized light
DH: magnetic stars without polarized light
DX: peculiar or unclassifiable
DV: variable
For stars with multiple features you can add letters together, so that
you'll see DAZ, DQP, DXV and so on. Three letters are permitted, but seem to be pretty rare - only one instance caught my eye while leafing through the WD list in Lang's Astrophysical Data: Planets and Stars.
Temperature information is given by adding a number to the spectral class - the temperature having been deduced from other properties of the spectrum apart from the mere strength of the lines. The number used is the nearest integer to 50400/T. Since the coolest white dwarfs are probably below 4000K, this would mean that the temperature number could go up to 13 or so.
So the full spectral info might be something like: DXP9.
Backward compatibility with the previous method of spectral classification led me to leave the O-M sequence undisturbed above and simply tack the necessary new letters on to the end of the sequence.
I doubt if it would be worth trying to cater for the rare third spectral letter - if it's omitted, the spectrum would be no less inaccurate than the main sequence stars for which Celestia currently trims off e's and p's or rounds to the nearest whole-number subclass.
Grant