astro.Function.classifyNeutronStar - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki

@elite-dangerous-almanac/core / astro / classifyNeutronStar

Function: classifyNeutronStar()

classifyNeutronStar(body): NeutronStarClass | null

Defined in: src/astro/star-physics.ts:350

What kind of pulsar a neutron star's spin makes it.

Parameters

body

BodyProperties

The star. Needs StellarMass, RotationPeriod and AbsoluteMagnitude — the magnitude only to separate a magnetar from a pulsar at the slow end, but it is required throughout so the answer never depends on which band the star happened to land in.

Returns

NeutronStarClass | null

The class, or null when any of the three is missing. This does not check StarType: hand it a neutron star, since the bands mean nothing for anything else.

Remarks

A neutron star is classed by how fast it turns, from a millisecond pulsar whipping round a hundred times a second to a slow rotator barely turning at all. Rotation is a magnitude here: the journal writes retrograde rotation as a negative RotationPeriod, and which way a pulsar spins does not change what it is.

The scheme is Canonn's, not astronomy's — it exists to give the game's generated neutron stars useful names, and the anomalous-mass- bands mark stars the game produced above the theoretical mass ceiling.

Throws

If body is not an object.

Example

import { classifyNeutronStar } from '@elite-dangerous-almanac/core/astro/star-physics';

// Twenty turns a second.
classifyNeutronStar({ StellarMass: 1.5, RotationPeriod: 0.05, AbsoluteMagnitude: 12 });
// -> 'standard-pulsar'

// The same spin, but heavier than the TOV limit allows.
classifyNeutronStar({ StellarMass: 2.4, RotationPeriod: 0.05, AbsoluteMagnitude: 12 });
// -> 'anomalous-mass-pulsar'

// Half an hour per turn, and bright with it.
classifyNeutronStar({ StellarMass: 1.5, RotationPeriod: 1800, AbsoluteMagnitude: 8 });
// -> 'ultra-long-period-magnetar'
⚠️ **GitHub.com Fallback** ⚠️