Skip to content

Orbital JSONs

Josh Shor edited this page Oct 4, 2017 · 6 revisions

Contents

What's an orbital?

An orbital is an object that orbits something (e.g., planet, satellite, comet, etc). Moreover, an orbital has a parent-child relationship with the thing it orbits. For example, Jupiter is an orbital of the Sun/Solar System barycenter (i.e. the <0> vector in the scene); the Moon is an orbital of the Earth barycenter.

Orbital Mechanics

Orbital Mechanics

  • A – Minor, orbiting body
  • B – Major body being orbited by A
  • C – Reference plane, e.g. the ecliptic
  • D – Orbital plane of A
  • E – Descending node
  • F – Periapsis
  • G – Ascending node
  • H – Apoapsis
  • i – Inclination
  • J – Reference direction; for orbits in or near the ecliptic, usually the vernal point
  • Ω – Longitude of the ascending node
  • ω – Argument of the periapsis

Orbital Path Reference

Orbital Path Reference

  • a – Semimajor axis
  • b – Semiminor axis
  • f – Focus of the ellipse

Directory structure

JSON files for each orbital lives in the directory public/static/data/orbitals/<system>. If an orbital has satellites, it is listed in the satellites array, and lives in its own <system> folder. The name of the JSON file will be the assumed identifier (id) of the orbital, so no two orbital JSONs should have the same name.

Example

Suppose 'Jupiter' is an orbital and it has a moon 'Io.' Jupiter obviously has satellites (Io), but Io has no satellites. In this case, the file structure would look like the following:

./public/static/data/orbitals
|-- ./jupiter
   |-- ./jupiter.json
   `-- ./io.json

Compilation

The script yarn orbitals will search for all planet systems directly in the orbitals/ folder, take all JSON files it finds, and creates a key-value map of id -> data. For each satellite specified in the satellites parameter, it will map its respective satellite data to it, and exclude it from the top level of the JSON data.

The compiled file will be in the path public/static/data/orbitals.json.

NASA JPL Horizons database

The NASA/Jet Propulsion Laboratory provides ephemeris data for major Solar System bodies.

Update script

The script yarn ephemeris will probe the Horizons' database for the latest ephemeris data for the planets specified in the orbital JSON files and update these files with the following information:

Prerequisite data

The prerequisite data is an object should be defined in the ephemeris object. This is data that will be used by the script to look up ephemeris data.

Motivation

  1. it requires significant effort to look up precise periapses, especially for slow-moving bodies
  2. ephemerides may change over time due to gravitational aberrations, new discoveries or some unforeseen cosmic calamity
  3. flexibility to add more planetary data without much work

JSON data structure

name

String

Name of the orbital. Displayed in UI (labels, modal title, etc). Required.

radius

Number

Radius of the orbital, in kilometers. Required

sidereal

Number

Sidereal time of the orbital, in sidereal days. Presumed synchronous if none specified.

markdown

String

Path to markdown file for the description. Required.

Markdown should live in the path: public/static/data/markdown.

mass

Number

Mass, in kilograms, of the orbital. Required.

centralMass

Number

Mass, in kilograms, of the body that this orbital is orbiting. For planets, this value should be the mass of the Sun ( 1.9891e+30 kilograms). Required.

axialTilt

Number

Axial tilt of the orbital, in degrees.

inclination

Angle of inclination. See: See: i in Orbital Mechanics.

argPeriapsis

Number

Argument of the periapsis. Automatically generated by the yarn ephemeris script. See: ω in Orbital Mechanics.

longAscNode

Number

Longitude of the ascending node. Automatically generated by the yarn ephemeris. See: Ω in Orbital Mechanics.

semimajor

Number

Semimajor axis of the orbital, in kilometers. Automatically generated by the yarn ephemeris. See a in Orbital Path Reference.

semiminor

Number

Semiminor axis of the orbital, in kilometers. Automatically generated by the yarn ephemeris. See b in Orbital Path Reference.

eccentricity

Number

Orbital eccentricity. Automatically generated by the yarn ephemeris. See e in Orbital Path Reference.

periapses

Object

Periapses epochs, in UNIX time (in milliseconds), of any given periapsis event and the one proceeding it. A periapsis event is defined to be the precise moment when an orbital is closest in distance to the thing it's orbiting during its revolution period.

Automatically generated by the yarn ephemeris.

last

Number

Last periapsis epoch, in UNIX time (in milliseconds). Required

next

Number

Last periapsis epoch, in UNIX time (in milliseconds). Required

atmosphereColor

Number

Color of the atmosphere. The orbital path ("planet trail") will also take on this color. Defaults to 0x000000.

satellites

String[]

List of satellites that orbit this orbital. The satellites should match the id of the orbital (i.e., the file name).

ring

Object

The ring data of the orbital, if any.

radius

Number

The radius of the ring set. Required

texture

The path to the ring texture of the orbital. Required

textures

Object

Textures of the orbital.

specular

String

Path to the specular map texture.

bump

String

Path to the bump map texture.

alpha

String

Path to the alpha map texture.

emissive

String

Path to the emissive map texture.

ephemeris

Data that will be used by the script to look up ephemeris data from the NASA/JPL Horizons database.

revolutionOrder

String

Order of the period, in Earth time, that it takes for the given orbital to make one full revolution around its system's barycenter. For example, Jupiter takes ~11 years to make one revolution, so the revolution order would be years. Io takes ~3 days to make one full revolution, so its revolution order would be days.

Valid values are:

  • y years
  • mo months
  • d days
  • m minutes
  • s seconds

nasaOrbitalCode

String

NASA Horizons code for the orbital lookup. Required.

nasaBarycenterCode

String

NASA Horizons code for the barycenter lookup. Required.

Full Example

Coming soon.