Body ID Reference
Complete mapping of integer body identifiers used across all pg_orbit functions. Each function family uses its own ID space; the tables below document which IDs are valid for which functions.
Planet IDs
Section titled “Planet IDs”Used by planet_heliocentric, planet_observe, and lambert_transfer / lambert_c3.
| ID | Body | Valid for planet_heliocentric | Valid for planet_observe | Valid for lambert_* |
|---|---|---|---|---|
| 0 | Sun | Yes (returns origin) | No | No |
| 1 | Mercury | Yes | Yes | Yes |
| 2 | Venus | Yes | Yes | Yes |
| 3 | Earth | Yes | No | Yes |
| 4 | Mars | Yes | Yes | Yes |
| 5 | Jupiter | Yes | Yes | Yes |
| 6 | Saturn | Yes | Yes | Yes |
| 7 | Uranus | Yes | Yes | Yes |
| 8 | Neptune | Yes | Yes | Yes |
Conventions
Section titled “Conventions”The planet ID numbering follows the VSOP87 convention:
- IDs 1-8 map to the eight planets in order from the Sun
- No ID is assigned to Pluto (VSOP87 does not include it)
- The Sun is included as ID 0 for completeness in heliocentric queries
-- Quick lookup: all planet IDs with namesSELECT body_id, CASE body_id WHEN 0 THEN 'Sun' WHEN 1 THEN 'Mercury' WHEN 2 THEN 'Venus' WHEN 3 THEN 'Earth' WHEN 4 THEN 'Mars' WHEN 5 THEN 'Jupiter' WHEN 6 THEN 'Saturn' WHEN 7 THEN 'Uranus' WHEN 8 THEN 'Neptune' END AS nameFROM generate_series(0, 8) AS body_id;Galilean Moon IDs
Section titled “Galilean Moon IDs”Used by galilean_observe. Numbered in order of distance from Jupiter, following the Lieske L1.2 convention.
| ID | Moon | Discoverer | Orbital Period | Semi-major Axis |
|---|---|---|---|---|
| 0 | Io | Galileo (1610) | 1.769 days | 421,700 km |
| 1 | Europa | Galileo (1610) | 3.551 days | 671,034 km |
| 2 | Ganymede | Galileo (1610) | 7.155 days | 1,070,412 km |
| 3 | Callisto | Galileo (1610) | 16.689 days | 1,882,709 km |
-- All Galilean moon names and IDsSELECT moon_id, CASE moon_id WHEN 0 THEN 'Io' WHEN 1 THEN 'Europa' WHEN 2 THEN 'Ganymede' WHEN 3 THEN 'Callisto' END AS nameFROM generate_series(0, 3) AS moon_id;Saturn Moon IDs
Section titled “Saturn Moon IDs”Used by saturn_moon_observe. Numbered in order of distance from Saturn, following the TASS17 convention.
| ID | Moon | Discoverer | Orbital Period | Semi-major Axis |
|---|---|---|---|---|
| 0 | Mimas | Herschel (1789) | 0.942 days | 185,539 km |
| 1 | Enceladus | Herschel (1789) | 1.370 days | 238,042 km |
| 2 | Tethys | Cassini (1684) | 1.888 days | 294,619 km |
| 3 | Dione | Cassini (1684) | 2.737 days | 377,396 km |
| 4 | Rhea | Cassini (1672) | 4.518 days | 527,108 km |
| 5 | Titan | Huygens (1655) | 15.945 days | 1,221,870 km |
| 6 | Iapetus | Cassini (1671) | 79.322 days | 3,560,820 km |
| 7 | Hyperion | Bond & Lassell (1848) | 21.277 days | 1,481,010 km |
SELECT moon_id, CASE moon_id WHEN 0 THEN 'Mimas' WHEN 1 THEN 'Enceladus' WHEN 2 THEN 'Tethys' WHEN 3 THEN 'Dione' WHEN 4 THEN 'Rhea' WHEN 5 THEN 'Titan' WHEN 6 THEN 'Iapetus' WHEN 7 THEN 'Hyperion' END AS nameFROM generate_series(0, 7) AS moon_id;Uranus Moon IDs
Section titled “Uranus Moon IDs”Used by uranus_moon_observe. Numbered in order of distance from Uranus, following the GUST86 convention.
| ID | Moon | Discoverer | Orbital Period | Semi-major Axis |
|---|---|---|---|---|
| 0 | Miranda | Kuiper (1948) | 1.413 days | 129,390 km |
| 1 | Ariel | Lassell (1851) | 2.520 days | 190,900 km |
| 2 | Umbriel | Lassell (1851) | 4.144 days | 266,000 km |
| 3 | Titania | Herschel (1787) | 8.706 days | 435,910 km |
| 4 | Oberon | Herschel (1787) | 13.463 days | 583,520 km |
SELECT moon_id, CASE moon_id WHEN 0 THEN 'Miranda' WHEN 1 THEN 'Ariel' WHEN 2 THEN 'Umbriel' WHEN 3 THEN 'Titania' WHEN 4 THEN 'Oberon' END AS nameFROM generate_series(0, 4) AS moon_id;Mars Moon IDs
Section titled “Mars Moon IDs”Used by mars_moon_observe. Numbered in order of distance from Mars, following the MarsSat convention.
| ID | Moon | Discoverer | Orbital Period | Semi-major Axis |
|---|---|---|---|---|
| 0 | Phobos | Hall (1877) | 0.319 days (7h 39m) | 9,376 km |
| 1 | Deimos | Hall (1877) | 1.263 days | 23,463 km |
SELECT moon_id, CASE moon_id WHEN 0 THEN 'Phobos' WHEN 1 THEN 'Deimos' END AS nameFROM generate_series(0, 1) AS moon_id;Summary Table
Section titled “Summary Table”Total: 8 planets + 19 moons = 27 solar system bodies computable from SQL.
| Function | ID Range | Count | Theory |
|---|---|---|---|
planet_heliocentric | 0-8 | 9 | VSOP87 |
planet_observe | 1-2, 4-8 | 7 | VSOP87 |
galilean_observe | 0-3 | 4 | Lieske L1.2 |
saturn_moon_observe | 0-7 | 8 | TASS17 |
uranus_moon_observe | 0-4 | 5 | GUST86 |
mars_moon_observe | 0-1 | 2 | MarsSat |
lambert_transfer / lambert_c3 | 1-8 | 8 | VSOP87 + Lambert |