astraeus 0.1.1 → 0.3.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.
Files changed (112) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +76 -7
  3. package/package.json +10 -6
  4. package/src/api/AstraeusScene.d.ts +27 -0
  5. package/src/api/AstraeusScene.js +38 -0
  6. package/src/api/AstraeusScene.node.js +37 -0
  7. package/src/api/activity.d.ts +50 -0
  8. package/src/api/activity.js +62 -0
  9. package/src/api/bodies.d.ts +24 -0
  10. package/src/api/bodies.js +24 -0
  11. package/src/api/errors.d.ts +1 -1
  12. package/src/api/group.d.ts +89 -0
  13. package/src/api/group.js +121 -0
  14. package/src/api/index.d.ts +6 -1
  15. package/src/api/index.js +3 -1
  16. package/src/api/index.node.js +8 -0
  17. package/src/api/mount.d.ts +10 -1
  18. package/src/api/mount.js +15 -4
  19. package/src/api/mount.node.js +36 -0
  20. package/src/api/prepared.d.ts +10 -0
  21. package/src/api/prepared.js +5 -0
  22. package/src/api/scene.d.ts +148 -9
  23. package/src/api/scene.js +563 -59
  24. package/src/api/story.d.ts +69 -0
  25. package/src/api/story.js +63 -0
  26. package/src/api/sunOrbit.d.ts +20 -0
  27. package/src/api/sunOrbit.js +85 -0
  28. package/src/api/switches.d.ts +14 -0
  29. package/src/api/switches.js +19 -0
  30. package/src/api/time.d.ts +4 -0
  31. package/src/api/time.js +8 -0
  32. package/src/app/App.d.ts +6 -2
  33. package/src/app/App.js +43 -21
  34. package/src/app/App.node.js +401 -0
  35. package/src/app/AstraeusScene.d.ts +1 -1
  36. package/src/app/DebugOverlay.d.ts +3 -52
  37. package/src/app/DebugOverlay.js +2 -29
  38. package/src/app/PanelLoadBoundary.d.ts +19 -0
  39. package/src/app/PanelLoadBoundary.js +17 -0
  40. package/src/app/SkyView.d.ts +3 -3
  41. package/src/app/SkyView.js +19 -10
  42. package/src/app/debugReadout.d.ts +53 -0
  43. package/src/app/debugReadout.js +30 -0
  44. package/src/app/developerPanels.d.ts +6 -0
  45. package/src/app/developerPanels.js +11 -0
  46. package/src/app/displaySwitches.d.ts +54 -0
  47. package/src/app/displaySwitches.js +48 -0
  48. package/src/app/experienceDefinition.d.ts +13 -1
  49. package/src/app/listSwitch.d.ts +16 -0
  50. package/src/{experiences/showers/showerChoice.js → app/listSwitch.js} +1 -9
  51. package/src/app/metricReadouts.d.ts +1 -1
  52. package/src/app/metricReadouts.js +1 -1
  53. package/src/app/openClock.d.ts +7 -0
  54. package/src/app/openClock.js +14 -0
  55. package/src/app/sceneContentsHooks.d.ts +3 -3
  56. package/src/app/sceneContentsHooks.js +2 -2
  57. package/src/app/sceneDebug.d.ts +1 -1
  58. package/src/app/sceneDebug.js +1 -1
  59. package/src/app/sceneFrame.js +4 -3
  60. package/src/app/sceneFraming.d.ts +13 -0
  61. package/src/app/sceneFraming.js +22 -0
  62. package/src/app/skyModel.js +3 -1
  63. package/src/app/trackedMetrics.d.ts +53 -0
  64. package/src/{experiences/apollo11/spacecraftMetrics.js → app/trackedMetrics.js} +40 -56
  65. package/src/assets/licence.d.ts +1 -0
  66. package/src/assets/pictures.d.ts +1 -1
  67. package/src/assets/sky.d.ts +4 -4
  68. package/src/assets/sky.js +12 -13
  69. package/src/core/bodies/index.d.ts +3 -0
  70. package/src/core/bodies/index.js +3 -1
  71. package/src/core/bodies/io.js +1 -1
  72. package/src/core/bodies/jupiterData.js +2 -2
  73. package/src/core/bodies/jupiterMoons.js +8 -12
  74. package/src/core/bodies/moon.d.ts +8 -0
  75. package/src/core/bodies/moon.js +28 -5
  76. package/src/core/bodies/outerPlanetData.js +7 -7
  77. package/src/core/bodies/planetMoons.js +18 -27
  78. package/src/core/bodies/swiftTuttle.js +2 -0
  79. package/src/core/elementsBody.d.ts +2 -0
  80. package/src/core/elementsBody.js +3 -0
  81. package/src/core/moonTrajectory.js +3 -5
  82. package/src/core/planetModels.js +1 -1
  83. package/src/core/planetSeries.d.ts +2 -0
  84. package/src/core/planetSeries.js +4 -0
  85. package/src/core/provenance.d.ts +7 -2
  86. package/src/core/provenance.js +3 -1
  87. package/src/core/scalePolicy.d.ts +3 -0
  88. package/src/core/scalePolicy.js +2 -0
  89. package/src/core/state.d.ts +1 -0
  90. package/src/shell/AstraeusShell.d.ts +4 -1
  91. package/src/shell/AstraeusShell.js +12 -6
  92. package/src/shell/AstraeusShell.node.js +225 -0
  93. package/src/shell/DisplaySwitches.d.ts +16 -0
  94. package/src/shell/DisplaySwitches.js +31 -0
  95. package/src/shell/StoryPanelView.js +3 -1
  96. package/src/shell/TimelineBar.css +4 -0
  97. package/src/shell/TimelineBar.node.js +75 -0
  98. package/src/shell/TopBar.css +20 -0
  99. package/src/shell/TopBar.d.ts +4 -1
  100. package/src/shell/TopBar.js +3 -2
  101. package/src/shell/TopBar.node.js +14 -0
  102. package/src/shell/experience.d.ts +4 -0
  103. package/src/shell/infoModel.js +3 -1
  104. package/src/shell/phone.css +4 -1
  105. package/src/shell/topBarIcons.d.ts +1 -0
  106. package/src/shell/topBarIcons.js +1 -0
  107. package/src/shell/useDrawers.js +1 -1
  108. package/src/shell/useZoomThrough.d.ts +7 -0
  109. package/src/shell/useZoomThrough.js +51 -0
  110. package/src/synthetic/syntheticDefinition.js +3 -3
  111. package/src/experiences/apollo11/spacecraftMetrics.d.ts +0 -34
  112. package/src/experiences/showers/showerChoice.d.ts +0 -25
