astraeus 0.7.0 → 0.8.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 +176 -0
- package/README.md +185 -37
- package/package.json +5 -4
- package/src/api/AstraeusScene.d.ts +21 -5
- package/src/api/AstraeusScene.js +34 -10
- package/src/api/AstraeusScene.node.js +34 -10
- package/src/api/assembleScene.d.ts +36 -0
- package/src/api/assembleScene.js +175 -0
- package/src/api/bodySetChecks.d.ts +10 -0
- package/src/api/bodySetChecks.js +117 -0
- package/src/api/bodySetInput.d.ts +81 -0
- package/src/api/bodySetInput.js +1 -0
- package/src/api/containingBlock.d.ts +6 -0
- package/src/api/containingBlock.js +16 -0
- package/src/api/data.d.ts +17 -5
- package/src/api/data.js +28 -10
- package/src/api/definitionOf.d.ts +16 -0
- package/src/api/definitionOf.js +20 -0
- package/src/api/errors.d.ts +61 -1
- package/src/api/frozenCopy.d.ts +6 -0
- package/src/api/frozenCopy.js +26 -0
- package/src/api/group.d.ts +8 -2
- package/src/api/group.js +24 -5
- package/src/api/index.d.ts +18 -7
- package/src/api/index.js +2 -2
- package/src/api/index.node.js +2 -2
- package/src/api/listeners.d.ts +5 -0
- package/src/api/listeners.js +25 -0
- package/src/api/look.d.ts +47 -0
- package/src/api/look.js +1 -0
- package/src/api/lookInput.d.ts +3 -0
- package/src/api/lookInput.js +41 -0
- package/src/api/moonPanelInput.d.ts +60 -0
- package/src/api/moonPanelInput.js +1 -0
- package/src/api/mount.d.ts +9 -19
- package/src/api/mount.js +27 -13
- package/src/api/mount.node.js +27 -13
- package/src/api/pathProvenance.js +1 -1
- package/src/api/pickerInput.d.ts +25 -0
- package/src/api/pickerInput.js +1 -0
- package/src/api/planBodies.d.ts +72 -0
- package/src/api/planBodies.js +300 -0
- package/src/api/planBodySets.d.ts +68 -0
- package/src/api/planBodySets.js +234 -0
- package/src/api/planCamera.d.ts +83 -0
- package/src/api/planCamera.js +184 -0
- package/src/api/planGroups.d.ts +36 -0
- package/src/api/planGroups.js +103 -0
- package/src/api/planMoonPanel.d.ts +19 -0
- package/src/api/planMoonPanel.js +104 -0
- package/src/api/planPaths.d.ts +40 -0
- package/src/api/planPaths.js +212 -0
- package/src/api/planPicker.d.ts +12 -0
- package/src/api/planPicker.js +40 -0
- package/src/api/planPlaces.d.ts +16 -0
- package/src/api/planPlaces.js +99 -0
- package/src/api/planStory.d.ts +26 -0
- package/src/api/planStory.js +66 -0
- package/src/api/planTimeline.d.ts +27 -0
- package/src/api/planTimeline.js +68 -0
- package/src/api/planViews.d.ts +25 -0
- package/src/api/planViews.js +35 -0
- package/src/api/prepared.js +4 -1
- package/src/api/renamedInputs.d.ts +15 -0
- package/src/api/renamedInputs.js +39 -0
- package/src/api/scene.d.ts +162 -68
- package/src/api/scene.js +247 -793
- package/src/api/sceneFreeze.d.ts +4 -0
- package/src/api/sceneFreeze.js +10 -0
- package/src/api/sceneReads.d.ts +171 -0
- package/src/api/sceneReads.js +6 -0
- package/src/api/story.d.ts +49 -19
- package/src/api/story.js +54 -22
- package/src/api/sunOrbit.js +9 -11
- package/src/api/time.d.ts +2 -1
- package/src/api/time.js +2 -1
- package/src/api/viewerCamera.d.ts +22 -0
- package/src/api/viewerCamera.js +84 -0
- package/src/api/viewerClock.d.ts +30 -0
- package/src/api/viewerClock.js +85 -0
- package/src/api/viewerFirstDraw.d.ts +14 -0
- package/src/api/viewerFirstDraw.js +26 -0
- package/src/api/viewerHandle.d.ts +79 -0
- package/src/api/viewerHandle.js +31 -0
- package/src/api/viewerLink.d.ts +87 -15
- package/src/api/viewerLink.js +111 -75
- package/src/api/viewerLooks.d.ts +19 -0
- package/src/api/viewerLooks.js +37 -0
- package/src/api/viewerPicker.d.ts +22 -0
- package/src/api/viewerPicker.js +49 -0
- package/src/api/viewerSelection.d.ts +25 -0
- package/src/api/viewerSelection.js +31 -0
- package/src/api/viewerViews.d.ts +10 -0
- package/src/api/viewerViews.js +18 -0
- package/src/api/viewerZones.d.ts +20 -0
- package/src/api/viewerZones.js +47 -0
- package/src/api/views.d.ts +4 -5
- package/src/api/views.js +7 -5
- package/src/app/App.d.ts +5 -3
- package/src/app/App.js +191 -82
- package/src/app/App.node.js +191 -82
- package/src/app/AstraeusScene.d.ts +16 -2
- package/src/app/AstraeusScene.js +4 -4
- package/src/app/BodyView.d.ts +4 -1
- package/src/app/BodyView.js +2 -2
- package/src/app/CameraController.d.ts +6 -0
- package/src/app/DeveloperSettings.d.ts +1 -4
- package/src/app/DeveloperSettings.js +6 -10
- package/src/app/FeatureMarkers.d.ts +4 -3
- package/src/app/FeatureMarkers.js +8 -13
- package/src/app/FrameRateSection.js +2 -1
- package/src/app/OrbitSetView.js +1 -1
- package/src/app/SettingControls.d.ts +11 -3
- package/src/app/SettingControls.js +10 -2
- package/src/app/SkyView.d.ts +3 -10
- package/src/app/SkyView.js +6 -28
- package/src/app/address.d.ts +16 -0
- package/src/app/address.js +31 -0
- package/src/app/bodyDraw.d.ts +10 -7
- package/src/app/bodyDraw.js +12 -32
- package/src/app/bodyMetrics.js +2 -2
- package/src/app/bodySet.d.ts +4 -20
- package/src/app/bodySet.js +5 -16
- package/src/app/debugReadout.js +1 -1
- package/src/app/displaySwitches.d.ts +4 -0
- package/src/app/displaySwitches.js +6 -0
- package/src/app/experienceDefinition.d.ts +11 -23
- package/src/app/listSwitch.d.ts +8 -14
- package/src/app/listSwitch.js +3 -10
- package/src/app/liveLook.d.ts +39 -0
- package/src/app/liveLook.js +66 -0
- package/src/app/look.d.ts +36 -0
- package/src/app/look.js +61 -0
- package/src/app/mission.d.ts +1 -1
- package/src/app/mission.js +1 -1
- package/src/app/openClock.d.ts +3 -2
- package/src/app/openClock.js +3 -3
- package/src/app/sceneCamera.js +9 -0
- package/src/app/sceneFrame.d.ts +4 -4
- package/src/app/sceneFrame.js +13 -8
- package/src/app/sceneHooks.js +3 -2
- package/src/app/style.css +114 -139
- package/src/app/trackedMetrics.d.ts +10 -3
- package/src/app/trackedMetrics.js +22 -11
- package/src/app/viewLink.d.ts +10 -32
- package/src/app/viewLink.js +10 -49
- package/src/app/viewerPort.d.ts +50 -0
- package/src/app/views.d.ts +1 -0
- package/src/assets/bodies/galileanMoons.js +1 -2
- package/src/assets/bodies/io.js +2 -2
- package/src/assets/bodies/listedMoons.d.ts +1 -1
- package/src/assets/bodies/listedMoons.js +2 -3
- package/src/assets/bodies/planetSystemMaps.js +2 -3
- package/src/assets/bodies/venus.js +2 -6
- package/src/assets/catalogue.js +1 -2
- package/src/assets/licence.d.ts +3 -3
- package/src/assets/licence.js +3 -3
- package/src/assets/pictures.d.ts +15 -12
- package/src/assets/pictures.js +24 -20
- package/src/assets/sky.d.ts +6 -5
- package/src/assets/sky.js +6 -9
- package/src/assets/visual.d.ts +4 -0
- package/src/core/bodies/index.d.ts +0 -4
- package/src/core/bodies/index.js +1 -6
- package/src/core/bodies/jupiterData.d.ts +0 -1
- package/src/core/bodies/jupiterData.js +2 -5
- package/src/core/bodies/moonSystem.d.ts +1 -1
- package/src/core/bodies/moonSystem.js +102 -55
- package/src/core/bodies/outerPlanetRingData.js +2 -2
- package/src/core/bodies/planetTrajectory.js +1 -1
- package/src/core/bodySetFamilies.d.ts +20 -0
- package/src/core/bodySetFamilies.js +14 -0
- package/src/core/chebyshevEphemeris.js +1 -1
- package/src/core/elementsBody.d.ts +8 -4
- package/src/core/elementsBody.js +32 -11
- package/src/core/elementsGroup.d.ts +27 -0
- package/src/core/elementsGroup.js +85 -0
- package/src/core/events.d.ts +2 -0
- package/src/core/events.js +2 -0
- package/src/core/illumination.js +1 -1
- package/src/core/listedOrbitGroup.d.ts +2 -0
- package/src/core/listedOrbitGroup.js +11 -7
- package/src/core/moonListText.d.ts +6 -0
- package/src/core/moonListText.js +19 -0
- package/src/core/moonTrajectory.js +1 -1
- package/src/core/pacing.d.ts +38 -3
- package/src/core/pacing.js +55 -4
- package/src/core/planetModels.js +2 -2
- package/src/core/planetSeries.d.ts +8 -0
- package/src/core/planetSeries.js +16 -2
- package/src/core/pointGroup.js +1 -1
- package/src/core/provenance.d.ts +2 -1
- package/src/core/provenance.js +2 -2
- package/src/core/referenceCenters.js +5 -5
- package/src/core/sampledTrajectory.js +1 -1
- package/src/core/scalePolicy.d.ts +1 -0
- package/src/core/startView.d.ts +19 -0
- package/src/core/startView.js +28 -0
- package/src/core/state.d.ts +6 -2
- package/src/core/state.js +3 -3
- package/src/core/storyPanels.d.ts +63 -0
- package/src/core/storyPanels.js +111 -0
- package/src/core/sunCentredSources.d.ts +4 -0
- package/src/core/sunCentredSources.js +9 -2
- package/src/core/timeInput.d.ts +4 -0
- package/src/core/timeInput.js +4 -0
- package/src/shell/AstraeusShell.d.ts +5 -1
- package/src/shell/AstraeusShell.js +20 -11
- package/src/shell/AstraeusShell.node.js +20 -11
- package/src/shell/Collapsible.d.ts +4 -3
- package/src/shell/Collapsible.js +5 -5
- package/src/shell/ControlsDrawer.d.ts +1 -1
- package/src/shell/ControlsDrawer.js +3 -1
- package/src/shell/DisplaySwitches.js +2 -1
- package/src/shell/InfoPanel.d.ts +3 -1
- package/src/shell/InfoPanel.js +5 -4
- package/src/shell/MoonFamilyPanel.js +1 -1
- package/src/shell/ObjectControls.d.ts +3 -1
- package/src/shell/ObjectControls.js +2 -2
- package/src/shell/Sources.d.ts +5 -3
- package/src/shell/Sources.js +5 -5
- package/src/shell/StoryPanelView.d.ts +4 -3
- package/src/shell/StoryPanelView.js +8 -6
- package/src/shell/SwitchControl.d.ts +5 -11
- package/src/shell/SwitchControl.js +2 -20
- package/src/shell/TimelineBar.css +81 -81
- package/src/shell/TimelineBar.d.ts +5 -2
- package/src/shell/TimelineBar.js +9 -8
- package/src/shell/TimelineBar.node.js +9 -8
- package/src/shell/TopBar.css +22 -22
- package/src/shell/TopBar.d.ts +5 -1
- package/src/shell/TopBar.js +2 -2
- package/src/shell/TopBar.node.js +2 -2
- package/src/shell/bootLoader.d.ts +4 -10
- package/src/shell/bootLoader.js +6 -52
- package/src/shell/embedded.css +18 -18
- package/src/shell/experience.d.ts +1 -1
- package/src/shell/moonFamilies.d.ts +2 -6
- package/src/shell/moonFamilies.js +2 -18
- package/src/shell/phone.css +58 -58
- package/src/shell/storyPanels.d.ts +2 -53
- package/src/shell/storyPanels.js +1 -106
- package/src/shell/style.css +153 -134
- package/src/shell/useDrawers.d.ts +3 -2
- package/src/shell/useDrawers.js +4 -3
- package/src/shell/viewerKeys.d.ts +8 -0
- package/src/shell/viewerKeys.js +16 -0
- package/src/synthetic/syntheticDefinition.js +20 -24
- package/src/synthetic/syntheticJourneyScene.js +3 -3
- package/src/synthetic/syntheticProbeDefinition.js +2 -1
- package/src/synthetic/syntheticViewsDefinition.d.ts +0 -3
- package/src/synthetic/syntheticViewsDefinition.js +10 -16
- package/data/moons/jupiter.json +0 -3333
- package/data/moons/neptune.json +0 -555
- package/data/moons/pluto.json +0 -205
- package/data/moons/saturn.json +0 -8267
- package/data/moons/uranus.json +0 -887
- package/src/app/addressNavigation.d.ts +0 -17
- package/src/app/addressNavigation.js +0 -16
- package/src/assets/bodies/jupiterMoonCatalogue.d.ts +0 -3
- package/src/assets/bodies/jupiterMoonCatalogue.js +0 -4
- package/src/assets/bodies/outerPlanetCatalogues.d.ts +0 -7
- package/src/assets/bodies/outerPlanetCatalogues.js +0 -8
- package/src/assets/bodies/swiftTuttle.d.ts +0 -12
- package/src/assets/bodies/swiftTuttle.js +0 -13
- package/src/assets/moonCatalogue.d.ts +0 -49
- package/src/assets/moonCatalogue.js +0 -80
- package/src/core/bodies/outerPlanetData.d.ts +0 -4
- package/src/core/bodies/outerPlanetData.js +0 -13
- package/src/core/bodies/swiftTuttle.d.ts +0 -46
- package/src/core/bodies/swiftTuttle.js +0 -106
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface NavigationParts {
|
|
2
|
-
/** Where the address is pushed (the page's history). */
|
|
3
|
-
readonly push: (address: string) => void;
|
|
4
|
-
/** Shows the loading cover. */
|
|
5
|
-
readonly showCover: () => void;
|
|
6
|
-
/** Builds and mounts the experience for the address now in the location (the cover is hidden by the new scene's first frame); it mounts nothing when `isCurrent()` is false, a newer request having begun. */
|
|
7
|
-
readonly rebuild: (isCurrent: () => boolean) => Promise<void>;
|
|
8
|
-
/** The rebuild failed. */
|
|
9
|
-
readonly fail: (error: unknown) => void;
|
|
10
|
-
}
|
|
11
|
-
export interface AddressNavigation {
|
|
12
|
-
/** A switch: push the address, then rebuild. */
|
|
13
|
-
readonly open: (address: string) => void;
|
|
14
|
-
/** Back or forward: the location already changed, so rebuild without pushing. */
|
|
15
|
-
readonly popped: () => void;
|
|
16
|
-
}
|
|
17
|
-
export declare function createAddressNavigation(parts: NavigationParts): AddressNavigation;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// Opening an address inside the running page: a switch pushes it into history, back and forward (popstate) reuse it without pushing.
|
|
2
|
-
// A plain module (no React, no experience names): the entry gives it the page's own pieces, so the push-versus-no-push rule can be tested alone.
|
|
3
|
-
export function createAddressNavigation(parts) {
|
|
4
|
-
// Only the newest request mounts; one begun and overtaken by another is dropped.
|
|
5
|
-
let latest = 0;
|
|
6
|
-
const run = () => {
|
|
7
|
-
const mine = ++latest;
|
|
8
|
-
parts.showCover();
|
|
9
|
-
parts.rebuild(() => mine === latest).catch((error) => { if (mine === latest)
|
|
10
|
-
parts.fail(error); });
|
|
11
|
-
};
|
|
12
|
-
return {
|
|
13
|
-
open: (address) => { parts.push(address); run(); },
|
|
14
|
-
popped: run,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { JUPITER_MOON_CATALOGUE_FILE } from "../../core/bodies/jupiterData.js";
|
|
2
|
-
import { parseMoonCatalogue } from "../moonCatalogue.js";
|
|
3
|
-
/** Jupiter's 115 moons by family (data/moons/jupiter.json, T-097). Core data: an experience chooses which of them to show. */
|
|
4
|
-
export const JUPITER_MOON_CATALOGUE = parseMoonCatalogue(JUPITER_MOON_CATALOGUE_FILE);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type MoonCatalogue } from "../moonCatalogue.js";
|
|
2
|
-
/** The moon lists by family of Saturn (292), Uranus (28), Neptune (16) and Pluto (5): data/moons/<planet>.json (T-115). Core data: an experience chooses which to show. */
|
|
3
|
-
export declare const SATURN_MOON_CATALOGUE: MoonCatalogue;
|
|
4
|
-
export declare const URANUS_MOON_CATALOGUE: MoonCatalogue;
|
|
5
|
-
export declare const NEPTUNE_MOON_CATALOGUE: MoonCatalogue;
|
|
6
|
-
export declare const PLUTO_MOON_CATALOGUE: MoonCatalogue;
|
|
7
|
-
export { NEPTUNE_RINGS, SATURN_RINGS, URANUS_RINGS } from "./outerPlanetRings.js";
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { NEPTUNE_MOON_CATALOGUE_FILE, PLUTO_MOON_CATALOGUE_FILE, SATURN_MOON_CATALOGUE_FILE, URANUS_MOON_CATALOGUE_FILE } from "../../core/bodies/outerPlanetData.js";
|
|
2
|
-
import { parseMoonCatalogue } from "../moonCatalogue.js";
|
|
3
|
-
/** The moon lists by family of Saturn (292), Uranus (28), Neptune (16) and Pluto (5): data/moons/<planet>.json (T-115). Core data: an experience chooses which to show. */
|
|
4
|
-
export const SATURN_MOON_CATALOGUE = parseMoonCatalogue(SATURN_MOON_CATALOGUE_FILE);
|
|
5
|
-
export const URANUS_MOON_CATALOGUE = parseMoonCatalogue(URANUS_MOON_CATALOGUE_FILE);
|
|
6
|
-
export const NEPTUNE_MOON_CATALOGUE = parseMoonCatalogue(NEPTUNE_MOON_CATALOGUE_FILE);
|
|
7
|
-
export const PLUTO_MOON_CATALOGUE = parseMoonCatalogue(PLUTO_MOON_CATALOGUE_FILE);
|
|
8
|
-
export { NEPTUNE_RINGS, SATURN_RINGS, URANUS_RINGS } from "./outerPlanetRings.js";
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { BodyMaterialConfig, BodyVisual } from "../visual.js";
|
|
2
|
-
/** A pale icy blue; presentation only, chosen to read against the black sky and apart from the planets' warm colours. */
|
|
3
|
-
export declare const SWIFT_TUTTLE_MATERIAL: BodyMaterialConfig;
|
|
4
|
-
/**
|
|
5
|
-
* A marker with no texture: the nucleus is 26 km across, under a pixel at any scale where its orbit is visible, so there is nothing
|
|
6
|
-
* to texture. The marker is a drawing aid at the comet's real position, not its size.
|
|
7
|
-
*/
|
|
8
|
-
export declare const SWIFT_TUTTLE_VISUAL: BodyVisual;
|
|
9
|
-
export declare const SWIFT_TUTTLE_ENTRY: Readonly<{
|
|
10
|
-
body: string;
|
|
11
|
-
visual: BodyVisual;
|
|
12
|
-
}>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SWIFT_TUTTLE } from "../../core/bodies/swiftTuttle.js";
|
|
2
|
-
/** A pale icy blue; presentation only, chosen to read against the black sky and apart from the planets' warm colours. */
|
|
3
|
-
export const SWIFT_TUTTLE_MATERIAL = Object.freeze({ color: "#9fe3ff", roughness: 1, metalness: 0 });
|
|
4
|
-
/**
|
|
5
|
-
* A marker with no texture: the nucleus is 26 km across, under a pixel at any scale where its orbit is visible, so there is nothing
|
|
6
|
-
* to texture. The marker is a drawing aid at the comet's real position, not its size.
|
|
7
|
-
*/
|
|
8
|
-
export const SWIFT_TUTTLE_VISUAL = Object.freeze({
|
|
9
|
-
kind: "marker",
|
|
10
|
-
material: SWIFT_TUTTLE_MATERIAL,
|
|
11
|
-
marker: Object.freeze({ sizePx: 7 }),
|
|
12
|
-
});
|
|
13
|
-
export const SWIFT_TUTTLE_ENTRY = Object.freeze({ body: SWIFT_TUTTLE.id, visual: SWIFT_TUTTLE_VISUAL });
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A planet's moon list (`data/moons/<planet>.json`, format `astraeus.moon-catalogue/1`): every moon's name, family and mean radius, and
|
|
3
|
-
* the families with a plain description. Facts only, checked here once (STYLE-06); positions come from the moon's ephemeris set.
|
|
4
|
-
*/
|
|
5
|
-
export declare const MOON_CATALOGUE_FORMAT = "astraeus.moon-catalogue/1";
|
|
6
|
-
export interface MoonFamily {
|
|
7
|
-
readonly id: string;
|
|
8
|
-
readonly label: string;
|
|
9
|
-
readonly description: string;
|
|
10
|
-
}
|
|
11
|
-
export interface MoonRecord {
|
|
12
|
-
readonly id: string;
|
|
13
|
-
readonly name: string;
|
|
14
|
-
readonly family: string;
|
|
15
|
-
readonly meanRadiusKm: number;
|
|
16
|
-
/** "measured" (a published measurement) or "estimate" (a brightness-based size). */
|
|
17
|
-
readonly radiusBasis: string;
|
|
18
|
-
/** Present for a moon with a mapped body package; such a moon is drawn as a full body. */
|
|
19
|
-
readonly bodyPackage?: string;
|
|
20
|
-
/** False for a provisional designation such as "S/2003 J 19" that has no name yet. */
|
|
21
|
-
readonly named: boolean;
|
|
22
|
-
readonly discoveryYear?: number;
|
|
23
|
-
/** Sidereal orbit period in days (JPL SSD mean elements); absent when no period is published for the moon. */
|
|
24
|
-
readonly orbitPeriodDays?: number;
|
|
25
|
-
/** Ids into the catalogue's `sources`: the list, the family, the size and the discovery (the period source is in the list but not in the info-panel provenance until a panel shows the period). */
|
|
26
|
-
readonly sourceIds: readonly string[];
|
|
27
|
-
}
|
|
28
|
-
export interface MoonSource {
|
|
29
|
-
readonly title: string;
|
|
30
|
-
readonly url: string;
|
|
31
|
-
}
|
|
32
|
-
export interface MoonCatalogue {
|
|
33
|
-
readonly parent: string;
|
|
34
|
-
readonly asOf: string;
|
|
35
|
-
readonly families: readonly MoonFamily[];
|
|
36
|
-
readonly moons: readonly MoonRecord[];
|
|
37
|
-
readonly sources: Readonly<Record<string, MoonSource>>;
|
|
38
|
-
}
|
|
39
|
-
export declare class MoonCatalogueError extends TypeError {
|
|
40
|
-
constructor(message: string);
|
|
41
|
-
}
|
|
42
|
-
export declare function parseMoonCatalogue(raw: unknown): MoonCatalogue;
|
|
43
|
-
/** The titles of the sources for one moon's family, size and discovery year, for its provenance sources list. */
|
|
44
|
-
export declare function moonSourceTitles(catalogue: MoonCatalogue, moon: MoonRecord): readonly string[];
|
|
45
|
-
/** The info-panel facts for one moon: its family, size and discovery year. Their sources are listed in the provenance (see `moonSourceTitles`). */
|
|
46
|
-
export declare function moonFacts(catalogue: MoonCatalogue, moon: MoonRecord): readonly {
|
|
47
|
-
readonly label: string;
|
|
48
|
-
readonly value: string;
|
|
49
|
-
}[];
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A planet's moon list (`data/moons/<planet>.json`, format `astraeus.moon-catalogue/1`): every moon's name, family and mean radius, and
|
|
3
|
-
* the families with a plain description. Facts only, checked here once (STYLE-06); positions come from the moon's ephemeris set.
|
|
4
|
-
*/
|
|
5
|
-
export const MOON_CATALOGUE_FORMAT = "astraeus.moon-catalogue/1";
|
|
6
|
-
export class MoonCatalogueError extends TypeError {
|
|
7
|
-
constructor(message) {
|
|
8
|
-
super(message);
|
|
9
|
-
this.name = "MoonCatalogueError";
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
const text = (value, where) => {
|
|
13
|
-
if (typeof value !== "string" || value === "")
|
|
14
|
-
throw new MoonCatalogueError(`${where} must be a non-empty string`);
|
|
15
|
-
return value;
|
|
16
|
-
};
|
|
17
|
-
export function parseMoonCatalogue(raw) {
|
|
18
|
-
if (typeof raw !== "object" || raw === null)
|
|
19
|
-
throw new MoonCatalogueError("moon catalogue must be an object");
|
|
20
|
-
const record = raw;
|
|
21
|
-
if (record.format !== MOON_CATALOGUE_FORMAT)
|
|
22
|
-
throw new MoonCatalogueError(`moon catalogue format must be "${MOON_CATALOGUE_FORMAT}"`);
|
|
23
|
-
if (!Array.isArray(record.families) || !Array.isArray(record.moons))
|
|
24
|
-
throw new MoonCatalogueError("moon catalogue needs families and moons");
|
|
25
|
-
const families = record.families.map((family, index) => Object.freeze({
|
|
26
|
-
id: text(family.id, `families[${index}].id`),
|
|
27
|
-
label: text(family.label, `families[${index}].label`),
|
|
28
|
-
description: text(family.description, `families[${index}].description`),
|
|
29
|
-
}));
|
|
30
|
-
const familyIds = new Set(families.map((family) => family.id));
|
|
31
|
-
if (familyIds.size !== families.length)
|
|
32
|
-
throw new MoonCatalogueError("moon catalogue family ids must be unique");
|
|
33
|
-
const moons = record.moons.map((moon, index) => {
|
|
34
|
-
const where = `moons[${index}]`;
|
|
35
|
-
const family = text(moon.family, `${where}.family`);
|
|
36
|
-
if (!familyIds.has(family))
|
|
37
|
-
throw new MoonCatalogueError(`${where}.family "${family}" is not a listed family`);
|
|
38
|
-
const radius = moon.meanRadiusKm;
|
|
39
|
-
if (typeof radius !== "number" || !(radius > 0))
|
|
40
|
-
throw new MoonCatalogueError(`${where}.meanRadiusKm must be positive`);
|
|
41
|
-
const sources = (moon.sources ?? {});
|
|
42
|
-
const sourceIds = [...new Set([sources.list, sources.family, sources.radius, sources.discovery].filter((id) => typeof id === "string"))];
|
|
43
|
-
return Object.freeze({
|
|
44
|
-
named: moon.named !== false,
|
|
45
|
-
...(typeof moon.discoveryYear === "number" ? { discoveryYear: moon.discoveryYear } : {}),
|
|
46
|
-
...(typeof moon.orbitPeriodDays === "number" && moon.orbitPeriodDays > 0 ? { orbitPeriodDays: moon.orbitPeriodDays } : {}),
|
|
47
|
-
sourceIds: Object.freeze(sourceIds),
|
|
48
|
-
id: text(moon.id, `${where}.id`),
|
|
49
|
-
name: text(moon.name, `${where}.name`),
|
|
50
|
-
family,
|
|
51
|
-
meanRadiusKm: radius,
|
|
52
|
-
radiusBasis: text(moon.radiusBasis, `${where}.radiusBasis`),
|
|
53
|
-
...(typeof moon.bodyPackage === "string" ? { bodyPackage: moon.bodyPackage } : {}),
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
if (new Set(moons.map((moon) => moon.id)).size !== moons.length)
|
|
57
|
-
throw new MoonCatalogueError("moon catalogue moon ids must be unique");
|
|
58
|
-
const sources = {};
|
|
59
|
-
for (const [id, source] of Object.entries((record.sources ?? {})))
|
|
60
|
-
sources[id] = Object.freeze({ title: text(source.title, `sources.${id}.title`), url: text(source.url, `sources.${id}.url`) });
|
|
61
|
-
for (const moon of moons)
|
|
62
|
-
for (const id of moon.sourceIds)
|
|
63
|
-
if (sources[id] === undefined)
|
|
64
|
-
throw new MoonCatalogueError(`moon "${moon.id}" cites unknown source "${id}"`);
|
|
65
|
-
return Object.freeze({ parent: text(record.parent, "parent"), asOf: text(record.asOf, "asOf"), families: Object.freeze(families), moons: Object.freeze(moons), sources: Object.freeze(sources) });
|
|
66
|
-
}
|
|
67
|
-
/** The titles of the sources for one moon's family, size and discovery year, for its provenance sources list. */
|
|
68
|
-
export function moonSourceTitles(catalogue, moon) {
|
|
69
|
-
return moon.sourceIds.map((id) => catalogue.sources[id].title);
|
|
70
|
-
}
|
|
71
|
-
/** The info-panel facts for one moon: its family, size and discovery year. Their sources are listed in the provenance (see `moonSourceTitles`). */
|
|
72
|
-
export function moonFacts(catalogue, moon) {
|
|
73
|
-
const family = catalogue.families.find((candidate) => candidate.id === moon.family);
|
|
74
|
-
const diameter = Math.round(2 * moon.meanRadiusKm * 10) / 10;
|
|
75
|
-
return [
|
|
76
|
-
{ label: "Family", value: family?.label ?? moon.family },
|
|
77
|
-
{ label: "Size", value: `${diameter.toLocaleString("en-GB")} km across${moon.radiusBasis === "estimate" ? " (estimated from brightness)" : ""}` },
|
|
78
|
-
...(moon.discoveryYear === undefined ? [] : [{ label: "Found", value: String(moon.discoveryYear) }]),
|
|
79
|
-
];
|
|
80
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Saturn's, Uranus's, Neptune's and Pluto's core data files as they are read (O-033 T-118; moon data is core): the moon lists by family
|
|
3
|
-
* (data/moons/<planet>.json, T-115). Raw JSON: src/assets parses and checks them (layer rule:
|
|
4
|
-
* assets reach data through core), as `jupiterData.ts` does for Jupiter.
|
|
5
|
-
*/
|
|
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
|
-
export const SATURN_MOON_CATALOGUE_FILE = saturnMoons;
|
|
11
|
-
export const URANUS_MOON_CATALOGUE_FILE = uranusMoons;
|
|
12
|
-
export const NEPTUNE_MOON_CATALOGUE_FILE = neptuneMoons;
|
|
13
|
-
export const PLUTO_MOON_CATALOGUE_FILE = plutoMoons;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { CelestialBodyDefinition, StateSourceBinding } from "../body.js";
|
|
2
|
-
import { type EccentricSampling } from "../sunCentredSources.js";
|
|
3
|
-
import type { Trajectory } from "../trajectory.js";
|
|
4
|
-
/**
|
|
5
|
-
* Orbital elements of 109P/Swift-Tuttle from the JPL Small-Body Database (https://ssd-api.jpl.nasa.gov/sbdb.api?sstr=109P&full-prec=1&phys-par=1,
|
|
6
|
-
* read 2026-10-15T08:39Z, raw response archived in tests/fixtures/swift-tuttle-horizons-source.txt). Solution SB405-CPV-2 of 2001-10-09 (M.S.W. Keesey),
|
|
7
|
-
* 652 observations 1737-1995, equinox J2000, ecliptic plane, osculating at the epoch.
|
|
8
|
-
*/
|
|
9
|
-
export declare const SWIFT_TUTTLE_ELEMENTS: Readonly<{
|
|
10
|
-
epochJdTdb: 2450000.5;
|
|
11
|
-
semiMajorAxisAu: 26.0920694978266;
|
|
12
|
-
eccentricity: 0.963225755046038;
|
|
13
|
-
inclinationDeg: 113.453816997171;
|
|
14
|
-
ascendingNodeDeg: 139.3811920815948;
|
|
15
|
-
argumentOfPerihelionDeg: 152.9821676305871;
|
|
16
|
-
meanAnomalyDeg: 7.631696167124212;
|
|
17
|
-
perihelionJdTdb: 2448968.499784556;
|
|
18
|
-
periodDays: 48681.19346262312;
|
|
19
|
-
aphelionAu: 51.22462284058444;
|
|
20
|
-
citation: "JPL Small-Body Database API, 109P/Swift-Tuttle, solution SB405-CPV-2 (2001-10-09), epoch JD 2450000.5 TDB, read 2026-10-15";
|
|
21
|
-
}>;
|
|
22
|
-
/**
|
|
23
|
-
* The epoch in UTC: 1995-10-10 00:00 TDB, taken as TT, which ran 61.184 s ahead of UTC then (32.184 s plus 29 leap seconds). A 61 s error would
|
|
24
|
-
* move the comet at most about 2.6 thousand km near perihelion, far below the two-body error against Horizons.
|
|
25
|
-
*/
|
|
26
|
-
export declare const SWIFT_TUTTLE_EPOCH_UTC_MS: number;
|
|
27
|
-
/** Nucleus diameter 26 km (Lamy, Toth, Fernandez and Weaver 2004, Comets II, pp. 223-264) as printed by SBDB; Horizons prints RAD = 13 km. */
|
|
28
|
-
export declare const SWIFT_TUTTLE_RADIUS_KM = 13;
|
|
29
|
-
/** The largest Sun-centred distance from Horizons over the eight compared dates, km (tests/swiftTuttle.test.ts asserts this figure). */
|
|
30
|
-
export declare const SWIFT_TUTTLE_MAX_ERROR_KM = 10686093;
|
|
31
|
-
/** The largest of those differences as a fraction of the comet's distance from the Sun at that date (at the 1992 perihelion). */
|
|
32
|
-
export declare const SWIFT_TUTTLE_MAX_ERROR_FRACTION = 0.00857;
|
|
33
|
-
/**
|
|
34
|
-
* Classification: a position within this fraction of the comet's distance from the Sun at every compared date is good enough to draw where the
|
|
35
|
-
* comet is on its orbit at overview scale (an error of 1% of 45 AU is half an AU) and is called "approximate"; it is not an ephemeris and is not
|
|
36
|
-
* good enough to compute a close approach. A body's own diameter is no yardstick here: the nucleus is 26 km, the error is millions of km.
|
|
37
|
-
*/
|
|
38
|
-
export declare const SWIFT_TUTTLE_APPROXIMATE_LIMIT_FRACTION = 0.01;
|
|
39
|
-
/** The two-body period about the Sun's GM from the catalogue (the model's own, 133.28 years), ms. */
|
|
40
|
-
export declare const SWIFT_TUTTLE_PERIOD_MS: number;
|
|
41
|
-
/** What a path of the comet's orbit needs to space its samples by eccentric anomaly; periapsis is where the model puts it, not SBDB's own. */
|
|
42
|
-
export declare const SWIFT_TUTTLE_SAMPLING: EccentricSampling;
|
|
43
|
-
export declare const SWIFT_TUTTLE_LIMITATIONS: readonly string[];
|
|
44
|
-
export declare function createSwiftTuttleTrajectory(): Trajectory;
|
|
45
|
-
export declare const SWIFT_TUTTLE: CelestialBodyDefinition;
|
|
46
|
-
export declare const SWIFT_TUTTLE_BINDING: StateSourceBinding;
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { createProvenance } from "../provenance.js";
|
|
2
|
-
import { createTwoBodyTrajectory } from "../sunCentredSources.js";
|
|
3
|
-
import { createOrbTwoBodyAdapter } from "../twoBodyAdapter.js";
|
|
4
|
-
import { trueAnomalyFromMean } from "../keplerAnomaly.js";
|
|
5
|
-
import { SUN } from "./sun.js";
|
|
6
|
-
const AU_KM = 149_597_870.7;
|
|
7
|
-
const DEGREES = Math.PI / 180;
|
|
8
|
-
/**
|
|
9
|
-
* Orbital elements of 109P/Swift-Tuttle from the JPL Small-Body Database (https://ssd-api.jpl.nasa.gov/sbdb.api?sstr=109P&full-prec=1&phys-par=1,
|
|
10
|
-
* read 2026-10-15T08:39Z, raw response archived in tests/fixtures/swift-tuttle-horizons-source.txt). Solution SB405-CPV-2 of 2001-10-09 (M.S.W. Keesey),
|
|
11
|
-
* 652 observations 1737-1995, equinox J2000, ecliptic plane, osculating at the epoch.
|
|
12
|
-
*/
|
|
13
|
-
export const SWIFT_TUTTLE_ELEMENTS = Object.freeze({
|
|
14
|
-
epochJdTdb: 2450000.5,
|
|
15
|
-
semiMajorAxisAu: 26.0920694978266,
|
|
16
|
-
eccentricity: 0.963225755046038,
|
|
17
|
-
inclinationDeg: 113.453816997171,
|
|
18
|
-
ascendingNodeDeg: 139.3811920815948,
|
|
19
|
-
argumentOfPerihelionDeg: 152.9821676305871,
|
|
20
|
-
meanAnomalyDeg: 7.631696167124212,
|
|
21
|
-
perihelionJdTdb: 2448968.499784556297,
|
|
22
|
-
periodDays: 48681.19346262312,
|
|
23
|
-
aphelionAu: 51.22462284058444,
|
|
24
|
-
citation: "JPL Small-Body Database API, 109P/Swift-Tuttle, solution SB405-CPV-2 (2001-10-09), epoch JD 2450000.5 TDB, read 2026-10-15",
|
|
25
|
-
});
|
|
26
|
-
/**
|
|
27
|
-
* The epoch in UTC: 1995-10-10 00:00 TDB, taken as TT, which ran 61.184 s ahead of UTC then (32.184 s plus 29 leap seconds). A 61 s error would
|
|
28
|
-
* move the comet at most about 2.6 thousand km near perihelion, far below the two-body error against Horizons.
|
|
29
|
-
*/
|
|
30
|
-
export const SWIFT_TUTTLE_EPOCH_UTC_MS = Date.UTC(1995, 9, 10) - 61_184;
|
|
31
|
-
/** Nucleus diameter 26 km (Lamy, Toth, Fernandez and Weaver 2004, Comets II, pp. 223-264) as printed by SBDB; Horizons prints RAD = 13 km. */
|
|
32
|
-
export const SWIFT_TUTTLE_RADIUS_KM = 13;
|
|
33
|
-
/** The dates the comet was compared with JPL Horizons (tests/fixtures/swift-tuttle-horizons.json): 1990-01-01 to 2030-01-01. */
|
|
34
|
-
const COMPARED_UTC = Object.freeze({ startUtcMs: Date.UTC(1990, 0, 1), endUtcMs: Date.UTC(2030, 0, 1) });
|
|
35
|
-
/** The largest Sun-centred distance from Horizons over the eight compared dates, km (tests/swiftTuttle.test.ts asserts this figure). */
|
|
36
|
-
export const SWIFT_TUTTLE_MAX_ERROR_KM = 10_686_093;
|
|
37
|
-
/** The largest of those differences as a fraction of the comet's distance from the Sun at that date (at the 1992 perihelion). */
|
|
38
|
-
export const SWIFT_TUTTLE_MAX_ERROR_FRACTION = 0.00857;
|
|
39
|
-
/**
|
|
40
|
-
* Classification: a position within this fraction of the comet's distance from the Sun at every compared date is good enough to draw where the
|
|
41
|
-
* comet is on its orbit at overview scale (an error of 1% of 45 AU is half an AU) and is called "approximate"; it is not an ephemeris and is not
|
|
42
|
-
* good enough to compute a close approach. A body's own diameter is no yardstick here: the nucleus is 26 km, the error is millions of km.
|
|
43
|
-
*/
|
|
44
|
-
export const SWIFT_TUTTLE_APPROXIMATE_LIMIT_FRACTION = 0.01;
|
|
45
|
-
const gm = SUN.gmKm3S2;
|
|
46
|
-
const semiMajorAxisKm = SWIFT_TUTTLE_ELEMENTS.semiMajorAxisAu * AU_KM;
|
|
47
|
-
const meanMotionRadPerS = Math.sqrt(gm / semiMajorAxisKm ** 3);
|
|
48
|
-
/** The two-body period about the Sun's GM from the catalogue (the model's own, 133.28 years), ms. */
|
|
49
|
-
export const SWIFT_TUTTLE_PERIOD_MS = ((2 * Math.PI) / meanMotionRadPerS) * 1000;
|
|
50
|
-
/** What a path of the comet's orbit needs to space its samples by eccentric anomaly; periapsis is where the model puts it, not SBDB's own. */
|
|
51
|
-
export const SWIFT_TUTTLE_SAMPLING = Object.freeze({
|
|
52
|
-
eccentricity: SWIFT_TUTTLE_ELEMENTS.eccentricity,
|
|
53
|
-
periodMs: SWIFT_TUTTLE_PERIOD_MS,
|
|
54
|
-
periapsisUtcMs: Math.round(SWIFT_TUTTLE_EPOCH_UTC_MS - ((SWIFT_TUTTLE_ELEMENTS.meanAnomalyDeg * DEGREES) / meanMotionRadPerS) * 1000),
|
|
55
|
-
});
|
|
56
|
-
export const SWIFT_TUTTLE_LIMITATIONS = Object.freeze([
|
|
57
|
-
"Unperturbed two-body motion about the Sun from osculating elements at 1995-10-10: no planetary perturbations and no non-gravitational forces (comet outgassing). The elements are a fit to the 1737-1995 observations.",
|
|
58
|
-
"Horizons applies perturbations from a fit to the same observations, so the two drift apart.",
|
|
59
|
-
"Positions before 1990 or after 2030 were not compared with Horizons; the orbit reaches 51 AU and takes 133 years, a long span for two-body motion.",
|
|
60
|
-
"The comet's size is the nucleus alone (a 26 km body); the coma and tail are not modelled. No velocity or orientation is modelled.",
|
|
61
|
-
]);
|
|
62
|
-
export function createSwiftTuttleTrajectory() {
|
|
63
|
-
const elements = SWIFT_TUTTLE_ELEMENTS;
|
|
64
|
-
return createTwoBodyTrajectory({
|
|
65
|
-
body: "swift-tuttle",
|
|
66
|
-
plane: "ecliptic-j2000",
|
|
67
|
-
epochUtcMs: SWIFT_TUTTLE_EPOCH_UTC_MS,
|
|
68
|
-
elements: {
|
|
69
|
-
semiMajorAxisKm,
|
|
70
|
-
eccentricity: elements.eccentricity,
|
|
71
|
-
inclinationDeg: elements.inclinationDeg,
|
|
72
|
-
raanDeg: elements.ascendingNodeDeg,
|
|
73
|
-
argumentOfPeriapsisDeg: elements.argumentOfPerihelionDeg,
|
|
74
|
-
trueAnomalyDeg: trueAnomalyFromMean(elements.meanAnomalyDeg * DEGREES, elements.eccentricity) / DEGREES,
|
|
75
|
-
},
|
|
76
|
-
}, createOrbTwoBodyAdapter());
|
|
77
|
-
}
|
|
78
|
-
export const SWIFT_TUTTLE = Object.freeze({
|
|
79
|
-
id: "swift-tuttle",
|
|
80
|
-
label: "109P/Swift-Tuttle",
|
|
81
|
-
radiusKm: SWIFT_TUTTLE_RADIUS_KM,
|
|
82
|
-
parentId: "sun",
|
|
83
|
-
orientation: "none",
|
|
84
|
-
accuracy: Object.freeze({
|
|
85
|
-
dimensions: createProvenance({
|
|
86
|
-
sourceType: "observed",
|
|
87
|
-
sources: [
|
|
88
|
-
"JPL Small-Body Database physical parameters for 109P (diameter 26 km, Lamy et al. 2004, Comets II), read 2026-10-15",
|
|
89
|
-
"JPL Horizons comet header for 109P (RAD = 13 km), read 2026-10-15",
|
|
90
|
-
],
|
|
91
|
-
accuracy: "Nucleus radius of 13 km, half the published effective diameter. A comet has no gravitational parameter in either source, so it cannot be a two-body centre.",
|
|
92
|
-
notes: "At interplanetary scale the nucleus is far smaller than a pixel; it is drawn as a marker.",
|
|
93
|
-
}),
|
|
94
|
-
position: createProvenance({
|
|
95
|
-
sourceType: "reconstructed",
|
|
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
|
-
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
|
-
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,
|
|
101
|
-
}),
|
|
102
|
-
validUtc: COMPARED_UTC,
|
|
103
|
-
orientationLimitations: SWIFT_TUTTLE_LIMITATIONS,
|
|
104
|
-
}),
|
|
105
|
-
});
|
|
106
|
-
export const SWIFT_TUTTLE_BINDING = Object.freeze({ body: SWIFT_TUTTLE.id, create: () => createSwiftTuttleTrajectory() });
|