Skip to content

Star Database binary format

Hleb Valoshka edited this page Feb 9, 2021 · 2 revisions

Star database contains data stored in Lower Endian bytes order.

Current database format, version 0100h

Description C Type Size, bytes
Header
Magic char[] 8 CELSTARS
Version uint16_t 2 0100h
Number of stars uint32_t 4
Data chunks
Catalogue number uint32_t 4 Number in a catalog
X position float 4
Y position float 4
Z position float 4
Abs magnitude int16_t 2 absMag * 256
Spectral type uint16_t 2 Packed value, see below

Spectral type consists of 4 values packed into a 16 bit integer, every value has length 4 bits.

F E D C B A 9 8 7 6 5 4 3 2 1 0
Star type Spectral type Subclass Luminosity class

In case of DB version 0200h star and spectral types have different width:

F E D C B A 9 8 7 6 5 4 3 2 1 0
Star type Spectral type Subclass Luminosity class

We have 4 star types, 24 spectral types (0 – 15 are Normal stars, 16 – 23 are White dwarves), 10 subclasses, 8 luminosity classes. In case of White dwarves a value written is (value & 0xf).

So current database doesn’t support addition of new Normal stars.