-
Notifications
You must be signed in to change notification settings - Fork 0
astro.Interface.BodyProperties
@elite-dangerous-almanac/core / astro / BodyProperties
Defined in: src/astro/body-scan.ts:152
The physical body a scan describes — everything a calculation reads, and nothing that names the journal line it arrived on.
BodyScanEvent extends this with the journal's own bookkeeping — event,
timestamp, ScanType, BodyName, BodyID, StarSystem, SystemAddress,
DistanceFromArrivalLS, Parents and the discovery flags. None of that is physics, so
none of it is required here: every field below is optional, and a body assembled from a
database row, an EDSM or Spansh record, or a literal in a test is as good an input as a
captured line. A BodyScanEvent is a BodyProperties, so a parsed journal line passes
to every calculation unchanged.
Each calculation states which fields it needs and returns null when one is missing —
see ./body-physics, ./body-orbit, ./body-rings and ./star-physics.
Units are the journal's throughout: metres, seconds, kelvin, pascals, Earth masses for a planet and solar masses for a star. Angles are degrees except AxialTilt, which is radians.
Only the fields a calculation reads need be present.
import type { BodyProperties } from '@elite-dangerous-almanac/core/astro';
import { bulkDensity } from '@elite-dangerous-almanac/core/astro/body-physics';
const earthLike: BodyProperties = { MassEM: 1, Radius: 6_371_000 };
bulkDensity(earthLike); // -> 5513.2…
readonlyoptionalAbsoluteMagnitude?:number
Defined in: src/astro/body-scan.ts:192
The star's absolute magnitude — smaller is brighter, and it can be negative.
readonlyoptionalAge_MY?:number
Defined in: src/astro/body-scan.ts:194
The star's age, in millions of years.
readonlyoptionalAscendingNode?:number
Defined in: src/astro/body-scan.ts:165
Longitude of the ascending node, in degrees.
readonlyoptionalAtmosphere?:string
Defined in: src/astro/body-scan.ts:214
The atmosphere as the game describes it in full, e.g.
"thin sulphur dioxide atmosphere". "" when the body has none.
readonlyoptionalAtmosphereComposition?: readonlyAtmosphereComponent[]
Defined in: src/astro/body-scan.ts:226
What the atmosphere is made of, by percentage.
readonlyoptionalAtmosphereType?:string
Defined in: src/astro/body-scan.ts:224
The atmosphere's dominant gas as a bare token, e.g. "Nitrogen",
"SulphurDioxide", "None".
The token drops the density and temperature that Atmosphere
spells out, so "thin nitrogen atmosphere" and "hot thick nitrogen atmosphere"
share one AtmosphereType. Match on this and read the other for the qualifiers.
readonlyoptionalAxialTilt?:number
Defined in: src/astro/body-scan.ts:176
Axial tilt, in radians — the one angle here that is not degrees.
readonlyoptionalComposition?:BodyComposition
Defined in: src/astro/body-scan.ts:247
The body's bulk composition, when the scan resolved it.
readonlyoptionalEccentricity?:number
Defined in: src/astro/body-scan.ts:157
Orbital eccentricity, 0 for a circular orbit and approaching 1 for a long ellipse.
readonlyoptionalLandable?:boolean
Defined in: src/astro/body-scan.ts:245
Whether a ship can land on the body.
readonlyoptionalLuminosity?:string
Defined in: src/astro/body-scan.ts:196
The star's luminosity class, e.g. "V", "Va", "VI".
readonlyoptionalMassEM?:number
Defined in: src/astro/body-scan.ts:233
The body's mass, in Earth masses.
readonlyoptionalMaterials?: readonlySurfaceMaterial[]
Defined in: src/astro/body-scan.ts:255
The materials collectable at the surface, by percentage.
Written for a landable body. Each Name is a journal material symbol that
getMaterialBySymbol (../materials) resolves.
readonlyoptionalMeanAnomaly?:number
Defined in: src/astro/body-scan.ts:167
Mean anomaly at the moment the body was observed, in degrees.
readonlyoptionalOrbitalInclination?:number
Defined in: src/astro/body-scan.ts:159
Orbital inclination, in degrees.
readonlyoptionalOrbitalPeriod?:number
Defined in: src/astro/body-scan.ts:163
Time to complete one orbit, in seconds.
readonlyoptionalPeriapsis?:number
Defined in: src/astro/body-scan.ts:161
Argument of periapsis, in degrees.
readonlyoptionalPlanetClass?:string
Defined in: src/astro/body-scan.ts:204
The body's class, e.g. "High metal content body", "Icy body",
"Earthlike body", "Water world", "Sudarsky class I gas giant". Present only
on a planet's or moon's line.
readonlyoptionalRadius?:number
Defined in: src/astro/body-scan.ts:261
The body's radius, in metres — for a star as much as for a planet.
readonlyoptionalReserveLevel?:string
Defined in: src/astro/body-scan.ts:275
How rich the body's rings are, e.g. "PristineResources", "MajorResources",
"CommonResources", "LowResources", "DepletedResources" — the game's reserve
levels, each suffixed Resources.
Written only when the body has rings, and it describes those rings rather than the body itself.
readonlyoptionalRings?: readonlyBodyRing[]
Defined in: src/astro/body-scan.ts:265
The body's rings and belts, absent when it has none.
readonlyoptionalRotationPeriod?:number
Defined in: src/astro/body-scan.ts:172
Time to complete one rotation, in seconds. Negative when the body rotates retrograde.
readonlyoptionalSemiMajorAxis?:number
Defined in: src/astro/body-scan.ts:155
Semi-major axis of the body's orbit, in metres.
readonlyoptionalStarType?:string
Defined in: src/astro/body-scan.ts:186
The star's spectral class, e.g. "G", "M", "TTS" (T Tauri), "N" (neutron
star), "H" (black hole). Present only on a star's line, and the surest way to
tell one.
readonlyoptionalStellarMass?:number
Defined in: src/astro/body-scan.ts:190
The star's mass, in solar masses.
readonlyoptionalSubclass?:number
Defined in: src/astro/body-scan.ts:188
The spectral subclass, 0–9, hotter at 0.
readonlyoptionalSurfaceGravity?:number
Defined in: src/astro/body-scan.ts:238
Surface gravity, in m/s² — divide by 9.80665 for the g figure the game's
own UI shows.
readonlyoptionalSurfacePressure?:number
Defined in: src/astro/body-scan.ts:243
Atmospheric pressure at the surface, in pascals — divide by 101325 for
atmospheres. 0 on an airless body.
readonlyoptionalSurfaceTemperature?:number
Defined in: src/astro/body-scan.ts:263
Surface — or, for a star, photospheric — temperature, in kelvin.
readonlyoptionalTerraformState?:string
Defined in: src/astro/body-scan.ts:209
Whether the body's terraforming potential has been realised: "" when there is
none, "Terraformable" when it is a candidate, "Terraformed" when it already is.
readonlyoptionalTidalLock?:boolean
Defined in: src/astro/body-scan.ts:178
Whether the body keeps one face to its parent.
readonlyoptionalVolcanism?:string
Defined in: src/astro/body-scan.ts:231
The body's volcanism as the game describes it, e.g.
"minor silicate vapour geysers volcanism". "" when the body has none.
Guides
astro
Classes (1)
ProceduralSystem
Properties
Accessors
Methods
Interfaces (28)
- AbsoluteBoxel
- AtmosphereComponent
- BodyComposition
- BodyParent
- BodyProperties
- BodyRing
- BodyScanEvent
- BoxelLetters
- CodexRegion
- CodexRegionBounds
- DecodedAddress
- GalacticPlanePosition
- GalacticPosition
- HandAuthoredRegion
- HandAuthoredSphere
- IsProceduralSystemNameOptions
- MassStabilityAssessment
- NamingRegionOrigin
- Nebula
- NebulaWithDistance
- OrbitExtents
- PermitLockedSystem
- RingDynamics
- RocheLimits
- SectorGridPosition
- SpinOrbitResonance
- SurfaceMaterial
- SystemNameParts
Type Aliases (6)
Variables (22)
- BASE_BOXEL_LY
- CHANDRASEKHAR_LIMIT_SOLAR_MASSES
- CODEX_REGIONS
- GALAXY_ORIGIN
- GRAVITATIONAL_CONSTANT
- HAND_AUTHORED_REGIONS
- KG_PER_EARTH_MASS
- KG_PER_SOLAR_MASS
- MASS_CODE_COUNT
- NEUTRON_STAR_MASS_DROP_OFF_SOLAR_MASSES
- PERMIT_LOCKED_REGIONS
- PERMIT_LOCKED_SYSTEMS
- PROCGEN_NEBULAE
- REAL_NEBULAE
- RING_NOMINAL_RADIUS_FRACTION
- SECTOR_EDGE_LY
- SECTOR_INTERNAL_SIZE
- SOLAR_RADIUS
- SPEED_OF_LIGHT
- TOV_LIMIT_SOLAR_MASSES
- VISIBLE_RING_MAX_WIDTH
- VISIBLE_RING_MIN_SURFACE_DENSITY
Functions (57)
- absoluteBolometricMagnitude
- absoluteBoxelToBoxelCode
- assessMassStability
- bodyMass
- boxelCodeToAbsoluteBoxel
- boxelCodeToLetters
- boxelEdgeLy
- boxelInternalSize
- bulkDensity
- canonicalizeSectorName
- canonicalizeSystemName
- classifyEccentricity
- classifyNeutronStar
- decodeModSystemAddress
- decodeSystemAddress
- encodeModSystemAddress
- encodeSystemAddress
- equatorialVelocity
- findHandAuthoredRegionAt
- formatSystemName
- getCodexRegion
- getCodexRegionByName
- getHandAuthoredRegionOrigin
- getNebulaByName
- hillRadius
- isInvisibleRing
- isPermitLockedRegionName
- isPermitLockedSystemName
- isProceduralSystemName
- lettersToBoxelCode
- mainSequenceLifetime
- massCodeToSizeClass
- nearestNebulae
- nebulaeWithin
- orbitExtents
- parseSystemName
- permitLockedRegionForSystemName
- permitLockedSystemForAddress
- permitLockedSystemForName
- permitLockForSystemName
- primaryAngularDiameter
- resolveNamingRegionOrigin
- ringDynamics
- ringParticleDensity
- ringRocheLimits
- ringSurfaceDensity
- rocheLimits
- rocheLimitsForDensity
- schwarzschildRadius
- sectorGridPositionFromGalacticPosition
- sectorGridPositionFromName
- sectorNameFromGalacticPosition
- sectorNameFromGridPosition
- sizeClassToMassCode
- spinOrbitResonance
- toSystemAddress
- tryToSystemAddress
commodities
Interfaces (1)
Type Aliases (1)
Variables (3)
Functions (3)
equipment
Interfaces (6)
Type Aliases (8)
Variables (3)
Functions (10)
Subpath modules (2)
i18n
Interfaces (1)
Type Aliases (1)
Functions (17)
- getBlueprintName
- getCalculationIssueMessage
- getEngineeringGroupName
- getExperimentalEffectDescription
- getExperimentalEffectName
- getLoadoutEditErrorMessage
- getLoadoutIssueMessage
- getLoadoutSlotName
- getMaterialName
- getMicroResourceName
- getModuleName
- getOutfittingFamilyName
- getPreEngineeredVariantName
- getShipManufacturer
- getShipName
- getSlefDiagnosticMessage
- getSlotRestrictionLabel
materials
Enumerations (2)
Interfaces (2)
Type Aliases (2)
Variables (9)
ships
Classes (3)
BuildMetrics
Methods
- armourMetrics()
- buildCost()
- buildMass()
- cellBanks()
- distributorMetricsResult()
- frameShiftDrive()
- frameShiftDriveMassFactor()
- fuelPerJump()
- heatMetricsResult()
- jumpRange()
- jumpRangeSummary()
- ladenJumpRange()
- loadout()
- maxJumpRange()
- mobilityCapacitorMetricsResult()
- mobilityMetricsResult()
- powerBudget()
- shieldCapacitorMetricsResult()
- shieldMetricsResult()
- shieldRecoveryResult()
- standardLoadResult()
- thrusters()
- totalRange()
- weaponMetrics()
- weaponsCapacitorMetrics()
- of()
LoadoutEditError
Constructors
Properties
Methods
ShipLoadout
Accessors
- cargoCapacity
- fuelCapacity
- hullValue
- importOutcomes
- modulesValue
- rebuy
- shipIdent
- shipName
- shipSymbol
- sourcePurchase
- unladenMass
Methods
- applyBlueprint()
- availableBlueprints()
- availableExperimentalEffects()
- clearEngineering()
- completeEngineeringGrade()
- fittedModuleAt()
- fittedModules()
- modulesForSlot()
- removeModule()
- repairFixedMount()
- setExperimentalEffect()
- setModule()
- setModuleEnabled()
- setModulePriority()
- setPreEngineeredVariant()
- slots()
- toLoadoutEvent()
- toSlef()
- toSlefString()
- validation()
- default()
- empty()
- fromLoadout()
- fromSlef()
Interfaces (125)
- AmmunitionCapacity
- AmmunitionStats
- ApplyBlueprintOptions
- ArmourInput
- ArmourMetrics
- AvailableBlueprint
- Blueprint
- BlueprintFeature
- BlueprintGrade
- BlueprintModuleEngineering
- BuildCost
- BuildCredits
- BuildMass
- BuildSlotBase
- BuildWeaponMetrics
- BulkheadParams
- CalculationIssue
- CellBankInput
- CellBankMetrics
- CellBankSummary
- CoreBuildSlot
- CoreSlots
- DamageComponents
- DamageDistribution
- DamageResistanceParams
- DamageSplit
- DamageTypeValues
- DistributorCapacitorMetrics
- DistributorInput
- DistributorMetrics
- DistributorOptions
- DistributorPips
- EngineeringMaterial
- EngineeringModifier
- EngineeringNormalizationUnchanged
- EngineeringNormalizationUnsupported
- EngineeringNormalized
- EngineeringOptionGroup
- ExperimentalContribution
- ExperimentalEffect
- ExperimentalEffectUnchanged
- ExperimentalEffectUnsupported
- ExperimentalEffectUpdated
- FittedModule
- FittedWeaponMetrics
- FrameShiftDriveJumpStats
- FrameShiftDriveParams
- FuelCapacity
- GunsightPoint
- HardpointBuildSlot
- HardpointSlotSpec
- HeatInput
- HeatMetrics
- HeatState
- HeatWeapon
- HullReinforcementParams
- JumpOptions
- JumpRangeSummary
- LoadoutCalculationModule
- LoadoutEvent
- LoadoutExportOptions
- LoadoutIssue
- LoadoutMass
- LoadoutModule
- LoadoutValidation
- LoadoutValidationInput
- MassCurveStats
- MobilityCapacitorInput
- MobilityCapacitorMetrics
- MobilityCapacitorOptions
- MobilityInput
- MobilityMetrics
- ModuleLimitEntry
- ModuleLimitIncrease
- ModuleLimitUsage
- ModuleReinforcementParams
- OptionalBuildSlot
- OptionalSlotSpec
- OutfittingModule
- OutfittingModuleIdentity
- OutfittingModuleStats
- ParsedSlot
- PowerBand
- PowerBudget
- PowerConsumer
- PowerConsumerResult
- PowerDistributorStats
- PowerGenerationStats
- PreEngineeredModifier
- PreEngineeredVariant
- ProjectileRangeBoundaries
- ShieldBoosterParams
- ShieldCapacitorInput
- ShieldCapacitorMetrics
- ShieldCapacitorOptions
- ShieldGeneratorParams
- ShieldInput
- ShieldMetrics
- ShieldRecovery
- ShieldRecoveryInput
- ShieldRecoveryOptions
- ShieldRegenerationStats
- Ship
- ShipSlots
- SimpleBuildSlot
- SlefDiagnostic
- SlefEntry
- SlefExportOptions
- SlefHeader
- SlefInspection
- SlefStringifyOptions
- SourceModuleValue
- SourcePurchaseRecord
- StandardLoadInputs
- ThrusterCurveParams
- ThrusterParams
- TotalRangeDetails
- ValidationModule
- WeaponDamageStats
- WeaponMetrics
- WeaponsCapacitorInput
- WeaponsCapacitorMetrics
- WeaponsOptions
- WeaponStats
- WeaponTotals
Type Aliases (44)
- BlueprintGrades
- BuildSlot
- CalculationIssueReason
- CalculationResult
- CoreSlotType
- DamageResistances
- DamageType
- EngineeringGroupId
- EngineeringNormalizationCode
- EngineeringNormalizationResult
- ExperimentalEffectMutationCode
- ExperimentalEffectMutationResult
- FixedMountRepairResult
- GunsightOffset
- HardpointRestriction
- ImmovableReason
- LoadoutEditErrorCode
- LoadoutImportOutcome
- LoadoutIssueCode
- LoadoutIssueParam
- LoadoutIssueParams
- LoadoutSlot
- ModifierMethod
- ModuleCategory
- ModuleEngineering
- ModuleExclusionGroup
- ModuleFitConstraint
- ModuleGuidance
- ModuleLimitGroup
- ModuleMount
- ModuleRating
- ModuleSlot
- OptionalRestriction
- OutfittingFamilyId
- PreEngineeredAcquisition
- ShipGunsight
- ShipGunsightCatalogue
- Slef
- SlefConstraint
- SlefDiagnosticCode
- SlotKind
- SlotRestriction
- StandardLoad
- ThrusterLoad
Variables (10)
Functions (85)
- ammunitionCapacity
- armourMetrics
- armourPiercingFactor
- calculateCargoCapacity
- calculateFuelCapacity
- calculateModuleLimits
- calculateUnladenMass
- cellBankSummary
- combinedRateOfFire
- computeModifiers
- damageFalloff
- damagePerSecond
- distributorMetrics
- effectiveHitPoints
- effectiveWeaponThermalLoad
- energyPerSecond
- enumerateSlots
- equilibriumHeatLevel
- frameShiftDriveMassFactor
- fuelPerJump
- getBlueprint
- getBlueprintGrade
- getBlueprintsForModule
- getBulkheadsForShip
- getEngineeringGroup
- getExperimentalEffect
- getExperimentalsForBlueprint
- getExperimentalsForModule
- getLoadoutModifier
- getModuleBySymbol
- getModulesByName
- getPreEngineeredJournalModifiers
- getPreEngineeredModifiers
- getPreEngineeredStats
- getPreEngineeredVariants
- getShipByName
- getShipBySymbol
- getShipGunsight
- getShipSlots
- getSourceModuleValue
- hasFrameShiftDriveJumpStats
- hasMassCurveStats
- hasPowerDistributorStats
- hasPowerGenerationStats
- hasShieldRegenerationStats
- hasWeaponDamageStats
- heatLevelAtTime
- heatMetrics
- heatPerSecond
- identifyPreEngineeredVariant
- inspectSlef
- isPreEngineered
- mapDamageTypes
- mobilityCapacitorMetrics
- mobilityMetrics
- parseSlef
- parseSlotName
- powerBudget
- projectGunsight
- resolveBlueprintForModule
- secondsToHeatLevel
- shieldCapacitorMetrics
- shieldMassCurveMultiplier
- shieldMetrics
- shieldRecovery
- shieldStrength
- singleJumpRange
- sourcePurchaseFromLoadout
- splitDamage
- stackArmourResistance
- stackShieldResistance
- stringifySlef
- sumMaterials
- sumSourceModuleValues
- sumWeaponMetrics
- sustainedDamagePerSecond
- sustainedFireFactor
- systemsResistance
- thrusterMassCurveMultiplier
- toSlef
- totalRange
- unresolvedModifiers
- validateLoadout
- weaponMetrics
- weaponsCapacitorMetrics