@@ -1,5 +1,5 @@
1
- import { EARTH, MOON } from "../../core/body.js";
2
- import { discrepancyAt, trackedReadouts } from "../../app/mission.js";
1
+ import { catalogue as builtInCatalogue } from "../assets/catalogue.js";
2
+ import { discrepancyAt, trackedReadouts } from "./mission.js";
3
3
  const centreName = (center) => `${center.charAt(0).toUpperCase()}${center.slice(1)} centre`;
4
4
  /**
5
5
  * Highest speed at the body's NASA source anchors, the honest top of its speed gauge. Anchors rather
@@ -47,62 +47,42 @@ export function spacecraftSpeedMetric(row, peakKmS) {
47
47
  ...(peakKmS === null ? {} : { range: { min: 0, max: peakKmS, basis: "peak at NASA source anchors", digits: 1 } }),
48
48
  };
49
49
  }
50
- /** The Moon's state when it shares the spacecraft's centre and frame, otherwise null. */
51
- function moonInSameFrame(row, moon) {
52
- return moon !== null && moon.center === row.center && moon.frame === row.frame ? moon : null;
50
+ /** The target's state when it shares the path's centre and frame, otherwise null. */
51
+ export function inSameFrame(row, state) {
52
+ return state !== null && state.center === row.center && state.frame === row.frame ? state : null;
53
53
  }
54
- const separationKm = (a, b) => Math.hypot(a[0] - b[0], a[1] - b[1], a[2] - b[2]);
55
- /** Centre-to-centre distance from the spacecraft to the Moon, drawn in Moon radii. */
56
- export function spacecraftMoonMetric(row, moon) {
57
- const same = moonInSameFrame(row, moon);
54
+ export const separationKm = (a, b) => Math.hypot(a[0] - b[0], a[1] - b[1], a[2] - b[2]);
55
+ /** Centre-to-centre distance from the path to a body, drawn in that body's radii. */
56
+ export function pathDistanceMetric(row, target, state) {
57
+ const same = inSameFrame(row, state);
58
58
  return {
59
59
  kind: "relative-distance",
60
- id: `${row.id}-to-moon`,
61
- label: "Distance to Moon",
60
+ id: `${row.id}-to-${target.id}`,
61
+ label: `Distance to ${target.label}`,
62
62
  value: same === null ? null : separationKm(row.positionKm, same.positionKm),
63
63
  unit: "km",
64
64
  digits: 0,
65
65
  from: row.label,
66
- to: "Moon",
67
- targetRadius: MOON.radiusKm,
66
+ to: target.label,
67
+ targetRadius: target.radiusKm,
68
68
  context: `centre to centre · ${row.frame}`,
69
- unavailable: "no Moon state in this frame",
69
+ unavailable: `no ${target.label} state in this frame`,
70
70
  };
71
71
  }
72
- /**
73
- * Height above the mean radius of whichever of Earth and the Moon is closer to the surface.
74
- * Mean radius, not terrain: on the lunar surface the value can be negative.
75
- */
76
- export function spacecraftAltitudeMetric(row, moon) {
77
- const aboveEarth = row.rangeFromEarthKm - EARTH.radiusKm;
78
- const same = moonInSameFrame(row, moon);
79
- const aboveMoon = same === null ? Infinity : separationKm(row.positionKm, same.positionKm) - MOON.radiusKm;
80
- const nearMoon = aboveMoon < aboveEarth;
72
+ /** Height above a body's mean radius (not terrain: on the surface the value can be negative); null when the body has no state in the path's frame. */
73
+ export function pathAltitudeMetric(row, target, state) {
74
+ const same = inSameFrame(row, state);
75
+ const away = same === null ? null : separationKm(row.positionKm, same.positionKm);
81
76
  return {
82
77
  kind: "altitude",
83
- id: `${row.id}-altitude`,
84
- label: "Altitude",
85
- value: nearMoon ? aboveMoon : aboveEarth,
78
+ id: `${row.id}-altitude-${target.id}`,
79
+ label: `Altitude above ${target.label}`,
80
+ value: away === null ? null : away - target.radiusKm,
86
81
  unit: "km",
87
82
  digits: 1,
88
- body: nearMoon ? "Moon" : "Earth",
83
+ body: target.label,
89
84
  datum: "mean radius",
90
- bodyRadius: nearMoon ? MOON.radiusKm : EARTH.radiusKm,
91
- };
92
- }
93
- export function spacecraftPositionMetric(row, moon) {
94
- const same = moonInSameFrame(row, moon);
95
- return {
96
- kind: "coordinates",
97
- id: `${row.id}-position`,
98
- label: "Position",
99
- system: "xyz",
100
- components: ["x", "y", "z"].map((label, index) => ({ label, value: row.positionKm[index], unit: "km", digits: 0 })),
101
- frame: row.frame,
102
- origin: centreName(row.center),
103
- planViews: {
104
- references: same === null ? [] : [{ label: "Moon", xyz: [same.positionKm[0], same.positionKm[1], same.positionKm[2]] }],
105
- },
85
+ bodyRadius: target.radiusKm,
106
86
  };
107
87
  }
108
88
  /** The data's own discrepancy for the segment at this time, compared with the vehicle's largest. */
@@ -121,22 +101,26 @@ export function spacecraftDiscrepancyMetric(body, timeUtcMs) {
121
101
  ...(published.length === 0 ? {} : { scale: { max: Math.max(...published), basis: "this vehicle's reconstruction" } }),
122
102
  };
123
103
  }
104
+ const targetOf = (id, source) => ({ id, label: source.get(id).definition.label, radiusKm: source.get(id).definition.radiusKm });
124
105
  /**
125
- * The info panel's range, speed and Moon-distance rows for one tracked body, from State only: scale policy and camera never
126
- * enter. A tracked body outside its bounds and any other id have none. The catalogued bodies' own rows are `bodyMetrics`'.
106
+ * The info card's bars for paths that ask for readouts, from State only. Range is from the path's centre body; a named body is read from the
107
+ * resolver about that centre, so it shares the path's frame. A path outside its bounds and any other id have none.
127
108
  */
128
- export function createTrackedMetrics({ bodies, moon }) {
129
- const peaks = new Map(bodies.map((body) => [body.id, peakAnchorSpeedKmS(body)]));
109
+ export function createReadoutMetrics(paths, resolver, source = builtInCatalogue) {
110
+ const peaks = new Map(paths.map(({ body }) => [body.id, peakAnchorSpeedKmS(body)]));
130
111
  return (objectId, timeUtcMs) => {
131
- const body = bodies.find((candidate) => candidate.id === objectId);
132
- const row = body === undefined ? undefined : trackedReadouts([body], timeUtcMs)[0];
133
- if (row === undefined)
112
+ const path = paths.find(({ body }) => body.id === objectId);
113
+ const row = path === undefined ? undefined : trackedReadouts([path.body], timeUtcMs)[0];
114
+ if (path === undefined || row === undefined)
134
115
  return [];
135
- const moonState = moon.stateAt(timeUtcMs);
136
- return [
137
- spacecraftRangeMetric(row, referenceInSameFrame("Moon now", row, moonState)),
138
- spacecraftSpeedMetric(row, peaks.get(row.id) ?? null),
139
- spacecraftMoonMetric(row, moonState),
140
- ];
116
+ const stateOf = (id) => (id === row.center ? { body: id, center: row.center, timeUtcMs, frame: row.frame, positionKm: new Float64Array(3) } : resolver.stateOf(id, timeUtcMs, row.center));
117
+ return path.readouts.map((spec) => {
118
+ switch (spec.kind) {
119
+ case "range": return spacecraftRangeMetric(row, spec.marker === undefined ? null : referenceInSameFrame(`${targetOf(spec.marker, source).label} now`, row, stateOf(spec.marker)));
120
+ case "speed": return spacecraftSpeedMetric(row, peaks.get(row.id) ?? null);
121
+ case "distance": return pathDistanceMetric(row, targetOf(spec.to, source), stateOf(spec.to));
122
+ case "altitude": return pathAltitudeMetric(row, targetOf(spec.above, source), stateOf(spec.above));
123
+ }
124
+ });
141
125
  };
142
126
  }
@@ -19,6 +19,7 @@ export interface LocalOnlyDeclaration {
19
19
  readonly reason: string;
20
20
  readonly publicReplacement: PublicReplacement;
21
21
  }
22
+ /** A picture the engine can wrap on a body: where it is, its size, and the rights to show it publicly. */
22
23
  export interface TextureRef {
23
24
  /** Bundler asset URL. */
24
25
  readonly url: string;
@@ -1,7 +1,7 @@
1
1
  import type { TextureRef } from "./licence.js";
2
2
  import type { BodyVisual } from "./visual.js";
3
3
  /**
4
- * Pictures that ship in a data package (`astraeus-data`) rather than in the engine, by name: a body id (`titan`), `venus-8k`, `milky-way-left`.
4
+ * Pictures that ship in a data package (`astraeus-data`) rather than in the engine, by name: a body id (`titan`), `venus-8k`, `milky-way`.
5
5
  * Each carries its own licence record, so the credit travels with the file (PROV-02). A picture that was never registered is simply absent:
6
6
  * the body is drawn as a flat colour, the sky without its Milky Way (DATA-01: nothing is invented to fill the gap).
7
7
  */
@@ -71,12 +71,12 @@ export declare function starAppearance(vMag: number): {
71
71
  readonly brightness: number;
72
72
  };
73
73
  /**
74
- * The picture in two square halves, left (longitude 180 to 0, running to the centre) then right; each is under every GPU's texture limit.
75
- * The files ship in astraeus-data (names "milky-way-left", "milky-way-right"); without that package the list is empty and no picture is drawn.
74
+ * The picture, one 3840x1920 image (under every GPU's texture limit). The file ships in astraeus-data (name "milky-way");
75
+ * without that package the list is empty and no picture is drawn.
76
76
  */
77
77
  export declare const milkyWayTiles: () => readonly TextureRef[];
78
- /** The ESO panorama as a two-tile galactic picture: the one Milky Way picture. */
79
- export declare const ESO_PICTURE: PictureSet;
78
+ /** The Gaia EDR3 render (stars removed) as a one-tile galactic picture: the one Milky Way picture. */
79
+ export declare const MILKY_WAY_PICTURE: PictureSet;
80
80
  export declare const SKY_SOURCES: readonly string[];
81
81
  /** What an experience may say about the sky: all fields optional, default on at full brightness, with the Milky Way picture off. */
82
82
  export interface SkySettings {
package/src/assets/sky.js CHANGED
@@ -116,24 +116,23 @@ export function starAppearance(vMag) {
116
116
  }
117
117
  // ---------------------------------------------------------------- sources and the shell item
118
118
  /**
119
- * The picture in two square halves, left (longitude 180 to 0, running to the centre) then right; each is under every GPU's texture limit.
120
- * The files ship in astraeus-data (names "milky-way-left", "milky-way-right"); without that package the list is empty and no picture is drawn.
119
+ * The picture, one 3840x1920 image (under every GPU's texture limit). The file ships in astraeus-data (name "milky-way");
120
+ * without that package the list is empty and no picture is drawn.
121
121
  */
122
- export const milkyWayTiles = () => ["milky-way-left", "milky-way-right"].flatMap((name) => pictureOf(name) ?? []);
123
- /** The ESO panorama as a two-tile galactic picture: the one Milky Way picture. */
124
- export const ESO_PICTURE = Object.freeze({
125
- name: "ESO Milky Way panorama (eso0932a)",
126
- columns: 2,
122
+ export const milkyWayTiles = () => ["milky-way"].flatMap((name) => pictureOf(name) ?? []);
123
+ /** The Gaia EDR3 render (stars removed) as a one-tile galactic picture: the one Milky Way picture. */
124
+ export const MILKY_WAY_PICTURE = Object.freeze({
125
+ name: "Milky Way, Gaia EDR3 render without foreground stars (Kevinmloch)",
126
+ columns: 1,
127
127
  rows: 1,
128
128
  get tiles() {
129
- const halves = milkyWayTiles();
130
- return halves.length < 2 ? [] : halves.map((tile, column) => Object.freeze({ column, row: 0, url: tile.url, widthPx: tile.widthPx, heightPx: tile.heightPx }));
129
+ return milkyWayTiles().map((tile) => Object.freeze({ column: 0, row: 0, url: tile.url, widthPx: tile.widthPx, heightPx: tile.heightPx }));
131
130
  },
132
- credit: "ESO/S. Brunier",
133
- licence: "CC BY 4.0",
134
- source: "https://www.eso.org/public/images/eso0932a/",
131
+ credit: "Kevinmloch (bsrender), Gaia EDR3, ESA/Gaia/DPAC",
132
+ licence: "CC BY-SA 4.0",
133
+ source: "https://commons.wikimedia.org/wiki/File:Milky_Way_360_equirectangular_rendering_with_foreground_stars_removed.png",
135
134
  });
136
135
  export const SKY_SOURCES = Object.freeze([
137
136
  "HYG star database v4.2 (Hipparcos, Yale Bright Star, Gliese catalogues), astronexus (https://www.astronexus.com/projects/hyg), CC BY-SA 4.0. The star file only; the code is MIT.",
138
- "The Milky Way panorama, ESO/S. Brunier (https://www.eso.org/public/images/eso0932a/), CC BY 4.0.",
137
+ "The Milky Way picture: Milky Way render by Kevinmloch (bsrender) from Gaia EDR3, ESA/Gaia/DPAC (https://commons.wikimedia.org/wiki/File:Milky_Way_360_equirectangular_rendering_with_foreground_stars_removed.png), CC BY-SA 4.0. Resized.",
139
138
  ]);
@@ -1,4 +1,5 @@
1
1
  import type { CelestialBodyDefinition, StateSourceBinding } from "../body.js";
2
+ import type { EccentricSampling } from "../sunCentredSources.js";
2
3
  export { EARTH, EARTH_EPHEMERIS } from "./earth.js";
3
4
  export { MOON, MOON_EPHEMERIS } from "./moon.js";
4
5
  export { SUN } from "./sun.js";
@@ -14,3 +15,5 @@ export { VENUS, VENUS_EPHEMERIS, VENUS_ROTATION } from "./venus.js";
14
15
  export declare const BUILT_IN_BODIES: readonly CelestialBodyDefinition[];
15
16
  /** One state source per non-root body; the Sun is the root and has none. */
16
17
  export declare const BUILT_IN_BINDINGS: readonly StateSourceBinding[];
18
+ /** Built-in bodies whose period and periapsis the catalogue knows (a comet's century-long orbit), so their whole orbit can be drawn from periapsis. */
19
+ export declare const BUILT_IN_SAMPLING: Readonly<Record<string, EccentricSampling>>;
@@ -11,7 +11,7 @@ import { MERCURY, MERCURY_ROTATION } from "./mercury.js";
11
11
  import { NEPTUNE, NEPTUNE_ROTATION, PLUTO, SATURN, SATURN_ROTATION, URANUS, URANUS_ROTATION } from "./outerPlanets.js";
12
12
  import { PLANET_MOON_BINDINGS, PLANET_MOON_DEFINITIONS, PLUTO_BINDING } from "./planetMoons.js";
13
13
  import { SUN } from "./sun.js";
14
- import { SWIFT_TUTTLE, SWIFT_TUTTLE_BINDING } from "./swiftTuttle.js";
14
+ import { SWIFT_TUTTLE, SWIFT_TUTTLE_BINDING, SWIFT_TUTTLE_SAMPLING } from "./swiftTuttle.js";
15
15
  import { VENUS, VENUS_ROTATION } from "./venus.js";
16
16
  export { EARTH, EARTH_EPHEMERIS } from "./earth.js";
17
17
  export { MOON, MOON_EPHEMERIS } from "./moon.js";
@@ -43,3 +43,5 @@ export const BUILT_IN_BINDINGS = Object.freeze([
43
43
  ...PLANET_MOON_BINDINGS,
44
44
  SWIFT_TUTTLE_BINDING,
45
45
  ]);
46
+ /** Built-in bodies whose period and periapsis the catalogue knows (a comet's century-long orbit), so their whole orbit can be drawn from periapsis. */
47
+ export const BUILT_IN_SAMPLING = Object.freeze({ [SWIFT_TUTTLE.id]: SWIFT_TUTTLE_SAMPLING });
@@ -6,7 +6,7 @@ import { createOrbTwoBodyAdapter } from "../twoBodyAdapter.js";
6
6
  import { JUPITER } from "./jupiter.js";
7
7
  import { trueAnomalyFromMean } from "../keplerAnomaly.js";
8
8
  import { fittedMoonPosition, IO_FITTED_BINDING, JUPITER_MOON_FIT_SPAN } from "./jupiterMoons.js";
9
- import ioRecord from "../../../data/orbits/io.json";
9
+ import ioRecord from "../../../data/orbits/io.json" with { type: "json" };
10
10
  export { trueAnomalyFromMean };
11
11
  const DEGREES = Math.PI / 180;
12
12
  const ORIENTATION_SAMPLE_SECONDS = 1800;
@@ -3,7 +3,7 @@
3
3
  * T-097) and the ring bands (data/rings/jupiter.json). Raw JSON: src/assets parses and checks them (layer rule: assets reach data
4
4
  * through core).
5
5
  */
6
- import moonCatalogueFile from "../../../data/moons/jupiter.json";
7
- import ringFile from "../../../data/rings/jupiter.json";
6
+ import moonCatalogueFile from "../../../data/moons/jupiter.json" with { type: "json" };
7
+ import ringFile from "../../../data/rings/jupiter.json" with { type: "json" };
8
8
  export const JUPITER_MOON_CATALOGUE_FILE = moonCatalogueFile;
9
9
  export const JUPITER_RING_FILE = ringFile;
@@ -1,14 +1,10 @@
1
1
  import { iauElementsFromRecord } from "../iauRotation.js";
2
2
  import { JUPITER } from "./jupiter.js";
3
3
  import { chunksNeeded, createMoonSystem, MOON_FIT_SPAN, moonFitSource } from "./moonSystem.js";
4
- import json1 from "../../../data/orbits/callisto.json";
5
- const { rotation: callistoRotation } = json1;
6
- import json2 from "../../../data/orbits/europa.json";
7
- const { rotation: europaRotation } = json2;
8
- import json3 from "../../../data/orbits/ganymede.json";
9
- const { rotation: ganymedeRotation } = json3;
10
- import json4 from "../../../data/orbits/io.json";
11
- const { rotation: ioRotation } = json4;
4
+ import callistoOrbit from "../../../data/orbits/callisto.json" with { type: "json" };
5
+ import europaOrbit from "../../../data/orbits/europa.json" with { type: "json" };
6
+ import ganymedeOrbit from "../../../data/orbits/ganymede.json" with { type: "json" };
7
+ import ioOrbit from "../../../data/orbits/io.json" with { type: "json" };
12
8
  /** The span the committed fits cover (T-096: 2010-01-01 to 2030-01-01 TDB, chunked per calendar year). */
13
9
  export const JUPITER_MOON_FIT_SPAN = MOON_FIT_SPAN;
14
10
  export const JUPITER_MOON_FIT_SOURCE = moonFitSource("Jupiter");
@@ -30,7 +26,7 @@ export const FITTED_MOON_TIDAL_LOCK = JUPITER_MOON_SYSTEM.tidalLockNote;
30
26
  /** What every mapped Jupiter moon's record says about its position, with its own worst figure from T-096. */
31
27
  export const fittedMoonPosition = JUPITER_MOON_SYSTEM.position;
32
28
  /** The Galilean moons turn synchronously: their prime meridians are the IAU records saved with their orbits (`data/orbits/`), the one source. */
33
- export const IO_ROTATION = iauElementsFromRecord(ioRotation);
29
+ export const IO_ROTATION = iauElementsFromRecord(ioOrbit.rotation);
34
30
  const jupiterMoon = (id, label, radiusKm, gmKm3S2, worstM, header) => JUPITER_MOON_SYSTEM.mappedMoon({ id, label, radiusKm, gmKm3S2, worstM, header });
35
31
  export const EUROPA = jupiterMoon("europa", "Europa", 1560.8, 3202.7121, 0.0755, "Mean radius (km) = 1560.8 +- 0.3, GM (km^3/s^2) = 3202.7121 +- 0.0054");
36
32
  export const GANYMEDE = jupiterMoon("ganymede", "Ganymede", 2631.2, 9887.8328, 0.0662, "Mean radius (km) = 2631.2 +- 1.7, GM (km^3/s^2) = 9887.8328 +- 0.0074");
@@ -38,7 +34,7 @@ export const CALLISTO = jupiterMoon("callisto", "Callisto", 2410.3, 7179.2834, 0
38
34
  /** Io's binding is in `io.ts` with its definition; the three below are the same pattern. */
39
35
  export const IO_FITTED_BINDING = JUPITER_MOON_SYSTEM.binding("io", IO_ROTATION);
40
36
  export const MAPPED_MOON_BINDINGS = Object.freeze([
41
- JUPITER_MOON_SYSTEM.binding(EUROPA.id, iauElementsFromRecord(europaRotation)),
42
- JUPITER_MOON_SYSTEM.binding(GANYMEDE.id, iauElementsFromRecord(ganymedeRotation)),
43
- JUPITER_MOON_SYSTEM.binding(CALLISTO.id, iauElementsFromRecord(callistoRotation)),
37
+ JUPITER_MOON_SYSTEM.binding(EUROPA.id, iauElementsFromRecord(europaOrbit.rotation)),
38
+ JUPITER_MOON_SYSTEM.binding(GANYMEDE.id, iauElementsFromRecord(ganymedeOrbit.rotation)),
39
+ JUPITER_MOON_SYSTEM.binding(CALLISTO.id, iauElementsFromRecord(callistoOrbit.rotation)),
44
40
  ]);
@@ -1,3 +1,11 @@
1
1
  import type { CelestialBodyDefinition, EphemerisRecord } from "../body.js";
2
+ import type { IauRotationElements } from "../iauRotation.js";
3
+ /** Source of the Moon's rotation constants (PROV-01). The 2015 report gives none for the Moon, so these are the 2009 report's, as NAIF saved them. */
4
+ export declare const MOON_IAU_REPORT = "Archinal et al., Report of the IAU Working Group on Cartographic Coordinates and Rotational Elements: 2009, Celestial Mechanics and Dynamical Astronomy 109, 101 (2011), as transcribed in NAIF pck00011.tpc (2022-12-27), BODY301 and BODY3_NUT_PREC_ANGLES";
5
+ /**
6
+ * The Moon's pole and prime meridian, including the report's libration terms E1 to E13 (the pole and W terms the report lists): degrees, pole per Julian
7
+ * century, W per day, from J2000 TDB. The report's -1.4e-12 d^2 term in W is left out (0.0005 degrees at 50 years from J2000). Body +X is longitude 0, +Z the pole.
8
+ */
9
+ export declare const MOON_ROTATION: IauRotationElements;
2
10
  export declare const MOON_EPHEMERIS: EphemerisRecord;
3
11
  export declare const MOON: CelestialBodyDefinition;
@@ -1,6 +1,29 @@
1
1
  import { createProvenance } from "../provenance.js";
2
- const TIDAL_LOCK_LIMITATION = "The Moon's orientation is an approximate tidal lock that keeps its near side towards Earth, with no libration, so surface features can sit several degrees from their true place.";
3
- const LANDING_SITE_OFFSET = "Because there is no libration, an IAU-placed landing site (measured at the Sea of Tranquility in Spike 02) sits 254 km (8.4°) from the same selenographic coordinates on this Moon at touchdown (docs/ASTRAEUS_SPIKE_02.md).";
2
+ /** Source of the Moon's rotation constants (PROV-01). The 2015 report gives none for the Moon, so these are the 2009 report's, as NAIF saved them. */
3
+ export const MOON_IAU_REPORT = "Archinal et al., Report of the IAU Working Group on Cartographic Coordinates and Rotational Elements: 2009, Celestial Mechanics and Dynamical Astronomy 109, 101 (2011), as transcribed in NAIF pck00011.tpc (2022-12-27), BODY301 and BODY3_NUT_PREC_ANGLES";
4
+ /**
5
+ * The Moon's pole and prime meridian, including the report's libration terms E1 to E13 (the pole and W terms the report lists): degrees, pole per Julian
6
+ * century, W per day, from J2000 TDB. The report's -1.4e-12 d^2 term in W is left out (0.0005 degrees at 50 years from J2000). Body +X is longitude 0, +Z the pole.
7
+ */
8
+ export const MOON_ROTATION = Object.freeze({
9
+ poleRaDeg: [269.9949, 0.0031],
10
+ poleDecDeg: [66.5392, 0.013],
11
+ primeMeridianDeg: [38.3213, 13.17635815],
12
+ periodic: Object.freeze({
13
+ anglesDeg: [
14
+ [125.045, -1935.5364525], [250.089, -3871.072905], [260.008, 475263.3328725], [176.625, 487269.629985],
15
+ [357.529, 35999.0509575], [311.589, 964468.49931], [134.963, 477198.869325], [276.617, 12006.300765],
16
+ [34.226, 63863.5132425], [15.134, -5806.6093575], [119.743, 131.84064], [239.961, 6003.1503825],
17
+ [25.053, 473327.79642],
18
+ ],
19
+ poleRaDeg: [-3.8787, -0.1204, 0.07, -0.0172, 0, 0.0072, 0, 0, 0, -0.0052, 0, 0, 0.0043],
20
+ poleDecDeg: [1.5419, 0.0239, -0.0278, 0.0068, 0, -0.0029, 0.0009, 0, 0, 0.0008, 0, 0, -0.0009],
21
+ primeMeridianDeg: [3.561, 0.1208, -0.0642, 0.0158, 0.0252, -0.0066, -0.0047, -0.0046, 0.0028, 0.0052, 0.004, 0.0019, -0.0044],
22
+ }),
23
+ citation: MOON_IAU_REPORT,
24
+ });
25
+ const ROTATION_LIMITATION = "The Moon's orientation is the IAU mean-Earth rotation model with its libration terms, so the Moon shows libration in longitude and latitude. It is a published series, not the JPL lunar ephemeris: its sub-Earth point and pole differ from Horizons' by at most 0.01 degrees (about 0.3 km on the surface) at the seven dates from 1969 to 2050 that were checked, and its accuracy elsewhere is not stated by the source.";
26
+ const LANDING_SITE_OFFSET = "A landing site placed by the IAU model (a mission reconstruction's, measured at the Sea of Tranquility) sits 0.01 km (under 0.001 degrees) from the same selenographic coordinates on this Moon at touchdown, because the reconstruction and the drawn Moon use the same IAU model (docs/ASTRAEUS_SPIKE_02.md measured 254 km, 8.4 degrees, under the earlier tidal lock).";
4
27
  export const MOON_EPHEMERIS = {
5
28
  provenance: createProvenance({
6
29
  sourceType: "ephemeris",
@@ -9,7 +32,7 @@ export const MOON_EPHEMERIS = {
9
32
  notes: "Body size is the volumetric mean radius (NASA NSSDC fact sheet).",
10
33
  }),
11
34
  knownLimitations: [
12
- TIDAL_LOCK_LIMITATION,
35
+ ROTATION_LIMITATION,
13
36
  "No velocity is modelled for the Moon, so it has no speed readout.",
14
37
  ],
15
38
  };
@@ -20,7 +43,7 @@ export const MOON = Object.freeze({
20
43
  radiusKm: 1737.4,
21
44
  gmKm3S2: 4902.800066,
22
45
  parentId: "earth",
23
- orientation: "tidal-lock",
46
+ orientation: "iau-rotation",
24
47
  accuracy: Object.freeze({
25
48
  dimensions: createProvenance({
26
49
  sourceType: "observed",
@@ -31,6 +54,6 @@ export const MOON = Object.freeze({
31
54
  position: MOON_EPHEMERIS.provenance,
32
55
  // The sampled Horizons comparison range (tests/fixtures/moon-horizons.json); the truncated series states no validity range of its own.
33
56
  validUtc: Object.freeze({ startUtcMs: Date.UTC(2022, 5, 1), endUtcMs: Date.UTC(2025, 5, 1) }),
34
- orientationLimitations: Object.freeze([TIDAL_LOCK_LIMITATION, LANDING_SITE_OFFSET]),
57
+ orientationLimitations: Object.freeze([ROTATION_LIMITATION, LANDING_SITE_OFFSET]),
35
58
  }),
36
59
  });
@@ -3,13 +3,13 @@
3
3
  * (data/moons/<planet>.json, T-115) and the ring bands (data/rings/<planet>.json). Raw JSON: src/assets parses and checks them (layer rule:
4
4
  * assets reach data through core), as `jupiterData.ts` does for Jupiter.
5
5
  */
6
- import neptuneMoons from "../../../data/moons/neptune.json";
7
- import plutoMoons from "../../../data/moons/pluto.json";
8
- import saturnMoons from "../../../data/moons/saturn.json";
9
- import uranusMoons from "../../../data/moons/uranus.json";
10
- import neptuneRings from "../../../data/rings/neptune.json";
11
- import saturnRings from "../../../data/rings/saturn.json";
12
- import uranusRings from "../../../data/rings/uranus.json";
6
+ import neptuneMoons from "../../../data/moons/neptune.json" with { type: "json" };
7
+ import plutoMoons from "../../../data/moons/pluto.json" with { type: "json" };
8
+ import saturnMoons from "../../../data/moons/saturn.json" with { type: "json" };
9
+ import uranusMoons from "../../../data/moons/uranus.json" with { type: "json" };
10
+ import neptuneRings from "../../../data/rings/neptune.json" with { type: "json" };
11
+ import saturnRings from "../../../data/rings/saturn.json" with { type: "json" };
12
+ import uranusRings from "../../../data/rings/uranus.json" with { type: "json" };
13
13
  export const SATURN_MOON_CATALOGUE_FILE = saturnMoons;
14
14
  export const URANUS_MOON_CATALOGUE_FILE = uranusMoons;
15
15
  export const NEPTUNE_MOON_CATALOGUE_FILE = neptuneMoons;
@@ -3,24 +3,15 @@ import { createPlanetSunTrajectory } from "./planetTrajectory.js";
3
3
  import { MARS } from "./mars.js";
4
4
  import { createMoonSystem, moonFitSource } from "./moonSystem.js";
5
5
  import { NEPTUNE, PLUTO, PLUTO_ROTATION, SATURN, URANUS } from "./outerPlanets.js";
6
- import json5 from "../../../data/orbits/charon.json";
7
- const { rotation: charonRotation } = json5;
8
- import json6 from "../../../data/orbits/dione.json";
9
- const { rotation: dioneRotation } = json6;
10
- import json7 from "../../../data/orbits/enceladus.json";
11
- const { rotation: enceladusRotation } = json7;
12
- import json8 from "../../../data/orbits/iapetus.json";
13
- const { rotation: iapetusRotation } = json8;
14
- import json9 from "../../../data/orbits/mimas.json";
15
- const { rotation: mimasRotation } = json9;
16
- import json10 from "../../../data/orbits/rhea.json";
17
- const { rotation: rheaRotation } = json10;
18
- import json11 from "../../../data/orbits/tethys.json";
19
- const { rotation: tethysRotation } = json11;
20
- import json12 from "../../../data/orbits/titan.json";
21
- const { rotation: titanRotation } = json12;
22
- import json13 from "../../../data/orbits/triton.json";
23
- const { rotation: tritonRotation } = json13;
6
+ import charonOrbit from "../../../data/orbits/charon.json" with { type: "json" };
7
+ import dioneOrbit from "../../../data/orbits/dione.json" with { type: "json" };
8
+ import enceladusOrbit from "../../../data/orbits/enceladus.json" with { type: "json" };
9
+ import iapetusOrbit from "../../../data/orbits/iapetus.json" with { type: "json" };
10
+ import mimasOrbit from "../../../data/orbits/mimas.json" with { type: "json" };
11
+ import rheaOrbit from "../../../data/orbits/rhea.json" with { type: "json" };
12
+ import tethysOrbit from "../../../data/orbits/tethys.json" with { type: "json" };
13
+ import titanOrbit from "../../../data/orbits/titan.json" with { type: "json" };
14
+ import tritonOrbit from "../../../data/orbits/triton.json" with { type: "json" };
24
15
  export const MARS_MOON_SYSTEM = createMoonSystem({
25
16
  centre: "mars", centreLabel: "Mars", centreGmKm3S2: MARS.gmKm3S2, ephemerisName: "mar099", fitSource: moonFitSource("Mars")
26
17
  });
@@ -58,15 +49,15 @@ export const PLANET_MOON_DEFINITIONS = Object.freeze([PHOBOS, DEIMOS, MIMAS, ENC
58
49
  export const PLANET_MOON_BINDINGS = Object.freeze([
59
50
  MARS_MOON_SYSTEM.binding(PHOBOS.id),
60
51
  MARS_MOON_SYSTEM.binding(DEIMOS.id),
61
- SATURN_MOON_SYSTEM.binding(MIMAS.id, iauElementsFromRecord(mimasRotation)),
62
- SATURN_MOON_SYSTEM.binding(ENCELADUS.id, iauElementsFromRecord(enceladusRotation)),
63
- SATURN_MOON_SYSTEM.binding(TETHYS.id, iauElementsFromRecord(tethysRotation)),
64
- SATURN_MOON_SYSTEM.binding(DIONE.id, iauElementsFromRecord(dioneRotation)),
65
- SATURN_MOON_SYSTEM.binding(RHEA.id, iauElementsFromRecord(rheaRotation)),
66
- SATURN_MOON_SYSTEM.binding(TITAN.id, iauElementsFromRecord(titanRotation)),
67
- SATURN_MOON_SYSTEM.binding(IAPETUS.id, iauElementsFromRecord(iapetusRotation)),
68
- NEPTUNE_MOON_SYSTEM.binding(TRITON.id, iauElementsFromRecord(tritonRotation)),
69
- PLUTO_MOON_SYSTEM.binding(CHARON.id, iauElementsFromRecord(charonRotation)),
52
+ SATURN_MOON_SYSTEM.binding(MIMAS.id, iauElementsFromRecord(mimasOrbit.rotation)),
53
+ SATURN_MOON_SYSTEM.binding(ENCELADUS.id, iauElementsFromRecord(enceladusOrbit.rotation)),
54
+ SATURN_MOON_SYSTEM.binding(TETHYS.id, iauElementsFromRecord(tethysOrbit.rotation)),
55
+ SATURN_MOON_SYSTEM.binding(DIONE.id, iauElementsFromRecord(dioneOrbit.rotation)),
56
+ SATURN_MOON_SYSTEM.binding(RHEA.id, iauElementsFromRecord(rheaOrbit.rotation)),
57
+ SATURN_MOON_SYSTEM.binding(TITAN.id, iauElementsFromRecord(titanOrbit.rotation)),
58
+ SATURN_MOON_SYSTEM.binding(IAPETUS.id, iauElementsFromRecord(iapetusOrbit.rotation)),
59
+ NEPTUNE_MOON_SYSTEM.binding(TRITON.id, iauElementsFromRecord(tritonOrbit.rotation)),
60
+ PLUTO_MOON_SYSTEM.binding(CHARON.id, iauElementsFromRecord(charonOrbit.rotation)),
70
61
  ]);
71
62
  /**
72
63
  * Pluto's own offset from the system barycentre at `timeUtcMs`, from its system's centre series, or null while the system is not loaded or the
@@ -96,6 +96,8 @@ export const SWIFT_TUTTLE = Object.freeze({
96
96
  sources: [SWIFT_TUTTLE_ELEMENTS.citation, "Two-body motion about the Sun's gravitational parameter (catalogue)", "Compared with JPL Horizons, target DES=109P;CAP (solution JPL#32), centre 500@10, ICRF"],
97
97
  accuracy: `Position was compared with JPL Horizons at eight dates from 1990 to 2030: the largest Sun-centred difference is about ${SWIFT_TUTTLE_MAX_ERROR_KM.toLocaleString("en-US")} km (${(SWIFT_TUTTLE_MAX_ERROR_FRACTION * 100).toFixed(2)}% of its distance from the Sun at that date), so this is an approximate position for drawing the orbit and the comet's place on it, not an ephemeris. This is the largest difference at the eight dates compared, not a bound for every date.`,
98
98
  notes: "Geometric position about the Sun's centre; no light-time. Elements are osculating at the epoch.",
99
+ accuracyClass: "approximate",
100
+ maxErrorFraction: SWIFT_TUTTLE_MAX_ERROR_FRACTION,
99
101
  }),
100
102
  validUtc: COMPARED_UTC,
101
103
  orientationLimitations: SWIFT_TUTTLE_LIMITATIONS,
@@ -9,10 +9,12 @@ export declare const DEFAULT_ELEMENTS_MARKER_SIZE_PX = 7;
9
9
  * within the larger one, "indicative". Both are good enough to draw where the body is on its orbit at overview scale and neither is an ephemeris.
10
10
  */
11
11
  export declare const APPROXIMATE_LIMIT_FRACTION = 0.01;
12
+ /** The larger limit of the same rule: within 5% of the body's distance from the Sun at every compared date is "indicative". */
12
13
  export declare const INDICATIVE_LIMIT_FRACTION = 0.05;
13
14
  /** The classification a largest error fraction earns, or null when it earns neither (the body should not be drawn from its elements alone). */
14
15
  export declare function classifyPositionError(maxFraction: number): AccuracyClassification | null;
15
16
  export type ElementsTimeScale = "TDB" | "TT" | "UTC";
17
+ /** The class a position comparison earns: `"approximate"` or `"indicative"` (see `classifyPositionError`). */
16
18
  export type AccuracyClassification = "approximate" | "indicative";
17
19
  /** A cited fact: the solution it came from, where it was read, and when. */
18
20
  export interface ElementsSource {
@@ -15,6 +15,7 @@ export const DEFAULT_ELEMENTS_MARKER_SIZE_PX = 7;
15
15
  * within the larger one, "indicative". Both are good enough to draw where the body is on its orbit at overview scale and neither is an ephemeris.
16
16
  */
17
17
  export const APPROXIMATE_LIMIT_FRACTION = 0.01;
18
+ /** The larger limit of the same rule: within 5% of the body's distance from the Sun at every compared date is "indicative". */
18
19
  export const INDICATIVE_LIMIT_FRACTION = 0.05;
19
20
  /** The classification a largest error fraction earns, or null when it earns neither (the body should not be drawn from its elements alone). */
20
21
  export function classifyPositionError(maxFraction) {
@@ -183,6 +184,8 @@ export function buildElementsBody(input, centre) {
183
184
  sources: [citation, `Two-body motion about the gravitational parameter of "${centre.id}" (catalogue)`],
184
185
  accuracy: `${body.accuracy.classification}: ${body.accuracy.statement}`,
185
186
  notes: "Geometric position about the Sun's centre; no light-time. Elements are osculating at the epoch.",
187
+ accuracyClass: body.accuracy.classification,
188
+ maxErrorFraction: body.accuracy.classification === "approximate" ? APPROXIMATE_LIMIT_FRACTION : INDICATIVE_LIMIT_FRACTION,
186
189
  }),
187
190
  validUtc: Object.freeze({ startUtcMs: Date.parse(body.accuracy.validFromUtc), endUtcMs: Date.parse(body.accuracy.validToUtc) }),
188
191
  orientationLimitations: Object.freeze([
@@ -1,6 +1,6 @@
1
- import { moonOrientationFromOrbit } from "./bodyOrientation.js";
1
+ import { MOON_ROTATION } from "./bodies/moon.js";
2
+ import { iauOrientation } from "./iauRotation.js";
2
3
  import { assertUtcUnixMs, createState, EQJ } from "./state.js";
3
- const ORIENTATION_SAMPLE_SECONDS = 1800;
4
4
  /** The Moon in its one native centre, Earth. Any other centre is the state resolver's composition, not this provider's. */
5
5
  export class MoonTrajectory {
6
6
  adapter;
@@ -13,9 +13,7 @@ export class MoonTrajectory {
13
13
  if (center !== "earth")
14
14
  throw new RangeError("Moon trajectory center must be Earth; the state resolver recentres it");
15
15
  const moonFromEarthKm = this.adapter.moonPositionKm(timeUtcMs);
16
- const earlier = this.adapter.moonPositionKm(timeUtcMs - ORIENTATION_SAMPLE_SECONDS * 1000);
17
- const later = this.adapter.moonPositionKm(timeUtcMs + ORIENTATION_SAMPLE_SECONDS * 1000);
18
- const orientation = moonOrientationFromOrbit(moonFromEarthKm, earlier, later);
16
+ const orientation = iauOrientation(MOON_ROTATION, this.adapter.daysSinceJ2000Tt(timeUtcMs));
19
17
  return createState({
20
18
  body: "moon",
21
19
  center: "earth",
@@ -1,4 +1,4 @@
1
- import fits from "../../data/ephemerides/planets/planets.json";
1
+ import fits from "../../data/ephemerides/planets/planets.json" with { type: "json" };
2
2
  import { chunkCovers, chunkPositionInto, decodeChunk } from "./chebyshevSeries.js";
3
3
  import { PLANET_IDS } from "./planetSeries.js";
4
4
  import { assertTimeScaleTable, ttMinusUtcSeconds } from "./timeScale.js";
@@ -22,5 +22,7 @@ export type PlanetModels = {
22
22
  * downloads them (I-022).
23
23
  */
24
24
  export declare function loadPlanetSeries(): Promise<void>;
25
+ /** Whether the planet series have finished loading. */
26
+ export declare function planetSeriesLoaded(): boolean;
25
27
  /** The loaded planet models; throws before `loadPlanetSeries()` resolved rather than falling back to the compact tables. */
26
28
  export declare function planetModels(): PlanetModels;
@@ -14,6 +14,10 @@ export function loadPlanetSeries() {
14
14
  loading ??= import("./planetModels.js").then((module) => { models = module.createPlanetModels(); });
15
15
  return loading;
16
16
  }
17
+ /** Whether the planet series have finished loading. */
18
+ export function planetSeriesLoaded() {
19
+ return models !== undefined;
20
+ }
17
21
  /** The loaded planet models; throws before `loadPlanetSeries()` resolved rather than falling back to the compact tables. */
18
22
  export function planetModels() {
19
23
  if (models === undefined)
@@ -1,9 +1,14 @@
1
- export type ProvenanceSourceType = "ephemeris" | "observed" | "reconstructed" | "illustrative";
2
- /** Where a Trajectory's samples came from and how far to trust them. Never affects State. */
1
+ /** What kind of source a path or body position comes from. `"modelled"` is a computed result of a stated model (shown as "Modelled", the same word as the story-panel badge). */
2
+ export type ProvenanceSourceType = "ephemeris" | "observed" | "reconstructed" | "modelled" | "illustrative";
3
+ /** Where a path or body position came from and how far to trust it: `sourceType`, the `sources`, the `accuracy` and `notes`. Pass one as `addTrajectory({ provenance })`. Never affects State. */
3
4
  export interface Provenance {
4
5
  readonly sourceType: ProvenanceSourceType;
5
6
  readonly sources: readonly string[];
6
7
  readonly accuracy: string;
7
8
  readonly notes: string;
9
+ /** For a position compared with an independent ephemeris: the class the comparison earned (`"approximate"` within 1% of the body's distance from the Sun, `"indicative"` within 5%). Absent for a body that has no such comparison. */
10
+ readonly accuracyClass?: "approximate" | "indicative";
11
+ /** The largest difference found, or the limit of the class, as a fraction of the body's distance from the Sun at the compared date (0.00857 is 0.857%). Absent with `accuracyClass`. */
12
+ readonly maxErrorFraction?: number;
8
13
  }
9
14
  export declare function createProvenance(input: Provenance): Provenance;
@@ -1,4 +1,4 @@
1
- const SOURCE_TYPES = ["ephemeris", "observed", "reconstructed", "illustrative"];
1
+ const SOURCE_TYPES = ["ephemeris", "observed", "reconstructed", "modelled", "illustrative"];
2
2
  export function createProvenance(input) {
3
3
  if (!SOURCE_TYPES.includes(input.sourceType))
4
4
  throw new RangeError("provenance sourceType is not recognised");
@@ -10,5 +10,7 @@ export function createProvenance(input) {
10
10
  sources: Object.freeze([...input.sources]),
11
11
  accuracy: input.accuracy,
12
12
  notes: input.notes,
13
+ ...(input.accuracyClass === undefined ? {} : { accuracyClass: input.accuracyClass }),
14
+ ...(input.maxErrorFraction === undefined ? {} : { maxErrorFraction: input.maxErrorFraction }),
13
15
  });
14
16
  }
@@ -1,4 +1,5 @@
1
1
  import { type BodyId } from "./body.js";
2
+ /** How kilometres become scene units: a position mapping and a radius mapping. `trueScale` and `readableScale` are the two the engine offers. */
2
3
  export interface ScalePolicy {
3
4
  /** Open: an application may supply policies beyond the engine's own three. */
4
5
  readonly id: string;
@@ -26,7 +27,9 @@ export declare class ReadableScalePolicy extends EarthRadiusScale {
26
27
  readonly id: "readable-scale";
27
28
  protected readonly distanceFactor = 0.1;
28
29
  }
30
+ /** Real proportions: distances and body sizes at the same scale, so planets are specks, as in space. */
29
31
  export declare const trueScale: ScalePolicy;
32
+ /** Distances shrunk to a tenth while body sizes are kept, so bodies are easier to see and pick. */
30
33
  export declare const readableScale: ScalePolicy;
31
34
  /** Per-body enlargement of drawn radii; distances stay exactly as True scale maps them. */
32
35
  export interface SolarSystemScaleOptions {