{"id":626,"date":"2016-10-30T20:18:28","date_gmt":"2016-10-30T20:18:28","guid":{"rendered":"http:\/\/spaceengine.org\/?page_id=626"},"modified":"2017-04-19T10:19:14","modified_gmt":"2017-04-19T10:19:14","slug":"creating-a-star","status":"publish","type":"page","link":"https:\/\/spaceengine.org\/manual\/making-addons\/creating-a-star\/","title":{"rendered":"Creating a star"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row row_type=\"row\" use_row_as_full_screen_section=\"no\" type=\"full_width\" text_align=\"left\" box_shadow_on_row=\"no\"][vc_column][no_accordion active_tab=\"1\" background_transparency=\"no\" style=\"boxed_accordion\"][no_accordion_section title=\"Creating a star\" accordion_type=\"accordion_icon\" icon_pack=\"font_elegant\" fe_icon=\"icon_cog\"][vc_column_text]This manual describes how to add a star to SpaceEngine. Before continuing, it is recommended you read this manual: <a class=\"link\" href=\"http:\/\/spaceengine.org\/manual\/making-addons\/introduction\/\" target=\"_blank\" rel=\"nofollow\">Introduction<\/a>.<\/p>\n<p>The majority of stars in the default SpaceEngine installation are stored in the csv file <span class=\"se_path\">data\/catalogs\/<\/span><span class=\"se_pak\">Catalogs0980.pak\/stars\/HIPPARCOS.csv<\/span>. This is the HIPPARCOS star catalog with about 110,000 stars. Other stars, including binary systems, are stored in multiple sc files in the same system pak file. These default files should not be modified or changed in any way. If you want to update a star, remove it, or add a new one, create your own sc or csv file in the <span class=\"se_path\">addons\/catalogs\/stars\/<\/span> folder. SpaceEngine has scripting options to modify and remove stars or other objects from the default catalogs, or to add a new ones.<\/p>\n<p>The csv format for catalogs is designed to create large catalogs of objects with similar data. It is more compact and loads faster than sc, but has limits to the types of data which can be specified in it. It is just a table with values separated by commas. The sc format is designed to specify all the possible data which SE can use to describe an object. It is a script-like text with 'tags' used to describe an object (star or star system in this tutorial) and its various parameters. First we'll describe the sc file format.<\/p>\n<h4 class=\"se_h4\">The star catalog<\/h4>\n<p>Let's consider that you want to create a new solitary star called \"Mono\", a black hole with accretion disk called \"Hole\", and a binary star system called \"Bin\", which contains two stars \"Bin A\" and \"Bin B\". Lets consider that stars \"Bin A\" and \"Bin B\" are described already in some catalog as solitary stars, and you want to delete them to create a proper binary star system with orbits for each component. Go to the <span class=\"se_path\">addons\/catalogs\/stars\/<\/span> directory (create it if it does not exist) and create a new text document there. Rename it to <span class=\"se_path\">mystars.sc<\/span> (the file name doesn't matter, but make sure it doesn't match some existing file, otherwise your file <a class=\"link\" href=\"http:\/\/spaceengine.org\/manual\/making-addons\/introduction\/\" target=\"_blank\" rel=\"nofollow\">will override<\/a> it). Open it in Notepad and type this code:<\/p>\n<div class=\"bbCodeBlock\">\n<div class=\"bbCodeName\" style=\"padding-left: 5px; font-weight: bold; font-size: 7pt;\">Code<\/div>\n<div class=\"se_code\" style=\"border: 1px inset; max-height: 200px; overflow: auto; height: 200px;\">\/\/ Creates a new object - a solitary star.<br \/>\nStar\u00a0\u00a0\u00a0\u00a0\"Mono\"<br \/>\n{<\/p>\n<div class=\"codepaddingleft \">\nRA\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a016 10 45\u00a0\u00a0\/\/ right ascension<br \/>\nDec\u00a0\u00a0\u00a0\u00a0\u00a0-25 12 11\u00a0\u00a0\/\/ declination<br \/>\nDist\u00a0\u00a0\u00a0\u00a0\u00a0100.0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ distance from the Sun<br \/>\nClass\u00a0\u00a0\u00a0\"G5V\"\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ spectral class<br \/>\nLum\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.86\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ luminosity, or<br \/>\n\/\/AbsMagn\u00a0\u00a05.31\u00a0\u00a0\u00a0\u00a0\/\/ absolute magnitude, or<br \/>\n\/\/AppMagn\u00a0\u00a010.31\u00a0\u00a0\u00a0\/\/ apparent magnitude<br \/>\nRadSol\u00a0\u00a0\u00a00.95\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ radius in Solar radii<br \/>\nMassSol\u00a0\u00a00.91\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ mass in Solar masses<br \/>\nTeff\u00a0\u00a0\u00a0\u00a0\u00a05200\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ surface temperature in Kelvin\n<\/div>\n<p>}<br \/>\n\/\/ Creates a new object - a solitary star (black hole) with extra<br \/>\n\/\/ parameters (accretion disk) in the planets catalog. Note<br \/>\n\/\/ that its name here is \"Hole system\", see why below.<br \/>\nStarBarycenter\u00a0\u00a0\u00a0\u00a0\"Hole system\"<br \/>\n{<\/p>\n<div class=\"codepaddingleft \">\nRA\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a009 31 14\u00a0\u00a0\/\/ right ascension<br \/>\nDec\u00a0\u00a0\u00a0\u00a0\u00a0\u00a064 16 38\u00a0\u00a0\/\/ declination<br \/>\nDist\u00a0\u00a0\u00a0\u00a0\u00a0250.0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ distance from the Sun<br \/>\nClass\u00a0\u00a0\u00a0\"X\"\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ spectral class - black hole<br \/>\nLum\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0150\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ luminosity of the whole system (accretion disk)\/\/ That's enough, accretion disks will be described in the planets catalog (see below).\n<\/div>\n<p>}<\/p>\n<p>\/\/ Removes solitary stars from the older catalogs.<br \/>\nRemove \"Bin A\"<br \/>\nRemove \"Bin B\"<\/p>\n<p>\/\/ Creates a new object - a barycenter of a binary star system,<br \/>\n\/\/ which components will be described in the planets catalog (see below).<br \/>\nStarBarycenter\u00a0\u00a0\u00a0\u00a0\"Bin\"<br \/>\n{<\/p>\n<div class=\"codepaddingleft \">\nRA\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a019 50 18\u00a0\u00a0\/\/ right ascension<br \/>\nDec\u00a0\u00a0\u00a0\u00a0\u00a0\u00a028 18 47\u00a0\u00a0\/\/ declination<br \/>\nDist\u00a0\u00a0\u00a0\u00a0\u00a0251.652\u00a0\u00a0\u00a0\/\/ distance from the Sun<\/p>\n<p>\/\/ That's enough, the StarBarycenter tag doesn't need the other parameters (see below).\n<\/p><\/div>\n<p>}\n<\/p><\/div>\n<\/div>\n<p>To add a new star or modify a star which has been already described in the catalogs, simply define a new object (<span class=\"se_script\">Star<\/span> or <span class=\"se_script\">StarBarycenter<\/span>) with the same name in the star script. SpaceEngine will update the old star with the new data (it's also possible to change its type - from <span class=\"se_script\">Star<\/span> to <span class=\"se_script\">StarBarycenter<\/span> and back).<\/p>\n<p>To remove a star from the catalogs, use the <span class=\"se_script\">Remove<\/span> parameter with the name of that star. This is useful for upgrading binary stars in the catalog that are represented in SE as two seperate stars, into a complete binary star system with each star in a correct orbit. <span class=\"se_warn\">Note:<\/span> the <span class=\"se_script\">Remove<\/span> parameter seems to affect all catalog files, regardless of their modification date. It is a bug in the current version (0.9.8.0).<\/p>\n<p>Note that the star catalog does not describe the components of binary or multiple star systems. They must be described in the <i>planets catalog<\/i> and referring to the barycenter with the parameter <span class=\"se_script\">ParentBody<\/span> (see below). So, strictly speaking, the stars catalogs in SE are catalogs of star systems, not stars themselves (although they allow describing solitary stars without creating a planets catalogs for them). Visual parameters such as the overall luminosity of the system will be calculated by SpaceEngine automatically, based on the data of the system's components, described in the planets catalog. They may, however, be forced by defining parameters <span class=\"se_script\">Luminosity, AppMagn<\/span> etc. in the <span class=\"se_script\">StarBarycenter<\/span> tag.<\/p>\n<h4 class=\"se_h4\">The star script details<\/h4>\n<p>The following parameters can be used inside the <span class=\"se_script\">Star<\/span> and <span class=\"se_script\">StarBarycenter<\/span> tags:<\/p>\n<p><span class=\"se_script\">RA<\/span> - right ascension in hours, in decimal format or formatted as HH MM SS.SSS<br \/>\n<span class=\"se_script\">Dec<\/span> - declination in degrees, in decimal format or formatted as DD MM SS.SSS<br \/>\n<span class=\"se_script\">Dist<\/span> - distance from the Sun in parsecs.<\/p>\n<p><span class=\"se_script\">CenterOf<\/span> - used to replace the procedural supermassive black hole system in the center of a galaxy or globular cluster. The parameter's value is the name of the galaxy or cluster, for example <span class=\"se_script\">CenterOf \"Milky Way\"<\/span>. Only one supermassive black hole system can exist in a galaxy or cluster. If it is already defined in some catalog, it will be replaced\/updated with this one. If this parameter is defined, the procedural supermassive black hole system in the corresponding object will be disabled, but this one will be rendered as a usual star system. So <span class=\"se_script\">RA, Dec<\/span> and <span class=\"se_script\">Dist<\/span> parameters are still required. A typical system must contain the black hole, optional accretion disk and many stars orbiting it. All these must be described in the planets catalog; the star catalog only deals with the coordinates of the system and its class (<span class=\"se_script\">Class \"X\"<\/span> or <span class=\"se_script\">Class \"BLACKHOLE\"<\/span>).<\/p>\n<p><span class=\"se_script\">NoPlanets<\/span> - disable generation of procedural planets, if specified as <span class=\"se_script\">NoPlanets true<\/span>.<\/p>\n<p><span class=\"se_script\">Lum, Luminosity, AppMagn, AbsMagn<\/span> - allows one of these options, or combination of them (see <i>\"star solver\"<\/i> below for details):<br \/>\n<span class=\"se_script\">Lum, Luminosity<\/span> - star's luminosity in units of the Sun's luminosity, or<br \/>\n<span class=\"se_script\">AppMagn<\/span> - star's apparent (optical) magnitude, or<br \/>\n<span class=\"se_script\">AbsMagn<\/span> - star's absolute (optical) magnitude.<br \/>\nAdvanced: <span class=\"se_script\">AppMagnR, AppMagnr, AppMagnI, AppMagni, AppMagnJ, AppMagnH, AppMagnKs, AppMagnK, AppMagnW1, AppMagnW2, AppMagnW3<\/span> - star's apparent magnitude in corresponding spectroscopic bands. Use these only for brown dwarves, if their apparent magnitude in the optical band is unknown. SpaceEngine performs a simple computation of the optical apparent magnitude, assuming that star is a brown dwarf or late M dwarf. Don't use these parameters for other types of stars.<\/p>\n<p><span class=\"se_script\">Class<\/span> - a string with the <a class=\"link\" href=\"http:\/\/en.wikipedia.org\/wiki\/Stellar_classification\" target=\"_blank\" rel=\"nofollow\">spectral class<\/a> of the star:<br \/>\nNormal star classes: <span class=\"se_script\">O, B, A, F, G, K, M<\/span><br \/>\nSubdwarf classes: <span class=\"se_script\">sdO, sdB, sdA, sdF, sdG, sdK, sdM<\/span> (or <span class=\"se_script\">O, B, A, F, G, K, M<\/span> with luminosity class <span class=\"se_script\">VI<\/span>)<br \/>\nBrown dwarf classes: <span class=\"se_script\">L, T, Y<\/span><br \/>\nWhite dwarf classes: <span class=\"se_script\">DA, DB, DO, DQ, DZ, DC, DX, DAB, DAO, DAZ, DBZ<\/span> or <span class=\"se_script\">WD<\/span> (general white dwarf class)<br \/>\nWolf-Rayet classes: <span class=\"se_script\">WN, WN\/C, WC, WO<\/span><br \/>\nZirconium and carbon classes: <span class=\"se_script\">MS, S, SC, C-R, C-N, C-J, C-H, C-Hd, C, R, N<\/span><br \/>\nSpecial classes: <span class=\"se_script\">Q, NEUTRON<\/span> - neutron star, <span class=\"se_script\">X, BLACKHOLE<\/span> - black hole, <span class=\"se_script\">Z, WORMHOLE<\/span> - wormhole, <span class=\"se_script\">P<\/span> - planemo (rogue planet)<br \/>\nAll classes listed above can have the subclass index - number 0 to 9 in decimal format (0 to 11 for Wolf-Rayet stars). SpaceEngine uses only up to one decimal, i.e. 3.25 will be rounded to 3.2.<br \/>\nAll classes except white dwarves can have the luminosity class index: <span class=\"se_script\">0, Ia0, Ia+, Ia, Iab, Ib, II, III, IV, V, VI<\/span><br \/>\nExamples: <span class=\"se_script\">Class \"G2V\"<\/span>, <span class=\"se_script\">Class \"M5.2III\"<\/span>, <span class=\"se_script\">Class \"DB3.1\"<\/span>, <span class=\"se_script\">Class \"sdB5\"<\/span> (equal to <span class=\"se_script\">Class \"B5VI\"<\/span>).<br \/>\nA space is also allowed: <span class=\"se_script\">Class \"G2 V\"<\/span>, <span class=\"se_script\">Class \"M5.2 III\"<\/span>, <span class=\"se_script\">Class \"DB 3.1\"<\/span>.<br \/>\nIf the subclass or luminosity index could not be provided: <span class=\"se_script\">Class \"G2\"<\/span>, <span class=\"se_script\">Class \"M III\"<\/span>, <span class=\"se_script\">Class \"K\"<\/span>. In this case SpaceEngine will try to calculate them based on available data (luminosity or visual magnitude and distance etc, see star solver), or assign default luminosity class \"V\" (the Main sequence star).<\/p>\n<p><span class=\"se_script\">Mass<\/span> - star mass in units of Earth masses, or<br \/>\n<span class=\"se_script\">MassSol<\/span> - star mass in units of Solar masses. Used only for solitary stars (tag <span class=\"se_script\">Star<\/span>). If defined in the <span class=\"se_script\">StarBarycenter<\/span> tag, it can be used in the star solver (see below).<\/p>\n<p><span class=\"se_script\">Radius<\/span> - star radius in kilometers, or<br \/>\n<span class=\"se_script\">RadSol, RadiusSol<\/span> - star radius in units of Solar radii. Used only for solitary stars (tag <span class=\"se_script\">Star<\/span>). If defined in the <span class=\"se_script\">StarBarycenter<\/span> tag, it can be used in the star solver (see below).<\/p>\n<p><span class=\"se_script\">Teff, Temperature<\/span> - temperature of the star's photosphere (\"surface\") in Kelvin. Used only for solitary stars (tag <span class=\"se_script\">Star<\/span>). If defined in the <span class=\"se_script\">StarBarycenter<\/span> tag, it can be used in the star solver (see below).<\/p>\n<p><span class=\"se_script\">FeH<\/span> - star <a class=\"link\" href=\"http:\/\/en.wikipedia.org\/wiki\/Metallicity\" target=\"_blank\" rel=\"nofollow\">metallicity<\/a>. Not used for now, but will be used in future, so it's worthwhile to add it to the catalog if information is available.<\/p>\n<p>You can use the star solver logging to detect errors in the stars catalog (for details see Star solver and Checking for errors in the <a class=\"link\" href=\"http:\/\/spaceengine.org\/manual\/making-addons\/introduction\/\" target=\"_blank\" rel=\"nofollow\">Introduction to SE scripts<\/a>).<\/p>\n<h4 class=\"se_h4\">The planets catalog<\/h4>\n<p>Lets continue creating our example addon. The star \"Mono\" doesn't need anything extra to be put into the planets catalog, all needed information was provided in the stars catalog. It must have the black hole \"Hole\" and binary components of the system \"Bin\": \"Bin A\" and \"Bin B\". Go to the <span class=\"se_path\">addons\/catalogs\/planets\/<\/span> directory (create it if it does not exist) and create a new text document there. Rename it to <span class=\"se_path\">myplans.sc<\/span> (as has been noted in \"the star catalog\" section, the file name doesn't matter, but make sure it doesn't match some existing file, otherwise your file <a class=\"link\" href=\"http:\/\/spaceengine.org\/manual\/making-addons\/introduction\/\" target=\"_blank\" rel=\"nofollow\">will override<\/a> it). Open it in Notepad and type this code:<\/p>\n<div class=\"bbCodeBlock\">\n<div class=\"bbCodeName\" style=\"padding-left: 5px; font-weight: bold; font-size: 7pt;\">Code<\/div>\n<div class=\"se_code\" style=\"border: 1px inset; max-height: 200px; overflow: auto; height: 200px;\">\/\/ Creates a new object - a solitary black hole with an accretion disk<br \/>\nStar\u00a0\u00a0\u00a0\u00a0\"Hole\"<br \/>\n{<\/p>\n<div class=\"codepaddingleft\">\nParentBody\u00a0\"Hole system\"\u00a0\/\/ = name of StarBarycenter in the stars catalog<br \/>\nClass\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"X\"\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ black hole \"spectral class\"<br \/>\nMassSol\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a015.0\u00a0\u00a0\u00a0\u00a0\/\/ in Solar units, radius will be computed automatically<br \/>\n\/\/Lum\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ a black hole has zero luminosity - don't specify any\u00a0\u00a0\u00a0\u00a0\/\/ rotational parameters<br \/>\nObliquity\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a016<br \/>\nEqAscNode\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a064<br \/>\nRotationPeriod\u00a0\u00a01.0e-7\u00a0\u00a0\/\/ black holes rotate really fast!\/\/ accretion disk<br \/>\nAccretionDisk<br \/>\n{<\/p>\n<div class=\"codepaddingleft\">\nRadius\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.00002\u00a0\/\/ in AU<br \/>\nTemperature\u00a03000\u00a0\u00a0\u00a0\u00a0\/\/ in Kelvin<br \/>\nLuminosity\u00a0\u00a0150\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ in Solar luminosities<br \/>\nBrightness\u00a0\u00a01\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ render brightness scale<br \/>\nDensity\u00a0\u00a0\u00a0\u00a0\u00a08\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ some magic value<br \/>\nTwistMagn\u00a0\u00a0\u00a060\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ some magic value\n<\/div>\n<p>}<\/p>\n<p>\/\/ Orbit tag is skipped, equal to static position in the center of the system\n<\/p><\/div>\n<p>}<\/p>\n<p>\/\/ Creates a new object - first component of a binary star system<br \/>\nStar\u00a0\u00a0\u00a0\u00a0\"Bin A\"<br \/>\n{<\/p>\n<div class=\"codepaddingleft\">\nParentBody\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Bin\"\u00a0\u00a0\u00a0\/\/ = name of StarBarycenter in the stars catalog<br \/>\nClass\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"G1V\"<br \/>\nLuminosity\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01.02<br \/>\nMassSol\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01.09<br \/>\nRadiusSol\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01.1<\/p>\n<p>\/\/ rotational parameters<br \/>\nObliquity\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a082.2<br \/>\nEqAscendNode\u00a0\u00a0\u00a0\u00a067.726<br \/>\nRotationPeriod\u00a0\u00a0923.6<br \/>\nRotationOffset\u00a0\u00a064.7<\/p>\n<p>\/\/ orbit around the barycenter<br \/>\nOrbit<br \/>\n{<\/p>\n<div class=\"codepaddingleft\">\n\/\/ mutual semimajor axis is 23.52 AU,<br \/>\n\/\/ but mass ratio 1.09:0.92 is taken into account!<br \/>\nSemiMajorAxis\u00a0\u00a0\u00a010.765 \/\/ in AU<br \/>\nPeriod\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a079.914 \/\/ in years<br \/>\nEccentricity\u00a0\u00a0\u00a0\u00a00.5179<br \/>\nInclination\u00a0\u00a0\u00a0\u00a0\u00a082.986<br \/>\nAscendingNode\u00a0\u00a0\u00a067.726<br \/>\nArgOfPericenter\u00a03.772<br \/>\nMeanAnomaly\u00a0\u00a0\u00a0\u00a0\u00a0200.119\n<\/div>\n<p>}\n<\/p><\/div>\n<p>}<\/p>\n<p>\/\/ Creates a new object - second component of a binary star system<br \/>\nStar\u00a0\u00a0\u00a0\u00a0\"Bin B\"<br \/>\n{<\/p>\n<div class=\"codepaddingleft\">\nParentBody\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Bin\"\u00a0\u00a0\u00a0\/\/ = name of StarBarycenter in the stars catalog<br \/>\nClass\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"K0V\"<br \/>\nLuminosity\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.29<br \/>\nMassSol\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.92<br \/>\nRadSol\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.90<\/p>\n<p>\/\/ rotational parameters<br \/>\nObliquity\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a082.6<br \/>\nEqAscendNode\u00a0\u00a0\u00a0\u00a067.726<br \/>\nRotationPeriod\u00a0\u00a0850.5<br \/>\nRotationOffset\u00a0\u00a0127.4<\/p>\n<p>\/\/ orbit around the barycenter<br \/>\nOrbit<br \/>\n{<\/p>\n<div class=\"codepaddingleft\">\n\/\/ mutual semimajor axis is 23.52 AU,<br \/>\n\/\/ but mass ratio 1.09:0.92 is taken into account!<br \/>\nSemiMajorAxis\u00a0\u00a0\u00a012.755 \/\/ in AU<br \/>\nPeriod\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a079.914 \/\/ in years<br \/>\nEccentricity\u00a0\u00a0\u00a0\u00a00.5179<br \/>\nInclination\u00a0\u00a0\u00a0\u00a0\u00a082.986<br \/>\nAscendingNode\u00a0\u00a0\u00a067.726<br \/>\nArgOfPericenter\u00a0183.772<br \/>\nMeanAnomaly\u00a0\u00a0\u00a0\u00a0\u00a0200.119\n<\/div>\n<p>}\n<\/p><\/div>\n<p>}\n<\/p><\/div>\n<\/div>\n<p>Lets take a closer look at this script. It is called \"planets catalog\" because it is primarily designed for making planets and moons. But the \"star body\" itself, especially in binary systems, should also be described here. It's a common rule: any object that has an orbit must be described in the planets catalog. Components of a binary star do have orbits, so this is why they should be in the planets catalog. It also allows you to describe many more parameters than the stars catalog (rotation axis orientation and rotation period, star corona, accretion disk, surface textures, and orbit), so this is why even solitary stars such as the Sun also may be described in the planets catalog. To learn more about parameters used in the planets catalog, and about creating a planet, read the <a class=\"link\" href=\"http:\/\/spaceengine.org\/manual\/making-addons\/creating-a-planet\" target=\"_blank\" rel=\"nofollow\">Creating a planet<\/a> guide.<\/p>\n<p>In the example code above, we first described the solitary star \"Hole\" with additional parameters which cannot be described in the stars catalog (rotational parameters and accretion disk). To specify them, it's necessary to describe the star in the stars catalog as a <span class=\"se_script\">StarBarycenter<\/span>, despite the fact that the star is solitary, and make a second description for it in the planets catalog with the tag <span class=\"se_script\">Star<\/span>. The <span class=\"se_script\">ParentBody<\/span> parameter in that <span class=\"se_script\">Star<\/span> tag must be set to the name of the <span class=\"se_script\">StarBarycenter<\/span> which you have described in the stars catalog. <span class=\"se_warn\">Important note:<\/span> the <span class=\"se_script\">Star<\/span> tag in the planets catalog and the <span class=\"se_script\">StarBarycenter<\/span> tag in the stars catalog must have different names. I.e. if the star has the name \"Hole\", then the barycenter should be named \"Hole system\" or \"Hole bar\" or something like that. When creating an addon with some real star, which has multiple designations in the astronomical catalogs, it's a good practice to give one to the <span class=\"se_script\">StarBarycenter<\/span>, and the rest to the <span class=\"se_script\">Star<\/span>.<\/p>\n<p>The planets catalog also allow you to specify the star's luminosity, absolute or apparent magnitude, spectral class, mass, radius and temperature - the same parameters as in the stars catalog. It's up to you where to specify these parameters: in the stars catalog or in the planets catalog, duplication in both is not necessary.<\/p>\n<p>The <span class=\"se_script\">Orbit<\/span> tag must be skipped for solitary stars, SpaceEngine will generate a static position in the center of the system for that star. You may use <span class=\"se_script\">Orbit { Type \"Static\" }<\/span> or <span class=\"se_script\">StaticPosXYZ (0 0 0)<\/span> with the same effect, but this is not necessary.<\/p>\n<p>The barycenter could also be used to create binary and multiple stars. In the planets catalog, we have described two stars \"Bin A\" and \"Bin B\" with their orbits around the main barycenter of the system \"Bin\" (see description of the <span class=\"se_script\">Orbit<\/span> tag in the <a class=\"link\" href=\"http:\/\/spaceengine.org\/manual\/making-addons\/creating-a-planet\" target=\"_blank\" rel=\"nofollow\">Creating a planet<\/a> guide for details). To create a hierarchical multiple star system, create a secondary barycenter (using the <span class=\"se_script\">Barycenter<\/span> tag in the planet catalog script), which orbits the main barycenter of the system, then add two stars which are orbiting this secondary barycenter. You may repeat this scheme many times to create more complex systems. SpaceEngine allows unlimited-tier hierarchy of objects, but in reality, star systems have no more than 3-4 levels of hierarchy.<\/p>\n<p>The planets for each star or local barycenter could also be specified in the planets catalog. The parameter <span class=\"se_script\">ParentBody<\/span> for each planet\/barycenter\/star should be set to the name of the parent object which it is orbiting. If the star is solitary, and the planets catalog does not have any child objects (planets) for that star described, SpaceEngine will generate a procedural planetary system. You can disable this by specifying <span class=\"se_script\">NoPlanets true<\/span> in the stars script.<\/p>\n<p>The parameters of a star\/barycenter in the star catalog determines the appearance of the star while looking at it from interstellar space, i.e. when it is rendered as a point. For multi-star systems, SpaceEngine needs some \"average\" spectral class to render the system from far away. For procedural systems, SpaceEngine chooses the spectral class of the brightest star of the system (see \"star solver\" for details). This works very well in most cases, because luminosities of stars differ by many orders of magnitude. So when creating a multiple star system, you can specify the spectral class of the <span class=\"se_script\">StarBarycenter<\/span> (in the stars catalog) as the same as class of the brightest star in that system. Otherwise SpaceEngine will do that automatically. The luminosity of the <span class=\"se_script\">StarBarycenter<\/span> should be equal to the <i>sum luminosity<\/i> of all stars in the system (including luminosity of the accretion disks), or ignored to force star solver to automatically calculate it.<\/p>\n<p>To summarise, please pay attention to the following, <span class=\"se_warn\">otherwise the code will not work or will work incorrectly:<\/span><\/p>\n<p>1) In the stars catalog, describe a star with the <span class=\"se_script\">StarBarycenter<\/span>, if you want to specify the custom rotation parameters, accretion disk etc, or if you are creating a multiple star system. In that case you also must create a planets catalog and describe the star or multiple star components there. If you need only mass, radius and temperature for your star, or if you are okay with those values being generated\/computed by SpaceEngine, describe it with the <span class=\"se_script\">Star<\/span> tag, and do not create a planets catalog.<br \/>\n2) The name of a star in the planets catalog must not be the same as the name of <span class=\"se_script\">StarBarycenter<\/span>. The name of <span class=\"se_script\">StarBarycenter<\/span> must be specified as the parent of the star in its <span class=\"se_script\">ParentBody<\/span> parameter.<br \/>\n3) If the star is solitary, either do not use the <span class=\"se_script\">Orbit<\/span> tag for it, or make its orbit static (<span class=\"se_script\">Orbit { Type \"Static\" }<\/span> or <span class=\"se_script\">StaticPosXYZ (0 0 0)<\/span>), so it coincides with the barycenter.<br \/>\n4) If the star is binary, describe the two stars with the name of the <span class=\"se_script\">StarBarycenter<\/span> in their <span class=\"se_script\">ParentBody<\/span> parameter, and make proper orbits around the barycenter for them.<\/p>\n<p>You can use the star solver logging to detect errors in the planets catalog, as well as for the stars catalog (for details see Star solver and Checking for errors in the <a class=\"link\" href=\"http:\/\/spaceengine.org\/manual\/making-addons\/introduction\/\" target=\"_blank\" rel=\"nofollow\">Introduction to SE scripts<\/a>)<\/p>\n<h4 class=\"se_h4\">The star solver<\/h4>\n<p>The star solver is a set of code that tries to compute or generate missing data for a star based on the provided data. It's often the situation in astronomy that some data is provided in catalogs, but some is missing. SpaceEngine requires these parameters to correctly render a star (star system):<\/p>\n<p>- Full 3D coordinates of a star (RA, Dec, Dist). If the star catalog does not provide a distance, the star solver may try to compute it based on the apparent and absolute magnitude (or luminosity) of the star. If RA and Dec are not provided, star solver will generate random values for them, because there is no way to calculate them. A random value for distance is also generated if the star solver failed to compute it (see error logging below for more details).<\/p>\n<p>- Star's spectral class. Without it, SpaceEngine will have no idea what this star is, and cannot render it. The star solver can try to determine the spectral class by looking at the radius, mass and temperature, if they are provided. For multi-star systems, the star solver takes the spectral class of the brightest component (either computed or taken from the planets catalog), and assigns it as the \"class\" of the whole system (if it was not specified in the <span class=\"se_script\">StarBarycenter<\/span> tag directly).<\/p>\n<p>- Star's brightness. It can be computed from luminosity, absolute magnitude or apparent magnitude and distance. If none are provided, the spectral class can be used to roughly determine the luminosity. If even spectral class is not provided, the star solver may try to use radius and temperature to calculate luminosity using the <a class=\"link\" href=\"https:\/\/en.wikipedia.org\/wiki\/Luminosity#Luminosity_formula\" target=\"_blank\" rel=\"nofollow\">Stefan\u2013Boltzmann equation<\/a>. For multi-star systems, the star solver sums up the luminosity of each component, and assigns it as the luminosity of the whole system (if it was not specified in the <span class=\"se_script\">StarBarycenter<\/span> tag directly).<\/p>\n<p>- Star's physical properties: mass, radius and temperature. If not provided, the star solver will compute them based on spectral class (typically). Temperature can be derived from the spectral class directly, then radius is computed based on temperature and luminosity using the <a class=\"link\" href=\"https:\/\/en.wikipedia.org\/wiki\/Luminosity#Luminosity_formula\" target=\"_blank\" rel=\"nofollow\">Stefan\u2013Boltzmann equation<\/a>. So if you run into an incorrect or unrealistic size of a star, try to find its real radius data and specify it in the catalog.<\/p>\n<p>As has been noted, the star catalog cannot be used to define the rotational parameters of a star (i.e. rotation period, axial tilt and oblateness), as well as surface appearance (granulation cells size, etc), corona, accretion disk and orbit: the planets catalog is used for this. Some parameters can be generated procedurally if missing in the planets catalog. The planets can also be described in the planets catalog or be generated procedurally (if the planets catalog does not have any child objects for the star described, and the star script does not have <span class=\"se_script\">NoPlanets true<\/span> specified).<\/p>\n<p>The star solver can print notifications about performed calculations, warnings and errors to the log file <span class=\"se_path\">system\/se.log<\/span> on SpaceEngine startup. See <a class=\"link\" href=\"http:\/\/spaceengine.org\/manual\/making-addons\/introduction\/\" target=\"_blank\" rel=\"nofollow\">Introduction to SE scripts<\/a> for details about error checking in scripts.<\/p>\n<h4 class=\"se_h4\">The csv format for the star catalog<\/h4>\n<p>SpaceEngine supports csv (\"Comma-Separated Values\") format for massive stars and galaxies catalogs. It is a plain text format with one star described per line, with values separated with commas. The default SpaceEngine installation has one csv star catalog - <span class=\"se_path\">data\/catalogs\/<\/span><span class=\"se_pak\">Catalogs0980.pak\/stars\/HIPPARCOS.csv<\/span>, which has 112,523 stars, and has a size (unpacked) of only 7.5 MB. The csv format is more compact than sc, but has some limitations:<br \/>\n1) Only solitary stars can be described, analog of the <span class=\"se_script\">StarBarycenter<\/span> tag is impossible.<br \/>\n2) Only these parameters are allowed: Name, RA, Dec, Dist, AppMagn, SpecClass, MassSol, RadSol, Temperature.<\/p>\n<p>The file format is simple: the first line is a header describing the names of the parameters (separated by commas), all the other lines are stars data - values of corresponding parameters (also separated by commas). Here is the example of the first 4 lines of the <span class=\"se_path\">HIPPARCOS.csv<\/span> file:<\/p>\n<div class=\"bbCodeBlock\">\n<div class=\"bbCodeName\" style=\"padding-left: 5px; font-weight: bold; font-size: 7pt;\">Code<\/div>\n<div class=\"se_code\" style=\"border: 1px inset; max-height: 80px; overflow: auto; height: 200px;\">Name,RA,Dec,Dist,AppMagn,SpecClass,MassSol,RadSol,Temperature<br \/>\nHIP 14066\/HD 18665,3.02094205,36.1179219,487.804884,7.24999999,K2V,,,<br \/>\nHIP 14775\/HD 278329,3.17876994,36.5130485,505.050497,10.1093756,K0V,,,<br \/>\nHIP 12888,2.76132567,32.8238759,476.190497,9.64843834,K0V,,,\n<\/div>\n<\/div>\n<p>Note that star name and its spectral class are not enclosed in quotes, and missing parameters (MassSol, RadSol and Temperature) are just blank, but commas separating them are still necessary.<\/p>\n<p>The csv catalogs have a priority over sc catalogs, i.e. they are loaded first. But then star solver takes the file\/pak modification date to perform star data merging or updating. The config-file parameter <span class=\"se_script\">CsvLogLevel<\/span> in the <span class=\"se_path\">config\/main-user.cfg<\/span> file controls the star solver's logging level for all the csv files.[\/vc_column_text][\/no_accordion_section][\/no_accordion][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>[vc_row row_type=\"row\" use_row_as_full_screen_section=\"no\" type=\"full_width\" text_align=\"left\" box_shadow_on_row=\"no\"][vc_column][no_accordion active_tab=\"1\" background_transparency=\"no\" style=\"boxed_accordion\"][no_accordion_section title=\"Creating a star\" accordion_type=\"accordion_icon\" icon_pack=\"font_elegant\" fe_icon=\"icon_cog\"][vc_column_text]This manual describes how to add a star to SpaceEngine. Before continuing, it is recommended you read this manual: Introduction. The majority of stars in the default SpaceEngine installation are stored...<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":519,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-626","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/pages\/626","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/comments?post=626"}],"version-history":[{"count":15,"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/pages\/626\/revisions"}],"predecessor-version":[{"id":1482,"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/pages\/626\/revisions\/1482"}],"up":[{"embeddable":true,"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/pages\/519"}],"wp:attachment":[{"href":"https:\/\/spaceengine.org\/wp-json\/wp\/v2\/media?parent=626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}