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 檔案中。