跳到內容

Celestia/星資料庫格式

來自華夏公益教科書,開放的書籍,開放的世界
(從 Celestia/雙星檔案 重定向)

另請參閱GitHub上的此頁面

stars.dat檔案包含有關恆星的二進位制格式資訊。位元組順序是小端序。格式如下

一個14位元組的檔案頭

8-byte character string   "CELSTARS"
2-byte unsigned integer   version number = 0x0100
4-byte unsigned integer   number of records in file

後面是長度為20位元組的記錄,格式如下

4-byte unsigned integer   Hipparcos catalog number (=0 for Sol)
4-byte floating point     x-coordinate in light years
4-byte floating point     y-coordinate in light years
4-byte floating point     z-coordinate in light years
2-byte signed integer     absolute magnitude * 256
2-byte unsigned integer   spectral class

x、y和z座標的計算方法如下

其中d是光年距離,θ = RA + 180°,φ = Dec − 90°,ε = 23.4392911°。

光譜型別

[編輯 | 編輯原始碼]

光譜型別用四個十六進位制數字0xKTSL表示。

K位表示物體型別,它們是

K=0   normal star
K=1   white dwarf
K=2   neutron star
K=3   black hole

T位表示光譜型別。它對於普通恆星和白矮星有不同的含義。當物體是中子星或黑洞時,此位被忽略。

      normal stars            white dwarfs
-----------------------------------------------------
T=0   spectral type O         spectral type DA
T=1   spectral type B         spectral type DB
T=2   spectral type A         spectral type DC
T=3   spectral type F         spectral type DO
T=4   spectral type G         spectral type DQ
T=5   spectral type K         spectral type DZ
T=6   spectral type M         unknown spectral type D
T=7   spectral type R         spectral type DX
T=8   spectral type S
T=9   spectral type N
T=a   spectral type WC
T=b   spectral type WN
T=c   unknown spectral type
T=d   spectral type L
T=e   spectral type T
T=f   spectral type C

S位表示光譜亞型。對於中子星和黑洞,此位被忽略。

S=0   spectral subtype 0
S=1   spectral subtype 1
S=2   spectral subtype 2
S=3   spectral subtype 3
S=4   spectral subtype 4
S=5   spectral subtype 5
S=6   spectral subtype 6
S=7   spectral subtype 7
S=8   spectral subtype 8
S=9   spectral subtype 9
S=a   unknown spectral subtype

L位表示光度等級。此位僅與普通恆星相關。

L=0   luminosity class Ia-O
L=1   luminosity class Ia
L=2   luminosity class Ib
L=3   luminosity class II
L=4   luminosity class III
L=5   luminosity class IV
L=6   luminosity class V
L=7   luminosity class VI (also written as prefix sd)
L=8   unknown luminosity class

因此,光譜型別為G2V的恆星使用數字0x0426。

舊格式

[編輯 | 編輯原始碼]

在1.4.0版之前,Celestia使用略微不同的stars.dat格式。

一個4位元組的檔案頭,格式如下

4-byte unsigned integer   number of records

後面是長度為25的記錄

4-byte unsigned integer   Hipparcos catalog number
4-byte unsigned integer   HD catalog number
4-byte floating point     Right Ascension in degrees
4-byte floating point     Declination in degrees
4-byte floating point     Parallax (in milliarcseconds?)
2-byte signed integer     Apparent magnitude * 256
2-byte unsigned integer   Spectral class
1-byte unsigned integer   Parallax error * 200

請注意,對於當前版本的Celestia,HD目錄號儲存在hdxindex.dat檔案中。

華夏公益教科書