diff --git a/src/app/features/body-detail/body-readouts.ts b/src/app/features/body-detail/body-readouts.ts index 9953ade..82ff9a7 100644 --- a/src/app/features/body-detail/body-readouts.ts +++ b/src/app/features/body-detail/body-readouts.ts @@ -72,12 +72,17 @@ export function bodyReadouts(body: BodyDetailViewModel): BodyReadouts { /** * The derived surface is a reasoned illustration, and a panel of real measurements sitting next * to it is exactly the context in which it could be mistaken for another one. + * + * Only an exoplanet has never been imaged. A moon or dwarf planet drawn this way has been — Voyager + * 2 photographed Uranus's five large moons, Proteus and Nereid, Cassini Hyperion, and Hubble sees + * Eris, Haumea and Makemake as points — but has no global map this app can use. */ function provenanceFor(body: BodyDetailViewModel): string { if (body.hasPhotography) { return 'Surface: NASA/ESA/USGS photography.'; } + const why = body.kind === 'exoplanet' ? 'no image of this world exists' : 'no global map of this world is used here'; return body.appearance.equilibriumTemperatureK === null - ? 'Surface illustrated from this body’s measured size and mass. Its host star is not in the catalogue, so no temperature could be derived. Not an observation — no image of this world exists.' - : 'Surface illustrated from the measurements above — size, density and the temperature derived from its star’s output and its orbit. Not an observation — no image of this world exists.'; + ? `Surface illustrated from this body’s measured size and mass. Its host star is not in the catalogue, so no temperature could be derived. Not an observation — ${why}.` + : `Surface illustrated from the measurements above — size, density and the temperature derived from its star’s output and its orbit. Not an observation — ${why}.`; } diff --git a/src/app/features/body-detail/body-view-model.spec.ts b/src/app/features/body-detail/body-view-model.spec.ts index 91a1e69..8c96c22 100644 --- a/src/app/features/body-detail/body-view-model.spec.ts +++ b/src/app/features/body-detail/body-view-model.spec.ts @@ -72,6 +72,19 @@ describe('buildBodyViewModel', () => { expect(bodyReadouts(buildBodyViewModel('luna', catalogues)!).provenance).toContain('Orbit: JPL SSD satellite mean elements, epoch 2000 Jan 1.'); }); + it('says a moon without a map is illustrated, without saying it was never imaged', () => { + // luna has no map under that id. Voyager and Cassini photographed every moon drawn this way. + const provenance = bodyReadouts(buildBodyViewModel('luna', catalogues)!).provenance; + expect(provenance).toContain('Not an observation — no global map of this world is used here.'); + expect(provenance).not.toContain('no image of this world exists'); + }); + + it('says an exoplanet has never been imaged', () => { + const exoplanet: ExoplanetRecord = { id: 'x', hostStarId: SUN_STAR_ID, hostStarName: 'Sol', name: 'X b', orbit: { semiMajorAxisAu: 0.05 } }; + const model = buildBodyViewModel('x', { bodies: [], exoplanets: [exoplanet], stars: [sun] })!; + expect(bodyReadouts(model).provenance).toContain('Not an observation — no image of this world exists.'); + }); + it('marks a published exoplanet period as measured, not derived', () => { const exoplanet: ExoplanetRecord = { id: 'kepler-22-b',