@elite-dangerous-almanac/core 0.2.1 → 0.2.2
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/README.md +3 -2
- package/THIRD_PARTY_NOTICES.md +24 -2
- package/dist/astro/body-orbit.d.ts +174 -0
- package/dist/astro/body-orbit.js +1 -0
- package/dist/astro/body-orbit.js.map +1 -0
- package/dist/astro/body-physics.d.ts +228 -0
- package/dist/astro/body-physics.js +1 -0
- package/dist/astro/body-physics.js.map +1 -0
- package/dist/astro/body-rings.d.ts +223 -0
- package/dist/astro/body-rings.js +1 -0
- package/dist/astro/body-rings.js.map +1 -0
- package/dist/astro/codex-region-lookup.js +1 -1
- package/dist/astro/codex-region-lookup.js.map +1 -1
- package/dist/astro/index.d.ts +38 -1
- package/dist/astro/index.js +1 -1
- package/dist/astro/nebulae.d.ts +4 -4
- package/dist/astro/procedural-system.js +1 -1
- package/dist/astro/star-physics.d.ts +255 -0
- package/dist/astro/star-physics.js +1 -0
- package/dist/astro/star-physics.js.map +1 -0
- package/dist/body-scan-CEUYjCfH.d.ts +416 -0
- package/dist/{chunk-HUYYGTRM.js → chunk-3LZXB2MC.js} +1 -1
- package/dist/chunk-3RTUSDQF.js +1 -0
- package/dist/chunk-3RTUSDQF.js.map +1 -0
- package/dist/chunk-4OTQBHQL.js +1 -0
- package/dist/chunk-4OTQBHQL.js.map +1 -0
- package/dist/{chunk-MRTTQYT5.js → chunk-7EWZGDWY.js} +1 -1
- package/dist/{chunk-TBZJIQ5P.js → chunk-7TVFV3VO.js} +1 -1
- package/dist/chunk-7TVFV3VO.js.map +1 -0
- package/dist/chunk-7ZERP4TB.js +1 -0
- package/dist/{chunk-APEG4ZER.js.map → chunk-7ZERP4TB.js.map} +1 -1
- package/dist/chunk-B5VTFOK4.js +1 -0
- package/dist/chunk-B5VTFOK4.js.map +1 -0
- package/dist/chunk-DAQ3PJ4R.js +1 -0
- package/dist/chunk-DAQ3PJ4R.js.map +1 -0
- package/dist/chunk-GBTCWNO6.js +1 -0
- package/dist/chunk-GBTCWNO6.js.map +1 -0
- package/dist/chunk-NEXDA73Y.js +1 -0
- package/dist/chunk-NEXDA73Y.js.map +1 -0
- package/dist/chunk-P2MUFVJC.js +1 -0
- package/dist/chunk-P2MUFVJC.js.map +1 -0
- package/dist/{chunk-AAE4KZ2V.js → chunk-SS6XK336.js} +1 -1
- package/dist/{chunk-AAE4KZ2V.js.map → chunk-SS6XK336.js.map} +1 -1
- package/dist/chunk-TMXKC6JL.js +1 -0
- package/dist/chunk-TMXKC6JL.js.map +1 -0
- package/dist/chunk-ZZ376WHL.js +1 -0
- package/dist/chunk-ZZ376WHL.js.map +1 -0
- package/dist/commodities/commodities.d.ts +1 -1
- package/dist/equipment/index.js +1 -1
- package/dist/equipment/upgrade-costs.js +1 -1
- package/dist/equipment/upgrade-costs.js.map +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/materials/index.js +1 -1
- package/dist/materials/materials.d.ts +1 -1
- package/dist/materials/micro-resources-all.js +1 -1
- package/dist/materials/micro-resources.d.ts +1 -1
- package/dist/materials/micro-resources.js +1 -1
- package/dist/ships/build-metrics.d.ts +21 -232
- package/dist/ships/build-metrics.js +1 -1
- package/dist/ships/distributor.d.ts +1 -1
- package/dist/ships/heat.d.ts +1 -1
- package/dist/ships/index.d.ts +2 -2
- package/dist/ships/index.js +1 -1
- package/dist/ships/loadout-calculations.d.ts +2 -2
- package/dist/ships/mobility-capacitor.d.ts +1 -1
- package/dist/ships/modules-all.js +1 -1
- package/dist/ships/modules.d.ts +1 -1
- package/dist/ships/modules.js +1 -1
- package/dist/ships/pre-engineered-stats.d.ts +7 -5
- package/dist/ships/pre-engineered-stats.js +1 -1
- package/dist/ships/shield-capacitor.d.ts +1 -1
- package/dist/ships/shields.d.ts +1 -1
- package/dist/ships/ship-loadout.d.ts +71 -16
- package/dist/ships/ship-loadout.js +1 -1
- package/package.json +18 -3
- package/dist/chunk-6S36AVA4.js +0 -1
- package/dist/chunk-6S36AVA4.js.map +0 -1
- package/dist/chunk-APEG4ZER.js +0 -1
- package/dist/chunk-GVNTKCVF.js +0 -1
- package/dist/chunk-GVNTKCVF.js.map +0 -1
- package/dist/chunk-JET673E5.js +0 -1
- package/dist/chunk-JET673E5.js.map +0 -1
- package/dist/chunk-SG6YLUQ4.js +0 -1
- package/dist/chunk-SG6YLUQ4.js.map +0 -1
- package/dist/chunk-TBZJIQ5P.js.map +0 -1
- /package/dist/{chunk-HUYYGTRM.js.map → chunk-3LZXB2MC.js.map} +0 -0
- /package/dist/{chunk-MRTTQYT5.js.map → chunk-7EWZGDWY.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/astro/codex-region-lookup.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../src/astro/codex-region-lookup.ts"],"names":["boxelEdgeLy","decodeSystemAddress","getCodexRegion","galactic_region_cells_default","projection","x0","y0","z0","scaleNumerator","scaleDenominator","lyPerCell","gridWidth","gridHeight","regions","id","cells","minPz","rows","ROW_INDEX","index","Map","region","forEach","runs","i","pz","row","get","set","run","px","len","push","CODEX_REGION_MAP_X0","CODEX_REGION_MAP_Y0","CODEX_REGION_MAP_Z0","CODEX_REGION_MAP_LY_PER_CELL","regionIdAtCell","pxStart","pxEnd","findCodexRegionAt","point","Math","floor","x","z","findCodexRegionForBoxel","id64","sizeClass","absoluteBoxel","edge","y"],"mappings":"O,gzqMAkCA,IAAMI,WAAEA,WAAAS,QAAYA,SAAYV,8BAwBhC,IAAMe,UAAA,MACF,MAAMC,qBAAA,IAAYC,IAClB,IAAA,MAAWC,UAAUR,QAAS,CAC1B,MAAMG,MAAEA,MAAAC,KAAOA,MAASI,OAAON,MAC/BE,KAAKK,QAAQ,CAACC,KAAMC,KAChB,MAAMC,GAAKT,MAAQQ,EACnB,IAAIE,IAAMP,MAAMQ,IAAIF,IACpB,IAAKC,IAAK,CACNA,IAAM,GACNP,MAAMS,IAAIH,GAAIC,IAClB,CACA,IAAA,MAAWG,OAAON,KAAM,CACpB,MAAMO,GAAKD,IAAI,IAAM,EACrB,MAAME,IAAMF,IAAI,IAAM,EACtBH,IAAIM,KAAK,CAACF,GAAIA,GAAKC,IAAKV,OAAOP,IACnC,GAER,CACA,OAAOK,KACX,EAnBM,GAkCC,IAAMc,oBAAsB7B,WAAWC,GAWvC,IAAM6B,oBAAsB9B,WAAWE,GAWvC,IAAM6B,oBAAsB/B,WAAWG,GAWvC,IAAM6B,6BAA+BhC,WAAWM,UAgDvD,SAAS2B,eAAeP,GAAYL,IAChC,GAAIK,GAAK,GAAKL,GAAK,GAAKK,IAAM1B,WAAWO,WAAac,IAAMrB,WAAWQ,WAAY,CAC/E,OAAO,CACX,CACA,MAAMc,IAAMR,UAAUS,IAAIF,IAC1B,IAAKC,IAAK,OAAO,EAEjB,IAAA,MAAYY,QAASC,MAAOzB,MAAOY,IAAK,CACpC,GAAII,IAAMQ,SAAWR,GAAKS,MAAO,OAAOzB,EAC5C,CACA,OAAO,CACX,CAuBO,SAAS0B,kBAAkBC,OAC9B,MAAMX,GAAKY,KAAKC,OACVF,MAAMG,EAAIxC,WAAWC,IAAMD,WAAWI,eAAkBJ,WAAWK,kBAEzE,MAAMgB,GAAKiB,KAAKC,OACVF,MAAMI,EAAIzC,WAAWG,IAAMH,WAAWI,eAAkBJ,WAAWK,kBAEzE,OAAOP,eAAemC,eAAeP,GAAIL,IAC7C,CA8BO,SAASqB,wBAAwBC,MACpC,MAAMC,UAAEA,UAAAC,cAAWA,eAAkBhD,oBAAoB8C,MACzD,MAAMG,KAAOlD,YAAYgD,WACzB,MAAMJ,EAAIK,cAAcL,EAAIM,KAAO9C,WAAWC,GAC9C,MAAM8C,EAAIF,cAAcE,EAAID,KAAO9C,WAAWE,GAC9C,MAAMuC,EAAII,cAAcJ,EAAIK,KAAO9C,WAAWG,GAC9C,MAAO,CAAEqC,IAAGO,IAAGN,IAAGxB,OAAQmB,kBAAkB,CAAEI,IAAGC,MACrD,QAAAT,6BAAAH,oBAAAC,oBAAAC,oBAAAK,kBAAAM"}
|
package/dist/astro/index.d.ts
CHANGED
|
@@ -24,6 +24,22 @@
|
|
|
24
24
|
* the rest — {@link astro/nebulae-planetary!PLANETARY_NEBULAE | PLANETARY_NEBULAE} and
|
|
25
25
|
* {@link astro/nebulae-all!ALL_NEBULAE | ALL_NEBULAE}.
|
|
26
26
|
*
|
|
27
|
+
* **Bodies arrive as the journal writes them.** {@link BodyScanEvent} is the game's `Scan`
|
|
28
|
+
* event typed field for field — the record every journal reader, EDDN relay and body
|
|
29
|
+
* database already speaks — so a parsed line is already the right type and needs no
|
|
30
|
+
* adapter. Its `SystemAddress` is the same {@link SystemAddressInput} every address entry
|
|
31
|
+
* point takes.
|
|
32
|
+
*
|
|
33
|
+
* **The body calculations read {@link BodyProperties}, the physical half of that.** A
|
|
34
|
+
* `BodyScanEvent` is one, so a parsed line goes straight in; so does a record rebuilt from
|
|
35
|
+
* a database, because none of the journal's bookkeeping — `event`, `BodyID`, the discovery
|
|
36
|
+
* flags — is required. They work in the journal's own units and answer `null` rather than
|
|
37
|
+
* guess: {@link bulkDensity} and {@link rocheLimits} on `./body-physics`,
|
|
38
|
+
* {@link orbitExtents} and {@link spinOrbitResonance} on `./body-orbit`,
|
|
39
|
+
* {@link ringDynamics} on `./body-rings`, {@link classifyNeutronStar} and
|
|
40
|
+
* {@link mainSequenceLifetime} on `./star-physics`. A calculation comparing a body with
|
|
41
|
+
* the one it orbits takes both, since a scan names its parent only by `BodyID`.
|
|
42
|
+
*
|
|
27
43
|
* **Coordinate spaces have different shapes.**
|
|
28
44
|
* {@link GalacticPosition} is `{x, y, z}` in light-years with Sol at the origin — what the journal,
|
|
29
45
|
* EDSM and Spansh report, and what {@link findHandAuthoredRegionAt} and
|
|
@@ -89,7 +105,7 @@
|
|
|
89
105
|
* ```
|
|
90
106
|
*
|
|
91
107
|
* The catalogue argument is required here rather than defaulted: `ALL_NEBULAE` is
|
|
92
|
-
*
|
|
108
|
+
* ~432 KiB, so importing it must be your decision.
|
|
93
109
|
*
|
|
94
110
|
* @example
|
|
95
111
|
* The two coordinate spaces, side by side. Light-years and sector indices are both
|
|
@@ -120,10 +136,31 @@
|
|
|
120
136
|
* permitLockForSystemName('Synuefe EN-H d11-96'); // -> null not locked at all
|
|
121
137
|
* ```
|
|
122
138
|
*
|
|
139
|
+
* @example
|
|
140
|
+
* Bodies: a journal `Scan` line goes in as it comes, and each calculation reads only the
|
|
141
|
+
* fields it needs — so a record with just a mass and a radius works too.
|
|
142
|
+
*
|
|
143
|
+
* ```ts
|
|
144
|
+
* import { bulkDensity, rocheLimits } from '@elite-dangerous-almanac/core/astro/body-physics';
|
|
145
|
+
* import { orbitExtents } from '@elite-dangerous-almanac/core/astro/body-orbit';
|
|
146
|
+
*
|
|
147
|
+
* const moon = { MassEM: 0.0123, Radius: 1_737_400, SemiMajorAxis: 3.844e8, Eccentricity: 0.0549 };
|
|
148
|
+
* const earth = { MassEM: 1, Radius: 6_371_000 };
|
|
149
|
+
*
|
|
150
|
+
* bulkDensity(moon); // -> 3343.7…
|
|
151
|
+
* orbitExtents(moon)?.periapsis; // -> 363296440
|
|
152
|
+
* rocheLimits(moon, earth)?.rigid; // -> 9483500.2…
|
|
153
|
+
* ```
|
|
154
|
+
*
|
|
123
155
|
* @packageDocumentation
|
|
124
156
|
*/
|
|
125
157
|
export { ProceduralSystem } from './procedural-system.js';
|
|
126
158
|
export { G as GalacticPosition } from '../galactic-position-shLkm4Qg.js';
|
|
159
|
+
export { A as AtmosphereComponent, B as BodyComposition, a as BodyParent, b as BodyProperties, c as BodyRing, d as BodyScanEvent, S as SurfaceMaterial } from '../body-scan-CEUYjCfH.js';
|
|
160
|
+
export { GRAVITATIONAL_CONSTANT, KG_PER_EARTH_MASS, KG_PER_SOLAR_MASS, RocheLimits, bodyMass, bulkDensity, hillRadius, primaryAngularDiameter, rocheLimits, rocheLimitsForDensity } from './body-physics.js';
|
|
161
|
+
export { EccentricityClass, OrbitExtents, SpinOrbitResonance, classifyEccentricity, equatorialVelocity, orbitExtents, spinOrbitResonance } from './body-orbit.js';
|
|
162
|
+
export { RING_NOMINAL_RADIUS_FRACTION, RingDynamics, VISIBLE_RING_MAX_WIDTH, VISIBLE_RING_MIN_SURFACE_DENSITY, isInvisibleRing, ringDynamics, ringParticleDensity, ringRocheLimits, ringSurfaceDensity } from './body-rings.js';
|
|
163
|
+
export { CHANDRASEKHAR_LIMIT_SOLAR_MASSES, MassStabilityAssessment, MassStabilityLimit, NEUTRON_STAR_MASS_DROP_OFF_SOLAR_MASSES, NeutronStarClass, SOLAR_RADIUS, SPEED_OF_LIGHT, TOV_LIMIT_SOLAR_MASSES, absoluteBolometricMagnitude, assessMassStability, classifyNeutronStar, mainSequenceLifetime, schwarzschildRadius } from './star-physics.js';
|
|
127
164
|
export { BoxelLetters, IsProceduralSystemNameOptions, SystemNameParts, boxelCodeToLetters, canonicalizeSystemName, formatSystemName, isProceduralSystemName, lettersToBoxelCode, parseSystemName } from './system-name.js';
|
|
128
165
|
export { A as AbsoluteBoxel, D as DecodedAddress, N as NamingRegionOrigin, S as SECTOR_INTERNAL_SIZE, a as absoluteBoxelToBoxelCode, b as boxelCodeToAbsoluteBoxel, c as boxelInternalSize, d as decodeModSystemAddress, e as decodeSystemAddress, f as encodeModSystemAddress, g as encodeSystemAddress, h as getHandAuthoredRegionOrigin, r as resolveNamingRegionOrigin } from '../system-address-cyJaeZIS.js';
|
|
129
166
|
export { SystemAddressInput, toSystemAddress, tryToSystemAddress } from './system-address-input.js';
|
package/dist/astro/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{isPermitLockedSystemName,permitLockForSystemName}from"../chunk-CIULJH3G.js";export{PERMIT_LOCKED_SYSTEMS,permitLockedSystemForAddress,permitLockedSystemForName}from"../chunk-BMT3U46U.js";export{ProceduralSystem}from"../chunk-7TVFV3VO.js";export{CHANDRASEKHAR_LIMIT_SOLAR_MASSES,NEUTRON_STAR_MASS_DROP_OFF_SOLAR_MASSES,SOLAR_RADIUS,SPEED_OF_LIGHT,TOV_LIMIT_SOLAR_MASSES,absoluteBolometricMagnitude,assessMassStability,classifyNeutronStar,mainSequenceLifetime,schwarzschildRadius}from"../chunk-GBTCWNO6.js";export{boxelCodeToLetters,canonicalizeSystemName,formatSystemName,isProceduralSystemName,lettersToBoxelCode,parseSystemName}from"../chunk-7ATBEOVC.js";export{getHandAuthoredRegionOrigin,resolveNamingRegionOrigin}from"../chunk-DWRNXUAX.js";export{PROCGEN_NEBULAE}from"../chunk-K7F6WC4T.js";export{REAL_NEBULAE}from"../chunk-HI7FCS3G.js"; export{getNebulaByName,nearestNebulae,nebulaeWithin}from"../chunk-L7CLUYZ6.js";export{PERMIT_LOCKED_REGIONS,isPermitLockedRegionName,permitLockedRegionForSystemName}from"../chunk-NLBUKXNV.js";export{classifyEccentricity,equatorialVelocity,orbitExtents,spinOrbitResonance}from"../chunk-ZZ376WHL.js";export{RING_NOMINAL_RADIUS_FRACTION,VISIBLE_RING_MAX_WIDTH,VISIBLE_RING_MIN_SURFACE_DENSITY,isInvisibleRing,ringDynamics,ringParticleDensity,ringRocheLimits,ringSurfaceDensity}from"../chunk-NEXDA73Y.js";export{GRAVITATIONAL_CONSTANT,KG_PER_EARTH_MASS,KG_PER_SOLAR_MASS,bodyMass,bulkDensity,hillRadius,primaryAngularDiameter,rocheLimits,rocheLimitsForDensity}from"../chunk-TMXKC6JL.js"; export{BASE_BOXEL_LY,MASS_CODE_COUNT,boxelEdgeLy,massCodeToSizeClass,sizeClassToMassCode}from"../chunk-POZTXBSN.js";export{SECTOR_INTERNAL_SIZE,absoluteBoxelToBoxelCode,boxelCodeToAbsoluteBoxel,boxelInternalSize,decodeModSystemAddress,decodeSystemAddress,encodeModSystemAddress,encodeSystemAddress}from"../chunk-DI5RXSJR.js";export{toSystemAddress,tryToSystemAddress}from"../chunk-NEEFT7WH.js";export{CODEX_REGIONS,getCodexRegion,getCodexRegionByName}from"../chunk-ADLVPKUV.js";export{GALAXY_ORIGIN,SECTOR_EDGE_LY,sectorGridPositionFromGalacticPosition,sectorNameFromGalacticPosition}from"../chunk-4QYTVSNR.js";export{canonicalizeSectorName,sectorGridPositionFromName,sectorNameFromGridPosition}from"../chunk-H47K3UWG.js"; export{HAND_AUTHORED_REGIONS,findHandAuthoredRegionAt}from"../chunk-AVZI6VKA.js"; //# sourceMappingURL=index.js.map
|
package/dist/astro/nebulae.d.ts
CHANGED
|
@@ -16,10 +16,10 @@ import { G as GalacticPosition } from '../galactic-position-shLkm4Qg.js';
|
|
|
16
16
|
*
|
|
17
17
|
* | Module | Export | Entries | Minified | Gzipped |
|
|
18
18
|
* | --- | --- | --- | --- | --- |
|
|
19
|
-
* | `./nebulae-real` | `REAL_NEBULAE` | 180 | 16
|
|
20
|
-
* | `./nebulae-procgen` | `PROCGEN_NEBULAE` | 166 | 16
|
|
21
|
-
* | `./nebulae-planetary` | `PLANETARY_NEBULAE` | 5489 | 399
|
|
22
|
-
* | `./nebulae-all` | `ALL_NEBULAE` | 5835 |
|
|
19
|
+
* | `./nebulae-real` | `REAL_NEBULAE` | 180 | ~16 KiB | ~5 KiB |
|
|
20
|
+
* | `./nebulae-procgen` | `PROCGEN_NEBULAE` | 166 | ~16 KiB | ~6 KiB |
|
|
21
|
+
* | `./nebulae-planetary` | `PLANETARY_NEBULAE` | 5489 | ~399 KiB | ~116 KiB |
|
|
22
|
+
* | `./nebulae-all` | `ALL_NEBULAE` | 5835 | ~432 KiB | ~127 KiB |
|
|
23
23
|
*
|
|
24
24
|
* Importing a query function from here costs nothing but the function: pass in
|
|
25
25
|
* whichever catalogue you imported. The catalogue argument is **required** — 94% of
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ProceduralSystem}from"../chunk-
|
|
1
|
+
export{ProceduralSystem}from"../chunk-7TVFV3VO.js"; //# sourceMappingURL=procedural-system.js.map
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { b as BodyProperties } from '../body-scan-CEUYjCfH.js';
|
|
2
|
+
import './system-address-input.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* What a scanned star's own numbers imply: how long it should live, how bright it really
|
|
6
|
+
* is, how small it would have to be to become a black hole, what kind of pulsar it is, and
|
|
7
|
+
* when its mass says it should not exist at all.
|
|
8
|
+
*
|
|
9
|
+
* Every function takes {@link BodyProperties} — a journal `Scan` line as it comes, or any
|
|
10
|
+
* record carrying the same fields — and reads the star's own fields only. Masses are solar
|
|
11
|
+
* masses, radii metres, periods seconds, ages millions of years: the journal's units
|
|
12
|
+
* throughout. The type itself is exported from `../astro`, alongside `BodyScanEvent`.
|
|
13
|
+
*
|
|
14
|
+
* **These are order-of-magnitude astrophysics, and the game is procedural.** A relation
|
|
15
|
+
* like the main-sequence lifetime is a textbook scaling, not a measurement, and Elite
|
|
16
|
+
* Dangerous generates stars that sometimes sit outside what the relation allows. That is
|
|
17
|
+
* the point of {@link assessMassStability}: it names an implausibility, never a fact about
|
|
18
|
+
* a real star.
|
|
19
|
+
*
|
|
20
|
+
* The maths is ported from the Canonn Research Group's
|
|
21
|
+
* [canonn-signals](https://github.com/canonn-science/canonn-signals); see
|
|
22
|
+
* [ATTRIBUTIONS.md](https://github.com/DarkSession/Elite-Dangerous-Almanac/blob/main/ATTRIBUTIONS.md).
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { mainSequenceLifetime } from '@elite-dangerous-almanac/core/astro/star-physics';
|
|
27
|
+
*
|
|
28
|
+
* // The Sun: about ten billion years on the main sequence.
|
|
29
|
+
* mainSequenceLifetime({ StellarMass: 1 }); // -> 10000
|
|
30
|
+
*
|
|
31
|
+
* // Twice the mass burns through it more than five times faster.
|
|
32
|
+
* mainSequenceLifetime({ StellarMass: 2 }); // -> 1767.7…
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @packageDocumentation
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
/** Speed of light in vacuum, in m/s. */
|
|
39
|
+
declare const SPEED_OF_LIGHT = 299792458;
|
|
40
|
+
/** Metres in one nominal solar radius, for the magnitude relation below. */
|
|
41
|
+
declare const SOLAR_RADIUS = 695700000;
|
|
42
|
+
/**
|
|
43
|
+
* The Chandrasekhar limit, in solar masses — the most mass electron degeneracy pressure
|
|
44
|
+
* can hold up, and so the heaviest a white dwarf can be.
|
|
45
|
+
*/
|
|
46
|
+
declare const CHANDRASEKHAR_LIMIT_SOLAR_MASSES = 1.44;
|
|
47
|
+
/**
|
|
48
|
+
* The Tolman–Oppenheimer–Volkoff limit, in solar masses — the theoretical ceiling on a
|
|
49
|
+
* neutron star, as constrained by the GW170817 neutron-star merger.
|
|
50
|
+
*/
|
|
51
|
+
declare const TOV_LIMIT_SOLAR_MASSES = 2.17;
|
|
52
|
+
/**
|
|
53
|
+
* The mass, in solar masses, past which neutron stars become rare **in Elite Dangerous**.
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* A figure from the game's own generated galaxy rather than from astronomy, and not a
|
|
57
|
+
* ceiling: the game does produce neutron stars above it. It is where the observed
|
|
58
|
+
* population drops off sharply, so a star past it is unusual even by the game's standards.
|
|
59
|
+
*/
|
|
60
|
+
declare const NEUTRON_STAR_MASS_DROP_OFF_SOLAR_MASSES = 2.51;
|
|
61
|
+
/**
|
|
62
|
+
* Which mass threshold a star has passed: one of the two degeneracy-pressure ceilings, or
|
|
63
|
+
* the mass past which the game rarely generates neutron stars.
|
|
64
|
+
*/
|
|
65
|
+
type MassStabilityLimit = 'chandrasekhar' | 'tolman-oppenheimer-volkoff' | 'neutron-star-mass-drop-off';
|
|
66
|
+
/** A star whose mass exceeds a limit its kind should not be able to exceed. */
|
|
67
|
+
interface MassStabilityAssessment {
|
|
68
|
+
/** The limit that was passed. */
|
|
69
|
+
readonly limit: MassStabilityLimit;
|
|
70
|
+
/** That limit's value, in solar masses. */
|
|
71
|
+
readonly limitSolarMasses: number;
|
|
72
|
+
/**
|
|
73
|
+
* How far outside expectation the star is: `warning` for a neutron star past the
|
|
74
|
+
* theoretical TOV limit but still in the mass range the game generates freely, `danger`
|
|
75
|
+
* for a white dwarf past the Chandrasekhar limit, which should not be a white dwarf at
|
|
76
|
+
* all, or a neutron star past the mass where the game's own population drops off.
|
|
77
|
+
*/
|
|
78
|
+
readonly severity: 'warning' | 'danger';
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* How a neutron star's spin classes it, in the scheme the Canonn tooling uses.
|
|
82
|
+
*
|
|
83
|
+
* @remarks
|
|
84
|
+
* The bands are cut at 10 ms, 5 s, 30 s and 1 hour of rotation period. `anomalous-mass-`
|
|
85
|
+
* marks a star above {@link TOV_LIMIT_SOLAR_MASSES}, and the two ultra-long-period bands
|
|
86
|
+
* are split by absolute magnitude rather than mass: brighter than 10 reads as a magnetar.
|
|
87
|
+
*/
|
|
88
|
+
type NeutronStarClass = 'millisecond-pulsar' | 'hyper-massive-millisecond-pulsar' | 'standard-pulsar' | 'anomalous-mass-pulsar' | 'slow-period-pulsar' | 'anomalous-mass-slow-period-pulsar' | 'ultra-long-period-magnetar' | 'ultra-long-period-pulsar' | 'anomalous-slow-rotator';
|
|
89
|
+
/**
|
|
90
|
+
* How long a star of a given mass spends on the main sequence, in millions of years.
|
|
91
|
+
*
|
|
92
|
+
* @remarks
|
|
93
|
+
* The standard scaling `t ≈ 10 Gyr · (M/M☉)^−2.5`, anchored so that the Sun reads 10 Gyr.
|
|
94
|
+
* Mass is what sets a star's whole life: doubling it cuts the lifetime more than fivefold,
|
|
95
|
+
* because the star burns its larger fuel supply very much faster.
|
|
96
|
+
*
|
|
97
|
+
* Compare it against {@link BodyProperties.Age_MY | Age_MY} to judge a generated star. An
|
|
98
|
+
* ordinary star older than its own main-sequence lifetime should already have left it, and
|
|
99
|
+
* a giant younger than one should not yet have arrived.
|
|
100
|
+
*
|
|
101
|
+
* @param body - The star. Needs {@link BodyProperties.StellarMass | StellarMass}.
|
|
102
|
+
* @returns The lifetime in millions of years, or `null` when no usable stellar mass is
|
|
103
|
+
* written — which is the case for every planet, and for a scan that resolved nothing.
|
|
104
|
+
* @throws {TypeError} If `body` is not an object.
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* import { mainSequenceLifetime } from '@elite-dangerous-almanac/core/astro/star-physics';
|
|
108
|
+
*
|
|
109
|
+
* mainSequenceLifetime({ StellarMass: 1 }); // -> 10000
|
|
110
|
+
*
|
|
111
|
+
* // A heavy blue star lives a few million years.
|
|
112
|
+
* mainSequenceLifetime({ StellarMass: 20 }); // -> 5.5…
|
|
113
|
+
*
|
|
114
|
+
* // A red dwarf outlives the universe many times over.
|
|
115
|
+
* mainSequenceLifetime({ StellarMass: 0.2 }); // -> 559016.9…
|
|
116
|
+
*
|
|
117
|
+
* mainSequenceLifetime({ MassEM: 1 }); // -> null
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
declare function mainSequenceLifetime(body: BodyProperties): number | null;
|
|
121
|
+
/**
|
|
122
|
+
* A star's absolute bolometric magnitude, worked out from how big and how hot it is.
|
|
123
|
+
*
|
|
124
|
+
* @remarks
|
|
125
|
+
* Stefan–Boltzmann gives the luminosity — `L/L☉ = (R/R☉)² · (T/T☉)⁴` — and the magnitude
|
|
126
|
+
* follows as `M☉ − 2.5 log₁₀(L/L☉)`.
|
|
127
|
+
*
|
|
128
|
+
* The reason to compute one when the scan usually reports
|
|
129
|
+
* {@link BodyProperties.AbsoluteMagnitude | AbsoluteMagnitude} directly is that some stars
|
|
130
|
+
* carry no magnitude at all: a white dwarf is written with a radius and a temperature and
|
|
131
|
+
* nothing else to place it by. The two figures are not interchangeable — this is
|
|
132
|
+
* bolometric, over all wavelengths, while a reported magnitude is closer to visual — so
|
|
133
|
+
* expect them to differ by a magnitude or so on a very hot or very cool star, and use this
|
|
134
|
+
* as the fallback rather than the correction.
|
|
135
|
+
*
|
|
136
|
+
* @param body - The star. Needs {@link BodyProperties.Radius | Radius} in metres and
|
|
137
|
+
* {@link BodyProperties.SurfaceTemperature | SurfaceTemperature} in kelvin.
|
|
138
|
+
* @returns The absolute bolometric magnitude — smaller is brighter, and a luminous star is
|
|
139
|
+
* negative — or `null` when either field is missing.
|
|
140
|
+
* @throws {TypeError} If `body` is not an object.
|
|
141
|
+
* @example
|
|
142
|
+
* ```ts
|
|
143
|
+
* import { absoluteBolometricMagnitude } from '@elite-dangerous-almanac/core/astro/star-physics';
|
|
144
|
+
*
|
|
145
|
+
* // A star the size and temperature of the Sun is the Sun's magnitude.
|
|
146
|
+
* absoluteBolometricMagnitude({ Radius: 695_700_000, SurfaceTemperature: 5772 }); // -> 4.74
|
|
147
|
+
*
|
|
148
|
+
* // An Earth-sized white dwarf at 15 000 K: faint despite being fiercely hot.
|
|
149
|
+
* absoluteBolometricMagnitude({ Radius: 6_371_000, SurfaceTemperature: 15_000 }); // -> 10.78…
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
declare function absoluteBolometricMagnitude(body: BodyProperties): number | null;
|
|
153
|
+
/**
|
|
154
|
+
* The Schwarzschild radius for a body's mass, in metres.
|
|
155
|
+
*
|
|
156
|
+
* @remarks
|
|
157
|
+
* `r_s = 2GM/c²`. For a black hole this is the event horizon itself, and the game reports
|
|
158
|
+
* no radius for one; for anything else it is how small that mass would have to be squeezed
|
|
159
|
+
* to become one, which is what makes it worth comparing against a neutron star's actual
|
|
160
|
+
* radius — the ratio is how close the star sits to collapse.
|
|
161
|
+
*
|
|
162
|
+
* @param body - The body. Needs a mass — see `bodyMass` in `./body-physics`. Stars are the
|
|
163
|
+
* bodies this is asked about, but the relation is general and a planet's mass answers too.
|
|
164
|
+
* @returns The radius in metres, or `null` when no usable mass is written.
|
|
165
|
+
* @throws {TypeError} If `body` is not an object.
|
|
166
|
+
* @example
|
|
167
|
+
* ```ts
|
|
168
|
+
* import { schwarzschildRadius } from '@elite-dangerous-almanac/core/astro/star-physics';
|
|
169
|
+
*
|
|
170
|
+
* // The Sun would have to fit inside about 3 km.
|
|
171
|
+
* schwarzschildRadius({ StellarMass: 1 }); // -> 2954.1…
|
|
172
|
+
*
|
|
173
|
+
* // A neutron star of two solar masses sits a few times outside its own horizon.
|
|
174
|
+
* schwarzschildRadius({ StellarMass: 2 }); // -> 5908.2…
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
declare function schwarzschildRadius(body: BodyProperties): number | null;
|
|
178
|
+
/**
|
|
179
|
+
* Whether a degenerate star's mass exceeds what its kind can hold up.
|
|
180
|
+
*
|
|
181
|
+
* @remarks
|
|
182
|
+
* A white dwarf is supported by electron degeneracy pressure and a neutron star by neutron
|
|
183
|
+
* degeneracy pressure, and each gives out at a mass: past the Chandrasekhar limit a white
|
|
184
|
+
* dwarf should collapse or detonate, past the TOV limit a neutron star should become a
|
|
185
|
+
* black hole. Elite Dangerous generates stars that sometimes sit beyond both, and this is
|
|
186
|
+
* what says so.
|
|
187
|
+
*
|
|
188
|
+
* The kind is read from {@link BodyProperties.StarType | StarType}, which the journal
|
|
189
|
+
* writes as `"N"` for a neutron star and `"D"`-prefixed for the white-dwarf classes
|
|
190
|
+
* (`"D"`, `"DA"`, `"DAB"`, …). Black holes are outside this: `"H"` has already collapsed,
|
|
191
|
+
* so no ceiling is left for it to breach.
|
|
192
|
+
*
|
|
193
|
+
* @param body - The star. Needs {@link BodyProperties.StarType | StarType} and
|
|
194
|
+
* {@link BodyProperties.StellarMass | StellarMass}.
|
|
195
|
+
* @returns The limit passed and how far outside expectation that puts the star, or `null`
|
|
196
|
+
* when the star is within its limits, is not a degenerate object, or carries no mass.
|
|
197
|
+
* @throws {TypeError} If `body` is not an object.
|
|
198
|
+
* @example
|
|
199
|
+
* ```ts
|
|
200
|
+
* import { assessMassStability } from '@elite-dangerous-almanac/core/astro/star-physics';
|
|
201
|
+
*
|
|
202
|
+
* // An ordinary neutron star is unremarkable.
|
|
203
|
+
* assessMassStability({ StarType: 'N', StellarMass: 1.8 }); // -> null
|
|
204
|
+
*
|
|
205
|
+
* // Past the theoretical ceiling, but in the range the game generates freely.
|
|
206
|
+
* assessMassStability({ StarType: 'N', StellarMass: 2.3 })?.severity; // -> 'warning'
|
|
207
|
+
*
|
|
208
|
+
* // A white dwarf this heavy should not be a white dwarf.
|
|
209
|
+
* assessMassStability({ StarType: 'DA', StellarMass: 1.6 })?.limit; // -> 'chandrasekhar'
|
|
210
|
+
* ```
|
|
211
|
+
*/
|
|
212
|
+
declare function assessMassStability(body: BodyProperties): MassStabilityAssessment | null;
|
|
213
|
+
/**
|
|
214
|
+
* What kind of pulsar a neutron star's spin makes it.
|
|
215
|
+
*
|
|
216
|
+
* @remarks
|
|
217
|
+
* A neutron star is classed by how fast it turns, from a millisecond pulsar whipping round
|
|
218
|
+
* a hundred times a second to a slow rotator barely turning at all. Rotation is a
|
|
219
|
+
* magnitude here: the journal writes retrograde rotation as a negative
|
|
220
|
+
* {@link BodyProperties.RotationPeriod | RotationPeriod}, and which way a pulsar spins does
|
|
221
|
+
* not change what it is.
|
|
222
|
+
*
|
|
223
|
+
* The scheme is Canonn's, not astronomy's — it exists to give the game's generated neutron
|
|
224
|
+
* stars useful names, and the `anomalous-mass-` bands mark stars the game produced above
|
|
225
|
+
* the theoretical mass ceiling.
|
|
226
|
+
*
|
|
227
|
+
* @param body - The star. Needs {@link BodyProperties.StellarMass | StellarMass},
|
|
228
|
+
* {@link BodyProperties.RotationPeriod | RotationPeriod} and
|
|
229
|
+
* {@link BodyProperties.AbsoluteMagnitude | AbsoluteMagnitude} — the magnitude only to
|
|
230
|
+
* separate a magnetar from a pulsar at the slow end, but it is required throughout so the
|
|
231
|
+
* answer never depends on which band the star happened to land in.
|
|
232
|
+
* @returns The class, or `null` when any of the three is missing. This does not check
|
|
233
|
+
* {@link BodyProperties.StarType | StarType}: hand it a neutron star, since the bands mean
|
|
234
|
+
* nothing for anything else.
|
|
235
|
+
* @throws {TypeError} If `body` is not an object.
|
|
236
|
+
* @example
|
|
237
|
+
* ```ts
|
|
238
|
+
* import { classifyNeutronStar } from '@elite-dangerous-almanac/core/astro/star-physics';
|
|
239
|
+
*
|
|
240
|
+
* // Twenty turns a second.
|
|
241
|
+
* classifyNeutronStar({ StellarMass: 1.5, RotationPeriod: 0.05, AbsoluteMagnitude: 12 });
|
|
242
|
+
* // -> 'standard-pulsar'
|
|
243
|
+
*
|
|
244
|
+
* // The same spin, but heavier than the TOV limit allows.
|
|
245
|
+
* classifyNeutronStar({ StellarMass: 2.4, RotationPeriod: 0.05, AbsoluteMagnitude: 12 });
|
|
246
|
+
* // -> 'anomalous-mass-pulsar'
|
|
247
|
+
*
|
|
248
|
+
* // Half an hour per turn, and bright with it.
|
|
249
|
+
* classifyNeutronStar({ StellarMass: 1.5, RotationPeriod: 1800, AbsoluteMagnitude: 8 });
|
|
250
|
+
* // -> 'ultra-long-period-magnetar'
|
|
251
|
+
* ```
|
|
252
|
+
*/
|
|
253
|
+
declare function classifyNeutronStar(body: BodyProperties): NeutronStarClass | null;
|
|
254
|
+
|
|
255
|
+
export { CHANDRASEKHAR_LIMIT_SOLAR_MASSES, type MassStabilityAssessment, type MassStabilityLimit, NEUTRON_STAR_MASS_DROP_OFF_SOLAR_MASSES, type NeutronStarClass, SOLAR_RADIUS, SPEED_OF_LIGHT, TOV_LIMIT_SOLAR_MASSES, absoluteBolometricMagnitude, assessMassStability, classifyNeutronStar, mainSequenceLifetime, schwarzschildRadius };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{CHANDRASEKHAR_LIMIT_SOLAR_MASSES,NEUTRON_STAR_MASS_DROP_OFF_SOLAR_MASSES,SOLAR_RADIUS,SPEED_OF_LIGHT,TOV_LIMIT_SOLAR_MASSES,absoluteBolometricMagnitude,assessMassStability,classifyNeutronStar,mainSequenceLifetime,schwarzschildRadius}from"../chunk-GBTCWNO6.js"; //# sourceMappingURL=star-physics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"O"}
|