Celestia/Tutorials/Stars

This tutorial will describe how to add stars into Celestia. Stars are some of the easiest objects to add to Celestia, because most of them can be simulated as bits of STC code.

To add a star to Celestia, you need a .stc file. This can be created by taking any plain text file (.txt) and renaming the file extension to .stc. This file can be named anything as long as it has the .stc suffix. Then, it should be placed into the "extras" directory (i.e. a folder), or any folder within the "extras" directory.

Now, after you open the .stc file, you need to define a star by writing some code in it with your favorite text editor. Information for many stars can be found in various places, such as SIMBAD or Wikipedia.

Basic definition

edit

The basic definition looks like this:

"Name"
{
	RA <number>
	Dec <number>
	Distance <number>
	SpectralType "<string>"
	AppMag <number>
}

With additional (optional) parameters, it looks like this:

123456 "Name"
{
	RA <number>
	Dec <number>
	Distance <number>
	SpectralType "<string>"
	AppMag <number>
	Texture "texture.*"
	Temperature <number>
	Radius <number>
	SemiAxes [ <number> <number> <number> ]
	UniformRotation {
		Period <number>
		Inclination <number>
		AscendingNode <number>
	}
}

We'll go through the parameters one by one. Let's use the star KIC 8462852 (Boyajian's Star) as an example.

Also, at any point you can add a comment to your .stc code. A comment is started by a # sign and lasts until the next line break. It's a good idea to add comments explaining if you calculated parameters yourself, or if they are guesses.

List of parameters

edit

Name

edit
"Name"

Here, Name is just the name (or names) of the star. If a star has multiple names, separate them with colons (:). Stars in the Hipparcos and Tycho catalogs should also have the catalog number in front of their name(s), like this:

123456 "Name"

Tycho catalog designations have to be concatenated into a single number, so that TYC aaaa-bbbbb-c (zero-padded) becomes cbbbbbaaaa. Boyajian's Star is in the Tycho catalog, with the designation TYC 3162-665-1, so it would look like this:

1006653162 "Boyajian's Star:KIC 8462852"

RA and Dec

edit
	RA <number>
	Dec <number>

These are the right ascension and declination of the star, i.e. the coordinates of the star on the sky. Note that in an STC file, RA is in degrees, unlike a DSC file where it's in hours. Usually the RA will be in hours/minutes/seconds format, and the Dec will be in degrees/arcminutes/arcseconds format. To convert to Celestia's decimal format, use a tool like the RA DEC flexible converter. You can also tell SIMBAD to output decimal coordinates by going to the Output options page and selecting "decimal" from the drop-down menu next to "Coordinates".

Distance

edit
	Distance <number>

The distance to the star in light-years. If you have a parallax instead of a distance, first convert it to parsecs by 1000/parallax, then convert to light-years by multiplying by 3.26156.

SpectralType

edit
	SpectralType "<string>"

This parameter is the spectral type of the star. Spectral types as defined in Celestia have three parts to it: the spectral class, the subclass, and the luminosity class. Spectral types may also have extra symbols for spectral peculiarities, but these are not included in Celestia.

The spectral class is one of these characters/strings: O, B, A, F, G, K, M, L, T, C, R, N, S, WC, WN, D, Q, or X. O through M represent normal stars, with O being the hottest and bluest and M being the coolest and reddest. L and T represent brown dwarfs: objects that are too small to fuse hydrogen (spectral class Y is also implemented in v1.7.0). C, R, and N represent carbon stars: red giant stars with noticeable amounts of carbon in their atmospheres (i.e. greater than oxygen concentrations). S represents a class of star with approximately equal amounts of carbon and oxygen in their atmospheres. WC and WN represent Wolf-Rayet stars (spectral class WO is also implemented in v1.7.0), D (optionally followed by another letter related to the star's spectrum) represents white dwarfs, Q represents neutron stars, and X represents black holes. The number after that modifies the original class: for stars from O to T, a smaller number represents a higher temperature. Finally, a luminosity class is one of these strings: Ia0, Ia, Ib, II, III, IV, V, or VI, with decreasing luminosity. Note that the subclass and the luminosity class may be left blank.

See also: Stellar classification

AppMag or AbsMag

edit
	AppMag <number>

or

	AbsMag <number>

This is the apparent magnitude of the star (how bright it appears from Earth), or the absolute magnitude (how bright it would appear from a distance of 10 parsecs), without extinction (dimming, caused by dust that is blocking light). The AppMag in Celestia corresponds to the V-band magnitude in sources such as SIMBAD.


The above parameters are all that's required to define a star. Here's the basic definition for Boyajian's Star:

1006653162 "Boyajian's Star:KIC 8462852"
{
	RA 301.56438605
	Dec 44.45688635
	Distance 1446.66
	SpectralType "F3V"
	AppMag 11.705
}

Now for the optional parameters...


Texture

edit
	Texture "texture.*"

Textures are essentially maps that are wrapped around spheres. By default, stars use the texture specified in celestia.cfg corresponding to their spectral type, but you can also set a custom texture.

Temperature

edit
 	Temperature <number>

This parameter is the temperature of the star, in degrees Kelvin. It affects the color of the star. It's only supported by Celestia v1.7.0; previous versions will simply ignore it.

Radius

edit
	Radius <number>

This parameter simply refers to the radius of the star, in kilometers. Stellar radii are usually given in solar units; you can convert them to kilometers by multiplying by the Sun's radius in kilometers (695700). If the radius isn't specified, Celestia will calculate it from the star's temperature (from the SpectralType or Temperature parameter) and luminosity (from the AppMag or AbsMag parameter).

 
Example of an oblate star (Regulus) in Celestia.

SemiAxes

edit
	SemiAxes [ <number> <number> <number> ]

This is used for oblate stars, to specify a triaxial ellipsoid shape. The star's radius along each axis is multiplied by the number corresponding to that axis. Values greater than 1 cause some rendering bugs, so it's recommended to only use values equal to or less than 1. The second number is the polar axis, so for an oblate star you want something like SemiAxes [ 1 0.9 1 ].

If you have an oblateness value, the polar semi-axis value can simply be calculated from 1-oblateness.

UniformRotation

edit
	UniformRotation {
		Period <number>
		Inclination <number>
		AscendingNode <number>
	}

This block is for the rotational parameters of the star. The Period parameter is simply how long it takes for a star to rotate once about its axis of rotation. The unit is in hours. For Boyajian's Star, there is a published value: 0.8797 days, or 21.1128 hours.

The Inclination and AscendingNode parameters refer to the orientation of the star's rotation axis, which will be covered in the binary star tutorial.

Example code

edit

For the sake of reference, here is what the final .stc code might look like for Boyajian's Star:

1006653162 "Boyajian's Star:KIC 8462852"
{
	RA 301.56438605
	Dec 44.45688635
	Distance 1446.66
	SpectralType "F3V"
	AppMag 11.705
	Temperature 6750
	Radius 1099206
	UniformRotation {
		Period 21.1128
	}
}