@johnmorrisdotca/wakusei-planets 0.65.0 → 0.67.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/NOTICE.md +7 -0
- package/README.md +3 -3
- package/dist/body-physics.d.ts +114 -0
- package/dist/body-physics.js +162 -0
- package/dist/data/discovery.d.ts +3 -0
- package/dist/data/discovery.js +719 -0
- package/dist/data/moon-catalogue.d.ts +4 -2
- package/dist/data/moon-catalogue.js +468 -468
- package/dist/data/moon-osculating.d.ts +6 -0
- package/dist/data/moon-osculating.js +401 -0
- package/dist/discovery.d.ts +118 -0
- package/dist/discovery.js +67 -0
- package/dist/facts.js +1 -1
- package/dist/moon-catalogue.d.ts +88 -2
- package/dist/moon-catalogue.js +94 -14
- package/dist/plan/element.d.ts +7 -1
- package/dist/plan/element.js +44 -28
- package/dist/plan/layout.d.ts +7 -0
- package/dist/plan/layout.js +7 -5
- package/dist/plan/svg.js +2 -1
- package/dist/space/element.d.ts +24 -0
- package/dist/space/element.js +79 -10
- package/dist/space/index.d.ts +1 -1
- package/dist/space/index.js +1 -1
- package/dist/space/labels.d.ts +116 -2
- package/dist/space/labels.js +107 -8
- package/dist/space/scene.d.ts +2 -0
- package/dist/space/scene.js +31 -23
- package/dist/space/travel.d.ts +2 -2
- package/dist/space/travel.js +2 -2
- package/dist/surface/element.d.ts +8 -0
- package/dist/surface/element.js +70 -15
- package/dist/surface/glide.d.ts +27 -0
- package/dist/surface/glide.js +43 -0
- package/dist/surface/glsl.d.ts +3 -3
- package/dist/surface/glsl.js +2 -1
- package/dist/surface/landing.d.ts +33 -0
- package/dist/surface/landing.js +26 -0
- package/package.json +11 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.67.0] - 2026-11-18
|
|
6
|
+
|
|
7
|
+
- **`<wakusei-surface>`: the camera glides from the watched descent to the standing view, to the rover and between its two cameras, with no jump cut** (MODULES-1561). When `watch` is taken off, `drive="on"` starts or the watch's camera changes, the camera moves from where the watched descent (the window or the ground camera) had it to the new view in 1.1 seconds, easing out and in, with the eye keeping its height above the ground so that it does not pass under a hill, the azimuth turning the short way and the field of view blended. New attribute `glide` (`off` for the cut, or the milliseconds), new `camera` (the pose of the last draw) and `stats.gliding`; a reader who prefers reduced motion gets the cut, and a press or a key on the view ends the move. A move from a move (the watch ends, then the rover starts) goes on from where the first had got to. Switching between the window and the ground camera while watching (or moving where the ground camera stands with `watch-from`) is a move too. Tests: `test/glide.test.ts` (the curve, the blend, the heights, and when a move starts) and `e2e/surface-glide.demo.ts` (the pose of each draw is sampled on the way: no step is most of the way, it arrives, `glide=off` and reduced motion cut).
|
|
8
|
+
|
|
9
|
+
- **`bodyPhysics(id)`: mass, GM, surface gravity, the air at the surface and the surface temperature, each with its source and the day it was read** (MODULES-1553). New entry `@johnmorrisdotca/wakusei-planets/body-physics` for the Sun, the eight planets, Pluto and the Moon. Every figure is `{ value, unit, source: { name, url, pageUpdated, read } }` with the sheet's own wording in `quoted` where it is not a plain number, `bound` (`"below"` or `"about"`), `uncertainty`, `low` and `high`, `level` and `note`, and `bodyPhysics` gives `null` for a body that has no sheet (the dwarf planets and the other moons), and a field is `null` where the sheet has none (the Sun, Mercury, the Moon and Pluto have no air density; the Moon and Pluto give a range of temperature and no single figure). The gas giants' gravity, density and temperature are at the 1 bar level, which is also their pressure (100,000 Pa); Mercury's pressure is the sheet's upper limit. All from NASA's NSSDC planetary fact sheets, read 2026-11-18 (`NOTICE.md`). Guide [Physics of a body](docs/guides/body-physics.md), in English and Japanese. Tests: `test/body-physics.test.ts`.
|
|
10
|
+
|
|
11
|
+
- **`<wakusei-surface>`: a drag turns the view while the descent is watched** (MODULES-1546). The watched landing points its camera at each frame (at the stage from the ground, along the lunar module's heading from its window), and a drag wrote the new direction straight into the view, which the next frame of the running descent put back, so the view could not be turned. A drag now adds to a turn kept beside the camera, as the rover's view does, which every frame adds to where the camera points by itself; the pitch stops at 60 degrees either side, a paused descent is drawn again at once, and the turn is cleared when the camera is changed. Tests: `test/surface.test.ts` (the turn, its limit, and that it holds at every frame of the descent).
|
|
12
|
+
|
|
13
|
+
- **`<wakusei-surface>`: a made crater's floor no longer flickers black while the descent is watched** (MODULES-1547). Two causes, both in the quality of motion (the draws while the view changes). The Sun's march (`lit` in the ground's shader) leaves the made craters out of the march in that quality (`uNear.z` is 0) but set its start point down in the crater's floor, so the ray ran over ground without the crater and found it above its own start: the whole floor was black. The start now leaves the craters out wherever the march does. And the running descent was drawn at the quality of rest whenever a slow draw let the 160 ms since the last change run out, so one frame in a few had the crater's own shadow and the rest had the black floor: while the descent plays, every frame is now at the quality of motion. `test/api-snapshot.txt` changes only by a private member (`#movingNow`). Tests: `test/surface.test.ts`.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [0.66.0] - 2026-11-18
|
|
17
|
+
|
|
18
|
+
- **The irregular moons of `/moon-catalogue` follow JPL Horizons near the present** (MODULES-1091). With JPL's mean elements the irregular moons are 10 to 150 degrees from their real places within a year and a half, because a mean orbit cannot follow the Sun's pull. Each of the 393 irregular moons of the four giant planets now also has its osculating orbit on 2026-12-01 (`osculating`, `MoonOsculating`, `MOON_OSCULATING_EPOCH_JD`), and `catalogueMoonPosition` uses it within `MOON_OSCULATING_DAYS` (150) of that day and the mean orbit outside, so the space view's dots for them are where Horizons has them. Measured on 16 dates the orbit was not set from (15 to 210 days either side): within 150 days, over every moon at every date, the median is 0.06 degrees, 95 places in 100 are within 0.9 degrees and the worst, a few of Jupiter's at the edge of the window, is 7 degrees (Saturn's worst 1.1, Uranus's and Neptune's 0.1). The numbers are whole numbers (a to 100 km, e to 0.0001, angles to 0.01 degree: under 90 km of rounding) in `src/data/moon-osculating.ts`, made by `scripts/make-moon-osculating.py` (one Horizons request a moon, cached outside the repository, a refresh is a run with a new `--epoch`), and cost 7 kB gzipped: the `/moon-catalogue` chunk grows from 36.5 to 43.6 kB (its budget in the test is 45 kB and its size baseline is moved). `accuracy` and `grade` still describe the mean orbit on dates outside the window. A test (`test/moon-osculating.test.ts`) holds a sample of every group to Horizons' own places. The regular moons and the 29 drawn moons are unchanged.
|
|
19
|
+
|
|
20
|
+
- **Estimated sizes for 356 more moons in `/moon-catalogue`** (MODULES-1090). Only 91 of 468 moons had a size; 356 irregular moons of Jupiter (79), Saturn (262), Uranus (8) and Neptune (7) now have an estimated radius, worked out by the same formula and the same assumed albedo (0.04) as the 26 before them (`radiusFrom: "derived"`), from an absolute magnitude read from English Wikipedia's tables of the moons of each planet, which take it from the Minor Planet Center's Natural Satellites Ephemeris Service. The Center's discovery circulars were the first choice, but its robots.txt does not allow a program to read them. A new field `magnitudeFrom` (`sheet` or `wikipedia`) says which magnitude it is, with `MOON_MAGNITUDE_PAGES` (the page of each planet) and `MOON_MAGNITUDES_READ` (2026-11-18). Only the one magnitude of each moon is taken, never a table's diameter; the numbers are in `scripts/moon-catalogue-magnitudes.json`, made by `scripts/make-moon-magnitudes.py` (one request for each of the four pages, cached outside the repository) and read by the build script so `--refresh` keeps them. Checked against the tables' own diameters: ours differ by more than a factor of 2 for 28 faint moons of Jupiter (S/2010 J 2, S/2016 J 1, Valetudo and 25 more at H 16.9 to 17.5: 2.2 to 2.8 km across here, 1 km in the table). 21 moons still have no size: the seven moons of the dwarf planets other than Pluto, 13 regular or inner moons (their tabulated magnitudes are worked out from their diameters, so using them would go in a circle) and Philophrosyne (no row in the table). `NOTICE.md` names the source. The `/moon-catalogue` chunk grows from 34.7 to 36.5 kB gzipped (its size baseline is moved). Tests: `test/moon-catalogue.test.ts`.
|
|
21
|
+
|
|
22
|
+
- **Japanese names for 129 more moons in `/moon-catalogue`** (MODULES-1089). `ja` was filled only for the 29 moons the package draws in full; 129 of the others now have their katakana (Jupiter 48, Saturn 46, Uranus 22, Neptune 11 and Pluto's Styx and Kerberos, Valetudo and Hippocamp among them), from `scripts/moon-catalogue-ja.json`, which the build script reads so that `--refresh` keeps them and which says, for each, the published list it comes from: the National Museum of Nature and Science's moon table (mainly from the Rika Nenpyo) and the Japanese Wikipedia, which agree on 92 of them; where they differ the entry says what the other writes. NAOJ itself says the readings of the new moons' names are unconfirmed, so 17 named moons (Eirene, Philophrosyne, Eupheme, Pandia, Ersa, Gridr, Angrboda, Skrymir, Gerd, Eggther, Beli, Gunnlod, Thiazzi, Alvaldi, Geirrod, Weywot and Xiangliu) still show their English names. `full` is a column of its own now (it was "has a Japanese name"). The Japanese names were looked at by the Japanese reviewer; ten are marked `check` in the table for a native read (Thyone, Siarnaq, Tarqeq, Suttungr, Thrymr, Perdita, Setebos, Erriapus, Hyperion and Valetudo), and where the two lists differ the choice is a published form each time, so it is not to be harmonised into a spelling no list has.
|
|
23
|
+
|
|
24
|
+
- **Vanth is ヴァンス in Japanese** (MODULES-1088). The Japanese name of Orcus's moon was ヴァント, for which no published source was found; Japanese Wikipedia (ヴァンス_(衛星)) and Wikidata write ヴァンス, the Nayoro Observatory's 2014 report on its star occultation writes バンス, and the Japanese moon-catalogue guide already wrote ヴァンス. `facts.ts`, the moon catalogue's `ja`, the site's description of the shaded dwarf-planet moons, and the Japanese close-zoom and plan guides now say ヴァンス. Checked by the Japanese reviewer. Gonggong's name (ゴンゴン) is not changed: no confirmed official katakana yet.
|
|
25
|
+
|
|
26
|
+
- **`/discovery`: how each planet, dwarf planet and drawn moon was found** (MODULES-1092). A new entry point with a record for each of the 46 bodies (the eight planets, nine dwarf planets, the Moon and 28 moons drawn in full): the day, the place, the discoverers, how it was found, the first provisional designation, the number, the circular that announced a moon, who named an old moon and where the name comes from, every fact with the source it was read from (`DISCOVERY_SOURCES`: the IAU's Gazetteer of Planetary Nomenclature at the USGS, the JPL Small-Body Database, JPL's moon discovery page, Wikidata) and `notes` where another source gives a different day or credit (Pluto 23 January 1930 against 18 February, Charon 13 April against 22 June, Mimas 18 July against 17 September, Neptune's four credits, Haumea with no person named). `discoveryOf(id)`, `DISCOVERIES`, `DISCOVERY_IDS`, `DISCOVERY_METHODS`. The `method` is worked out here from the place and the date and its source says `derived`. Left out, and said so in the guide: the day a minor planet was numbered or named (JPL gives the batch of circulars, not a day) and the day a moon's name was approved (no source read gives it); Vanth has a day but no place, and Haumea no discoverer. The records are made by `scripts/make-discovery-data.py`, which fetches nothing. English guide and Japanese twin (checked by the Japanese reviewer), `NOTICE.md`, 5 tests in `test/discovery.test.ts`, size 4.6 kB gzipped.
|
|
27
|
+
|
|
28
|
+
- **`placeOf` follows the view with the names off** (MODULES-1401). The places of the bodies were made only while `labels` was on, so a page that had turned the names off was handed the places from the last draw before, however far the view had moved since. They are made at every draw now; with the names off the discs that hide one name behind a nearer body are still not worked out (`coveredAt` stays `null`, as documented).
|
|
29
|
+
|
|
30
|
+
- **Fewer stops between the turn and the way on** (MODULES-1384). The way on that starts while the turn is still going had to keep the body left in the picture through the whole turn (0.55.0, the `held` fault), so most overlaps were refused: of 54 moves of nine pairs, 26 stopped between the turn and the way on (it was 42 before the planner's overlap, 9 with it and without that rule). The turn still holds the body left until the way on starts; while the two overlap the picture needs one of the two bodies, which is the rule that was always there (never an empty picture). Now 14 of the 54 stop and 38 start the way on during the turn (35 before); in 22 moves the body left is out of the picture for a few samples of the overlap (368 of 13,000, the destination in it), the moves are 2 percent shorter in all (253 s against 259 s), and no walk has an empty picture, a drifting destination or a step more than before. The 14 that are left, and the moves whose way on turns round the destination as it goes (the Earth to Mars, Mars to Jupiter, Neptune to Mercury, the Sun to the Earth, the Moon to Titan), keep their own timing, which an earlier start would make jump. Tests: `test/travel-smooth.test.ts` holds the 54 moves to no more than 16 stops, no fault at all, and the body left in the picture until the way on starts; it fails on the 0.65.0 planner with its 26. The GL walk in `e2e/space-travel.demo.ts` asks for the body left only in the frames of the turn where the destination is not on the screen (not run yet: the browser lock is held by a sweep).
|
|
31
|
+
|
|
32
|
+
- **The names of the craft give way, and the plan marks several craft** (MODULES-1535). With `spacecraft` on, every craft's name was always shown: at the Earth the long names of JUICE, the James Webb Space Telescope and the Moon ran over the Earth's own, two craft names lay over each other, and a name could sit under the page's bar. A craft's name now ranks after every body's, so a planet's, dwarf planet's or moon's name always wins; craft names give way to each other (the craft chosen, then a favourite, then the nearer to the body in view); a craft's name goes round its dot (left, above, below) before it is left out, and the dot stays. New on `<wakusei-space>`: `keepOut` (a list of rectangles `{ x, y, w, h }` of the element's own box that no name is written under), `favourites` (a list of craft ids) and `labelShort` (a short label per craft, `{ en, ja }` or one text, the full name staying the craft's name for a card, a press, an event and a screen reader; the package ships none). Labels of craft carry `data-craft`. The pure layout is `placeLabels` (with `KeepOut`, `craftRank`, `craftSize` and `nameAlternates`) in `/space`, and `chooseLabels` takes the rectangles too. `<wakusei-plan>` takes `marks` (an attribute of ids, or the property): the favourites are ringed and named beside `mark`, and `planAt` takes `marks` and gives `plan.marks`; the screen-reader label names every body marked. Tests: `test/space-craft-labels.test.ts` (the layout: bodies win, craft rank, the places round a dot, the keep-out, order-independence), `test/plan.test.ts`; `e2e/space-craft-labels.demo.ts` is written and has not run yet (the browser lock is held by a sweep).
|
|
33
|
+
|
|
5
34
|
## [0.65.0] - 2026-11-17
|
|
6
35
|
|
|
7
36
|
- **The Apollo lunar rover from a museum's 3D model** (MODULES-1459). `models/apollo-lrv.glb` (1.0 MB, served beside the demo like Perseverance and Curiosity, in no npm package): "Mondfahrzeug (Lunar Rover)" by Deutsches Museum | Digital, **CC BY-SA 4.0**, modified (trimmed from about 440,000 vertices to 74,000, the four wheels split into their own nodes inside steering pivots, two seat eyes, textures shrunk). It is not NASA's: the one file in the repository under that licence, a named exception, so the demo's surface page carries its credit line (title, author, licence with its link, modified, share-alike), `NOTICE.md` names the file and the code around it stays MIT. `drive-model="/models/apollo-lrv.glb"` draws it in place of the shapes, its wheels rolling and steering with the drive and `seat-commander` as the seat view. The replica is 3.02 m long and 1.75 m wide with a 1.92 m wheelbase against the published 3.05 m, 2.13 m and 2.29 m; its own proportions were kept, not stretched, and the drive takes the model's. A test loads it at Apollo 17 and checks its nodes, its wheels, its steering and its eye.
|
package/NOTICE.md
CHANGED
|
@@ -20,6 +20,7 @@ No picture is used by the line and shaded looks: they are drawn from numbers.
|
|
|
20
20
|
- **Where the planets are in the sky (`/sky-bodies`)**, 2026-11-13: the positions are this package's own (the Sun and the Moon of `/suncalc`, VSOP87B for the planets, Pluto's table above). The planets' apparent magnitudes are the formulas of the Astronomical Almanac as given in A. Mallama and J. L. Hilton (2018), "Computing Apparent Planetary Magnitudes for The Astronomical Almanac", Astronomy and Computing 25, 10 (arXiv:1808.01973, read online 2026-11-13): the formulas only, typed as code (Mercury, Venus, Mars without its surface-albedo terms, Jupiter, Saturn with its rings, Uranus, Neptune after 2000); the Sun's apparent magnitude of -26.74 at one astronomical unit is the visual magnitude V(1,0) of NASA's Sun Fact Sheet (https://nssdc.gsfc.nasa.gov/planetary/factsheet/sunfact.html, read 2026-11-13), scaled by 5 log10 of the distance in astronomical units as in the JPL Horizons manual (https://ssd.jpl.nasa.gov/horizons/manual.html, read 2026-11-13); the Moon's magnitude law (-12.73 + 0.026 |phase angle| + 4e-9 phase angle to the fourth, plus 5 log10 of the distance over 384400 km) is the one the same Horizons manual gives for the Moon, after Krisciunas and Schaefer (1991), "A model of the brightness of moonlight", Publications of the Astronomical Society of the Pacific 103, 1033, cross-checked with the -12.74 of NASA's Moon Fact Sheet (https://nssdc.gsfc.nasa.gov/planetary/factsheet/moonfact.html, read 2026-11-13): the constants only, typed as code; and Pluto's H = -0.55 is from the JPL Small-Body Database (https://ssd-api.jpl.nasa.gov/sbdb.api, read 2026-11-13). The figures the tests compare with are numbers read online from JPL Horizons (https://ssd.jpl.nasa.gov/api/horizons.api, observer tables read 2026-11-13: R.A. and DEC (ICRF) and (a-appar), APmag, Illu%, Ang-diam, S-O-T, and Azi and Elev (a-app) for Tokyo, 139.69 E 35.69 N 40 m, and Ottawa, 75.70 W 45.42 N 70 m), on 2024-03-20 12:00, 2026-06-21 12:00 and 2030-12-01 00:00 UTC. Facts only: no text or file is copied.
|
|
21
21
|
- **Stars (`/stars`)**: the Yale Bright Star Catalogue, D. Hoffleit and W. H. Warren Jr. (1991), "The Bright Star Catalogue, 5th Revised Edition (Preliminary Version)", Astronomical Data Center (NASA Goddard Space Flight Center) and the Centre de Données astronomiques de Strasbourg, catalogue V/50, as NASA's HEASARC serves it (table bsc5p, https://heasarc.gsfc.nasa.gov/W3Browse/star-catalog/bsc5p.html, file heasarc_bsc5p.tdat.gz, read 2026-11-08; a US government source), the 5,080 stars to visual magnitude 6.0, written out as numbers by `scripts/make-star-data.py` into `src/data/stars.ts`. The catalogue's own documentation calls it public domain and the Astronomical Data Center asks that it and the authors be acknowledged, which this line does; there is no formal licence text, so this footing is informal. The common names are our own list after the IAU Working Group on Star Names (https://www.iau.org/science/scientific_bodies/working_groups/280/); the star colour is Ballesteros's B-V to temperature relation (F. J. Ballesteros 2012, EPL 97, 34008) and a piecewise black-body colour fit. Deliberately NOT used: the Hipparcos, Tycho and Gaia catalogues (ESA, CC BY-NC 3.0 IGO, non-commercial), and HYG, AT-HYG and OpenNGC (CC BY-SA, which would put share-alike terms on this package's data).
|
|
22
22
|
- **Mass and escape speed** (`JOURNEY_STOPS`): JPL "Planetary Satellite Physical Parameters" (https://ssd.jpl.nasa.gov/sats/phys_par/, read 2026-11-04) for the GM of the Earth, Mars through Pluto and the moons on that page; NASA's Sun, Mercury and Venus fact sheets (https://nssdc.gsfc.nasa.gov/planetary/factsheet/, read 2026-11-04) for those three GM values and the Sun's escape speed; JPL "Planetary Physical Parameters" (https://ssd.jpl.nasa.gov/planets/phys_par.html, read 2026-11-04) for the planets' escape speeds and for the masses of Ceres, Eris, Makemake and Haumea, turned into GM with the CODATA 2018 G that page names. A moon's escape speed is computed from its GM and the radius already in this package. Nereid, Orcus, Quaoar, Gonggong, Sedna, Vanth, Hiʻiaka, Namaka and Dysnomia are left blank: those pages do not print a mass.
|
|
23
|
+
- **Physics of a body (`bodyPhysics` in `@johnmorrisdotca/wakusei-planets/body-physics`, `src/body-physics.ts`)**: NASA Space Science Data Coordinated Archive (NSSDC), the planetary fact sheets of the Sun, Mercury, Venus, Earth, Moon, Mars, Jupiter, Saturn, Uranus, Neptune and Pluto (https://nssdc.gsfc.nasa.gov/planetary/factsheet/<body>fact.html; one page each, read 2026-11-18; the day each page says it was last updated is in the table, 2024-01-11 to 2025-05-19). The robots.txt of nssdc.gsfc.nasa.gov does not disallow /planetary/. The figures are facts typed as a table (mass, GM, surface gravity, and the surface air density, pressure and temperature, or the 1 bar level's for the gas giants), with the sheet's own wording kept where it is not a plain number; none of the pages' text is copied, and a figure a page does not give is left out, not estimated. GM here is the sheet's, to the digits it prints; `JOURNEY_STOPS` above carries JPL's GM to more digits for the same bodies.
|
|
23
24
|
|
|
24
25
|
## The dwarf planets
|
|
25
26
|
|
|
@@ -259,9 +260,15 @@ The rows of `/moon-catalogue` (`src/data/moon-catalogue.ts`, made by `scripts/ma
|
|
|
259
260
|
- **The moons of the dwarf planets besides Pluto** (Dysnomia, Hiʻiaka, Namaka, Weywot, Vanth, Xiangliu and Makemake's S/2015 (136472) 1): the Small-Body Satellites API (https://ssd-api.jpl.nasa.gov/sb_sat.api, version 1.0, read 2026-11-11), which gives each one's name, year and reference but no mean orbit and no discoverers.
|
|
260
261
|
- **Data sheets and the positions measured against**: JPL Horizons (https://ssd.jpl.nasa.gov/api/horizons.api, read 2026-11-11), one request a moon: its data sheet (a radius, an albedo or a V(1,0) magnitude where the sheet gives one) and its geometric position from its planet's centre (ecliptic and equinox J2000, km) on the days the orbit is set from (2026-01-01, 01-02, 02-01 and 04-01 TDB) and the days it is measured on (2025-07-02, 2026-07-02 and 2027-07-02, and 1990-01-01, 2000-01-01.5 and 2040-01-01), the measured ones kept in `test/data/moon-catalogue-horizons.json`.
|
|
261
262
|
- **Sizes worked out from the brightness**: D = 10^(3.1236 − 0.5 log10(albedo) − 0.2 V), the formula of NASA/JPL CNEOS's asteroid size estimator (https://cneos.jpl.nasa.gov/tools/ast_size_est.html and its script, read 2026-11-11), with the sheet's albedo where it gives one and 0.04 (the sheet's albedo for Himalia, the largest irregular moon) where it does not. These radii are flagged `derived` and are this package's own estimate, not a measurement.
|
|
263
|
+
- **Osculating orbits of the irregular moons** (`src/data/moon-osculating.ts`, `scripts/make-moon-osculating.py`, `test/data/moon-osculating-horizons.json`): JPL Horizons (https://ssd.jpl.nasa.gov/api/horizons.api, read 2026-11-18, VECTORS, one request a moon, a pause between them, cached outside the repository; NASA/JPL content is not subject to copyright in the United States): each moon's place and speed on 2026-12-01 as the two-body orbit that fits them, and Horizons' places for a sample on dates the orbit was not set from. The GM of the four planets is JPL's (planetary satellite physical parameters).
|
|
264
|
+
- **Absolute magnitudes of 356 irregular moons with no other size**, 2026-11-18: English Wikipedia's tables of the moons of Jupiter, Saturn, Uranus and Neptune (https://en.wikipedia.org/wiki/Moons_of_Jupiter, `Moons_of_Saturn`, `Moons_of_Uranus`, `Moons_of_Neptune`; Wikipedia's text is CC BY-SA 4.0). One number a moon is taken, the absolute magnitude, which the tables take from the Minor Planet Center's Natural Satellites Ephemeris Service; a measured number is a fact, and no text, diameter or other column of the tables is kept. They are in `scripts/moon-catalogue-magnitudes.json`, made by `scripts/make-moon-magnitudes.py` with one request for each page; the sizes worked out from them are estimates and say so (`radiusFrom: "derived"`, `magnitudeFrom: "wikipedia"`). The Minor Planet Center's discovery circulars, which would have been the source, are closed to programs by its robots.txt (read 2026-11-18) and were not read.
|
|
262
265
|
- **Groups** are this package's own sorting of the mean orbits by a stated rule (the guide "Every known moon"); the group names are the usual ones, each named after its largest member.
|
|
263
266
|
- **Japanese names** are given only for the 29 moons the package draws in full, whose katakana was checked; the other moons keep their English names and designations.
|
|
264
267
|
|
|
268
|
+
## Discovery facts
|
|
269
|
+
|
|
270
|
+
The records of `/discovery` (`src/data/discovery.ts`, made by `scripts/make-discovery-data.py`, which fetches nothing) are facts, each with its source named in the data and in `docs/guides/discovery.md`. The Gazetteer of Planetary Nomenclature (the IAU Working Group for Planetary System Nomenclature, hosted by the USGS Astrogeology Science Center, a US government work, https://planetarynames.wr.usgs.gov/Page/Planets, read 2026-11-18) gives the days, places and discoverers and the account of each name, which is told in our own words and not copied. The JPL Small-Body Database API (https://ssd-api.jpl.nasa.gov/sbdb.api, discovery record, read 2026-11-18; NASA/JPL content is not subject to copyright in the United States) gives a minor planet's first designation, day, place and discoverers; its naming citations, which are the Minor Planet Center's, are not copied. JPL's Planetary Satellite Discovery Circumstances (read 2026-11-11, as above) gives a moon's designation and announcement. Wikidata (CC0, https://www.wikidata.org/, read 2026-11-18) gives the few facts the others do not. The `method` of each record is worked out here and says so.
|
|
271
|
+
|
|
265
272
|
## The Moon's ground (standing on the Moon)
|
|
266
273
|
|
|
267
274
|
The height tiles of `<wakusei-surface>` (`scripts/make-moon-terrain.py`; they are made by the Pages workflow and are in no package and no repository), read on 2026-11-13. Only files from the NASA Planetary Data System archive are used, from the hosts `pds.lroc.im-ldi.com` (the LROC data node) and `pds-geosciences.wustl.edu` (the Geosciences node); the originals are kept outside the checkout.
|
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ Wakusei Planets runs in the browser of a phone, a tablet or a computer: nothing
|
|
|
19
19
|
|
|
20
20
|
<p align="center"><img alt="The demo on a desk: Saturn in the painted look, turning in the big view, with the page's links to the portrait builder, the colouring sheets, the space view, the star page and the size line-up above it, and the choice of body and its moons below" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/main/docs/images/home-desk.webp" width="620"> <img alt="The same page on a phone: the same links in rows, and Saturn in the painted look below them" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/main/docs/images/home-phone.webp" width="200"></p>
|
|
21
21
|
|
|
22
|
-
<p align="center"><img alt="Every body at one scale, the Earth among them: each small body has a magnified picture joined by a line, and the Sun shows only its edge" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.
|
|
22
|
+
<p align="center"><img alt="Every body at one scale, the Earth among them: each small body has a magnified picture joined by a line, and the Sun shows only its edge" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.67.0/docs/images/lineup-desk.png" width="640"></p>
|
|
23
23
|
|
|
24
24
|
## Who it is for
|
|
25
25
|
|
|
@@ -412,7 +412,7 @@ The tiles of every body share one 48 MB budget, six loads at a time for a source
|
|
|
412
412
|
|
|
413
413
|
## The portrait builder
|
|
414
414
|
|
|
415
|
-
<p align="center"><img alt="The Sun and the planets in an arc, painted, with their names, in the portrait builder" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.
|
|
415
|
+
<p align="center"><img alt="The Sun and the planets in an arc, painted, with their names, in the portrait builder" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.67.0/docs/images/portrait-family.png" width="640"></p>
|
|
416
416
|
|
|
417
417
|
[The portrait builder](https://johnmorrisdotca.github.io/wakusei-planets/portrait.html) puts any bodies in one picture: drag them, size them, turn them, order them front to back, arrange them in a row, an arc, a grid or at true orbit distance (true or readable sizes, a planet's moons round it in orbit order), light them from one direction, and take the code, a PNG or an SVG. The scene is kept in the address, and every body is drawn in one WebGL scene, so the page holds one WebGL context. [The portrait builder](docs/guides/portrait-builder.md) is its guide.
|
|
418
418
|
|
|
@@ -568,7 +568,7 @@ BODIES.pluto.kind; // "dwarf-planet"
|
|
|
568
568
|
|
|
569
569
|
If this package helps a paper, a talk or a class, please cite it as software. GitHub's "Cite this repository" button reads [CITATION.cff](CITATION.cff) and gives BibTeX and APA; in plain text:
|
|
570
570
|
|
|
571
|
-
> Morris, J. (2026). *Wakusei Planets* (version 0.
|
|
571
|
+
> Morris, J. (2026). *Wakusei Planets* (version 0.67.0) [Computer software]. https://github.com/johnmorrisdotca/wakusei-planets
|
|
572
572
|
|
|
573
573
|
Cite the version you used (`npm ls @johnmorrisdotca/wakusei-planets`), and cite the sources of the numbers you use as well: [NOTICE.md](NOTICE.md) names each one, with the paper or the page it was read from (the IAU working group's report for sizes and poles, VSOP87B, ELP2000-82B, L1.2 and TASS1.7 for positions, and NASA's JPL Horizons for the fits and the spacecraft).
|
|
574
574
|
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bodies that have a physics sheet: the Sun, the eight planets, Pluto and the Moon.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { PHYSICS_IDS } from "@johnmorrisdotca/wakusei-planets/body-physics";
|
|
7
|
+
*
|
|
8
|
+
* console.log(PHYSICS_IDS.join(", "));
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export declare const PHYSICS_IDS: readonly ["sun", "mercury", "venus", "earth", "moon", "mars", "jupiter", "saturn", "uranus", "neptune", "pluto"];
|
|
12
|
+
/**
|
|
13
|
+
* The id of a body that has a physics sheet.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* import { PHYSICS_IDS, type PhysicsId } from "@johnmorrisdotca/wakusei-planets/body-physics";
|
|
18
|
+
*
|
|
19
|
+
* const id: PhysicsId = PHYSICS_IDS[3];
|
|
20
|
+
* console.log(id);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export type PhysicsId = (typeof PHYSICS_IDS)[number];
|
|
24
|
+
/**
|
|
25
|
+
* Where a figure was read: the page, the day the page says it was last updated, and the day it was read for this package.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* import { bodyPhysics, type PhysicsSource } from "@johnmorrisdotca/wakusei-planets/body-physics";
|
|
30
|
+
*
|
|
31
|
+
* const source: PhysicsSource = bodyPhysics("mars").mass!.source;
|
|
32
|
+
* console.log(source.url, source.pageUpdated, source.read);
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export interface PhysicsSource {
|
|
36
|
+
name: string;
|
|
37
|
+
url: string;
|
|
38
|
+
/** The day the page says it was last updated (`2025-05-19`). */
|
|
39
|
+
pageUpdated: string;
|
|
40
|
+
/** The day the page was read for this package. */
|
|
41
|
+
read: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* One figure: its number in SI units (or the unit named), where it comes from, how the source writes it, and what it holds at.
|
|
45
|
+
*
|
|
46
|
+
* `quoted` is the source's own wording of the figure where it is not a plain number (`"~0.016 +/- 0.006 kg/m3"`, `"1014 mb"`, `">>1000 bars"`). `bound` is `"below"` for a figure the source gives as an upper limit and `"about"` for one it marks approximate. `uncertainty`
|
|
47
|
+
* is the +/- the source gives, in the same unit. `low` and `high` are the range it gives (a season, a day). `level` says where a figure holds when it is not the surface: `"1 bar"` for the gas giants, whose sheets give gravity, density and temperature at the 1 bar level, and
|
|
48
|
+
* `"top of photosphere"` for the Sun's pressure.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* import { bodyPhysics, type PhysicsReading } from "@johnmorrisdotca/wakusei-planets/body-physics";
|
|
53
|
+
*
|
|
54
|
+
* const density: PhysicsReading = bodyPhysics("mars").airDensity!;
|
|
55
|
+
* console.log(density.value, density.unit, density.uncertainty, density.quoted);
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export interface PhysicsReading {
|
|
59
|
+
value: number;
|
|
60
|
+
unit: "kg" | "km3/s2" | "m/s2" | "kg/m3" | "Pa" | "K";
|
|
61
|
+
source: PhysicsSource;
|
|
62
|
+
quoted?: string;
|
|
63
|
+
bound?: "below" | "about";
|
|
64
|
+
uncertainty?: number;
|
|
65
|
+
low?: number;
|
|
66
|
+
high?: number;
|
|
67
|
+
level?: string;
|
|
68
|
+
note?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The physics of a body. Each field is `null` where the source has no figure: the Sun, Mercury, the Moon and Pluto have no air density, and the Moon and Pluto's sheets give a range of temperature and no single figure (it is in `temperature.low` and `high`, with `value` `null`).
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* import { bodyPhysics, type BodyPhysics } from "@johnmorrisdotca/wakusei-planets/body-physics";
|
|
76
|
+
*
|
|
77
|
+
* const earth: BodyPhysics = bodyPhysics("earth");
|
|
78
|
+
* console.log(earth.surfaceGravity?.value, earth.pressure?.value, earth.temperature?.value);
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
export interface BodyPhysics {
|
|
82
|
+
id: PhysicsId;
|
|
83
|
+
/** The mass in kilograms. */
|
|
84
|
+
mass: PhysicsReading | null;
|
|
85
|
+
/** The gravitational parameter GM in km3/s2. */
|
|
86
|
+
gm: PhysicsReading | null;
|
|
87
|
+
/** The surface gravity in m/s2: the mean at the surface, the Sun's at its equator, and the gas giants' at the 1 bar level. */
|
|
88
|
+
surfaceGravity: PhysicsReading | null;
|
|
89
|
+
/** The density of the air at the surface in kg/m3, or at the 1 bar level for the gas giants. */
|
|
90
|
+
airDensity: PhysicsReading | null;
|
|
91
|
+
/** The pressure at the surface in pascals, at the 1 bar level (100,000 Pa, the sheet's level) for the gas giants, or at the top of the Sun's photosphere. */
|
|
92
|
+
pressure: PhysicsReading | null;
|
|
93
|
+
/** The temperature in kelvin: the mean at the surface, the 1 bar level's for the gas giants, the Sun's effective temperature. `value` is `null` where the sheet gives only a range. */
|
|
94
|
+
temperature: (Omit<PhysicsReading, "value"> & {
|
|
95
|
+
value: number | null;
|
|
96
|
+
}) | null;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The physics of the Sun, a planet, Pluto or the Moon: its mass and GM, its surface gravity, the air at its surface and its surface temperature, each with the page and day it was read from, and `null` where the source has none (the Sun, Mercury, the Moon and Pluto have no air
|
|
100
|
+
* density).
|
|
101
|
+
*
|
|
102
|
+
* @param id - `"sun"`, `"mercury"` to `"neptune"`, `"pluto"` or `"moon"`; any other id (a dwarf planet, another planet's moon) has no sheet.
|
|
103
|
+
* @returns The physics (a new object each call), or `null` for a body that has no sheet, so a page can leave its physics out for it.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* import { bodyPhysics } from "@johnmorrisdotca/wakusei-planets/body-physics";
|
|
108
|
+
*
|
|
109
|
+
* const jupiter = bodyPhysics("jupiter");
|
|
110
|
+
* console.log(jupiter.surfaceGravity?.value, jupiter.surfaceGravity?.level, jupiter.temperature?.value, jupiter.temperature?.source.read);
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
export declare function bodyPhysics(id: PhysicsId): BodyPhysics;
|
|
114
|
+
export declare function bodyPhysics(id: string): BodyPhysics | null;
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
// What a physics model of a body needs, as data (MODULES-1553): mass and GM, surface gravity, the air at the surface, and the surface temperature, each figure with where it was read and the day it was read, and left out where the source has none. Every number is a fact
|
|
2
|
+
// read from NASA's planetary fact sheets (NSSDC, https://nssdc.gsfc.nasa.gov/planetary/factsheet/) on 2026-11-18, one page for each body, with the page's own "Last Updated" day beside it; no text of the pages is copied. Pure: no DOM, no clock reads, no three.js.
|
|
3
|
+
/**
|
|
4
|
+
* The bodies that have a physics sheet: the Sun, the eight planets, Pluto and the Moon.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { PHYSICS_IDS } from "@johnmorrisdotca/wakusei-planets/body-physics";
|
|
9
|
+
*
|
|
10
|
+
* console.log(PHYSICS_IDS.join(", "));
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export const PHYSICS_IDS = ["sun", "mercury", "venus", "earth", "moon", "mars", "jupiter", "saturn", "uranus", "neptune", "pluto"];
|
|
14
|
+
const READ = "2026-11-18";
|
|
15
|
+
const PAGE = "https://nssdc.gsfc.nasa.gov/planetary/factsheet/";
|
|
16
|
+
const NAME = { sun: "Sun", mercury: "Mercury", venus: "Venus", earth: "Earth", moon: "Moon", mars: "Mars", jupiter: "Jupiter", saturn: "Saturn", uranus: "Uranus", neptune: "Neptune", pluto: "Pluto" };
|
|
17
|
+
// the day each page says it was last updated (its own "Last Updated" line)
|
|
18
|
+
const UPDATED = {
|
|
19
|
+
sun: "2024-05-09",
|
|
20
|
+
mercury: "2024-01-11",
|
|
21
|
+
venus: "2024-01-11",
|
|
22
|
+
earth: "2024-11-15",
|
|
23
|
+
moon: "2024-01-11",
|
|
24
|
+
mars: "2025-05-19",
|
|
25
|
+
jupiter: "2024-10-02",
|
|
26
|
+
saturn: "2025-03-18",
|
|
27
|
+
uranus: "2024-10-02",
|
|
28
|
+
neptune: "2024-10-03",
|
|
29
|
+
pluto: "2024-01-11",
|
|
30
|
+
};
|
|
31
|
+
const ROWS = {
|
|
32
|
+
sun: {
|
|
33
|
+
mass: 1_988_400,
|
|
34
|
+
gm: 132_712,
|
|
35
|
+
gravity: 274.0,
|
|
36
|
+
gravityNote: "at the equator",
|
|
37
|
+
pressure: { bar: 0.000868, quoted: "0.868 mb", level: "top of photosphere" },
|
|
38
|
+
temperature: { value: 5772, quoted: "5772 K", level: "effective", note: "the effective temperature; 4400 K at the top of the photosphere and 6600 K at the bottom" },
|
|
39
|
+
},
|
|
40
|
+
mercury: {
|
|
41
|
+
mass: 0.3301,
|
|
42
|
+
gm: 0.022032,
|
|
43
|
+
gravity: 3.7,
|
|
44
|
+
pressure: { bar: 5e-15, quoted: "<~5 x 10-15 bar", bound: "below" },
|
|
45
|
+
temperature: { value: 440, quoted: "440 K (167 C)", note: "the average; 590 to 725 K on the sunward side" },
|
|
46
|
+
},
|
|
47
|
+
venus: {
|
|
48
|
+
mass: 4.8673,
|
|
49
|
+
gm: 0.32486,
|
|
50
|
+
gravity: 8.87,
|
|
51
|
+
density: { value: 65, quoted: "~65. kg/m3", bound: "about" },
|
|
52
|
+
pressure: { bar: 92, quoted: "92 bars" },
|
|
53
|
+
temperature: { value: 737, quoted: "737 K (464 C)" },
|
|
54
|
+
},
|
|
55
|
+
earth: {
|
|
56
|
+
mass: 5.9722,
|
|
57
|
+
gm: 0.3986,
|
|
58
|
+
gravity: 9.82,
|
|
59
|
+
density: { value: 1.217, quoted: "1.217 kg/m3" },
|
|
60
|
+
pressure: { bar: 1.014, quoted: "1014 mb" },
|
|
61
|
+
temperature: { value: 288, quoted: "288 K (15 C)", low: 283, high: 293, note: "the average; the diurnal range is 283 to 293 K" },
|
|
62
|
+
},
|
|
63
|
+
moon: {
|
|
64
|
+
mass: 0.07346,
|
|
65
|
+
gm: 0.0049,
|
|
66
|
+
gravity: 1.62,
|
|
67
|
+
pressure: { bar: 3e-15, quoted: "3 x 10-15 bar", note: "at night" },
|
|
68
|
+
temperature: { value: null, quoted: "95 K to 390 K", low: 95, high: 390, note: "the diurnal range at the equator" },
|
|
69
|
+
},
|
|
70
|
+
mars: {
|
|
71
|
+
mass: 0.64169,
|
|
72
|
+
gm: 0.042828,
|
|
73
|
+
gravity: 3.73,
|
|
74
|
+
density: { value: 0.016, quoted: "~0.016 +/- 0.006 kg/m3", bound: "about", uncertainty: 0.006 },
|
|
75
|
+
pressure: { bar: 0.00636, quoted: "6.36 mb at mean radius (variable from 4.0 to 8.7 mb depending on season)", low: 0.004, high: 0.0087, note: "at the mean radius" },
|
|
76
|
+
temperature: { value: 214, quoted: "~214 K (-59 C)", bound: "about", low: 184, high: 242, note: "the average; the diurnal range 184 to 242 K is at the Viking 1 lander site" },
|
|
77
|
+
},
|
|
78
|
+
jupiter: {
|
|
79
|
+
mass: 1_898.13,
|
|
80
|
+
gm: 126.687,
|
|
81
|
+
gravity: 25.92,
|
|
82
|
+
gravityLevel: "1 bar",
|
|
83
|
+
density: { value: 0.16, quoted: "0.16 kg/m3", level: "1 bar" },
|
|
84
|
+
pressure: { bar: 1, quoted: "1 bar", level: "1 bar", note: "the 1 bar level, where the sheet gives the gravity, density and temperature; it gives no surface" },
|
|
85
|
+
temperature: { value: 165, quoted: "165 K (-108 C)", level: "1 bar" },
|
|
86
|
+
},
|
|
87
|
+
saturn: {
|
|
88
|
+
mass: 568.32,
|
|
89
|
+
gm: 37.931,
|
|
90
|
+
gravity: 11.19,
|
|
91
|
+
gravityLevel: "1 bar",
|
|
92
|
+
density: { value: 0.19, quoted: "0.19 kg/m3", level: "1 bar" },
|
|
93
|
+
pressure: { bar: 1, quoted: "1 bar", level: "1 bar", note: "the 1 bar level, where the sheet gives the gravity, density and temperature; it gives no surface" },
|
|
94
|
+
temperature: { value: 134, quoted: "134 K (-139 C)", level: "1 bar" },
|
|
95
|
+
},
|
|
96
|
+
uranus: {
|
|
97
|
+
mass: 86.811,
|
|
98
|
+
gm: 5.794,
|
|
99
|
+
gravity: 9.01,
|
|
100
|
+
gravityLevel: "1 bar",
|
|
101
|
+
density: { value: 0.42, quoted: "0.42 kg/m3", level: "1 bar" },
|
|
102
|
+
pressure: { bar: 1, quoted: "1 bar", level: "1 bar", note: "the 1 bar level, where the sheet gives the gravity, density and temperature; it gives no surface" },
|
|
103
|
+
temperature: { value: 76, quoted: "76 K (-197 C)", level: "1 bar" },
|
|
104
|
+
},
|
|
105
|
+
neptune: {
|
|
106
|
+
mass: 102.409,
|
|
107
|
+
gm: 6.8351,
|
|
108
|
+
gravity: 11.27,
|
|
109
|
+
gravityLevel: "1 bar",
|
|
110
|
+
density: { value: 0.45, quoted: "0.45 kg/m3", level: "1 bar" },
|
|
111
|
+
pressure: { bar: 1, quoted: "1 bar", level: "1 bar", note: "the 1 bar level, where the sheet gives the gravity, density and temperature; it gives no surface" },
|
|
112
|
+
temperature: { value: 72, quoted: "72 K (-201 C)", level: "1 bar" },
|
|
113
|
+
},
|
|
114
|
+
pluto: {
|
|
115
|
+
mass: 0.01303,
|
|
116
|
+
gm: 0.00087,
|
|
117
|
+
gravity: 0.62,
|
|
118
|
+
pressure: { bar: 1.3e-5, quoted: "~13 microbar", bound: "about" },
|
|
119
|
+
temperature: { value: null, quoted: "24 - 38 K (-247 - -233 C)", low: 24, high: 38 },
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
const BAR_PA = 100_000;
|
|
123
|
+
/** A product written without the float noise of a scale (`0.00636 * 1e5` is not 636 to the last bit). */
|
|
124
|
+
const scaled = (value, factor) => Number((value * factor).toPrecision(12));
|
|
125
|
+
export function bodyPhysics(id) {
|
|
126
|
+
if (!PHYSICS_IDS.includes(id))
|
|
127
|
+
return null;
|
|
128
|
+
const body = id;
|
|
129
|
+
const row = ROWS[body];
|
|
130
|
+
const source = () => ({ name: `NASA NSSDC Planetary Fact Sheet: ${NAME[body]}`, url: `${PAGE}${body}fact.html`, pageUpdated: UPDATED[body], read: READ });
|
|
131
|
+
const mass = { value: scaled(row.mass, 1e24), unit: "kg", source: source() };
|
|
132
|
+
const gm = { value: scaled(row.gm, 1e6), unit: "km3/s2", source: source() };
|
|
133
|
+
const gravity = { value: row.gravity, unit: "m/s2", source: source(), ...(row.gravityLevel === undefined ? {} : { level: row.gravityLevel }), ...(row.gravityNote === undefined ? {} : { note: row.gravityNote }) };
|
|
134
|
+
const d = row.density;
|
|
135
|
+
const p = row.pressure;
|
|
136
|
+
const t = row.temperature;
|
|
137
|
+
return {
|
|
138
|
+
id: body,
|
|
139
|
+
mass,
|
|
140
|
+
gm,
|
|
141
|
+
surfaceGravity: gravity,
|
|
142
|
+
airDensity: d === undefined
|
|
143
|
+
? null
|
|
144
|
+
: { value: d.value, unit: "kg/m3", source: source(), quoted: d.quoted, ...(d.bound === undefined ? {} : { bound: d.bound }), ...(d.uncertainty === undefined ? {} : { uncertainty: d.uncertainty }), ...(d.level === undefined ? {} : { level: d.level }) },
|
|
145
|
+
pressure: p === undefined
|
|
146
|
+
? null
|
|
147
|
+
: {
|
|
148
|
+
value: scaled(p.bar, BAR_PA),
|
|
149
|
+
unit: "Pa",
|
|
150
|
+
source: source(),
|
|
151
|
+
quoted: p.quoted,
|
|
152
|
+
...(p.bound === undefined ? {} : { bound: p.bound }),
|
|
153
|
+
...(p.low === undefined ? {} : { low: scaled(p.low, BAR_PA) }),
|
|
154
|
+
...(p.high === undefined ? {} : { high: scaled(p.high, BAR_PA) }),
|
|
155
|
+
...(p.level === undefined ? {} : { level: p.level }),
|
|
156
|
+
...(p.note === undefined ? {} : { note: p.note }),
|
|
157
|
+
},
|
|
158
|
+
temperature: t === undefined
|
|
159
|
+
? null
|
|
160
|
+
: { value: t.value, unit: "K", source: source(), quoted: t.quoted, ...(t.bound === undefined ? {} : { bound: t.bound }), ...(t.low === undefined ? {} : { low: t.low }), ...(t.high === undefined ? {} : { high: t.high }), ...(t.level === undefined ? {} : { level: t.level }), ...(t.note === undefined ? {} : { note: t.note }) },
|
|
161
|
+
};
|
|
162
|
+
}
|