Table of Contents

Class CelestialBody

Namespace
NominalSystems.Universe
Assembly
NominalSystems.Universe.dll

[Nominal] A celestial body is able to represent a planet, moon, or other celestial object. This will be able to reflect the state of the body from the SPICE kernels and can contribute to the gravitational forces in the simulation.


public class CelestialBody : UniverseObject
Inheritance
CelestialBody
Extension Methods

Constructors

CelestialBody()

Default constructor

protected CelestialBody()

Fields

AtmosphereType

Defines the current atmosphere type, if enabled

[ReadOnly]
[Metadata(IsAdvanced = true)]
public AtmosphereType AtmosphereType

Field Value

AtmosphereType

In_SpiceTimeMsg

A reference to the SPICE time message from the simulation that controls the time of the simulation and the state.

[Hidden]
public SpiceTimeMessage? In_SpiceTimeMsg

Field Value

SpiceTimeMessage

IsCentralBody

The central body flag will define if this object is the central origin of the simulation

[ReadOnly]
[Metadata(IsAdvanced = true)]
public bool IsCentralBody

Field Value

bool

IsSpherical

A flag whether the spherical model is being used for this celestial body. By default, planets are spherical but can be changed to use non-spherical models, such as the World Geodetic Model (WGS-84) standard for the Earth.

[ReadOnly]
[Metadata(IsAdvanced = true)]
public bool IsSpherical

Field Value

bool

MagneticFieldType

Defines the current magnetic field type, if enabled

public MagneticFieldType MagneticFieldType

Field Value

MagneticFieldType

Out_SpicePlanetStateMsg

The SPICE Planet information about the current state of the planet and the information about the planet.

public SpicePlanetStateMessage? Out_SpicePlanetStateMsg

Field Value

SpicePlanetStateMessage

Properties

Albedo

Defines the current albedo model that is attached to the body

[ReadOnly]
[Metadata(IsAdvanced = true)]
public AlbedoPlanetModel? Albedo { get; }

Property Value

AlbedoPlanetModel

AlbedoAverage

Average Albedo of the Body

[Unit(UnitType.NONE)]
[ReadOnly]
public double AlbedoAverage { get; }

Property Value

double

Atmosphere

Defines the current atmosphere model that is attached to the body

[ReadOnly]
[Metadata(IsAdvanced = true)]
public AtmospherePlanetModel? Atmosphere { get; }

Property Value

AtmospherePlanetModel

AxisInclination

Axial inclination, or tilt, of the body relative to the ecliptic

[Unit(UnitType.DEGREE)]
[ReadOnly]
public double AxisInclination { get; }

Property Value

double

AxisOmega

Angular velocity of the rotation of the body

[Unit(UnitType.RADIAN_PER_SECOND)]
[ReadOnly]
[Metadata(IsAdvanced = true)]
public double AxisOmega { get; }

Property Value

double

AxisPeriod

Axial period; the time it takes for the body to complete one rotation on its axis

[Unit(UnitType.HOUR)]
[ReadOnly]
public double AxisPeriod { get; }

Property Value

double

Density

Density of the body

[Unit(UnitType.KILOGRAM_PER_CUBIC_METRE)]
[ReadOnly]
public double Density { get; }

Property Value

double

Diameter

Equatorial Diameter of the Body

[Unit(UnitType.METRE)]
[ReadOnly]
public double Diameter { get; }

Property Value

double

IsBarycenter

A flag for whether the body uses the barycenter name (SPICE).

[Hidden]
public bool IsBarycenter { get; }

Property Value

bool

J2

The measure of the gravitational effect of a planet due to its obliqueness.

[Unit(UnitType.NONE)]
[ReadOnly]
[Metadata(IsAdvanced = true)]
public double J2 { get; }

Property Value

double

J2000Rotation

Orientation matrix of planet-fixed relative to inertial frame. This is the rotation matrix that can be used to convert between the two coordinate systems. This is the 'J20002PFix' matrix.

[Unit(UnitType.NONE)]
[ReadOnly]
[Metadata(IsAdvanced = true, ContainedIn = "Out_SpicePlanetStateMsg")]
public Matrix3 J2000Rotation { get; }

Property Value

Matrix3

J2000RotationDot

Derivative of the orientation matrix of planet-fixed relative to inertial. This is the 'J20002PFix_Dot' matrix.

[Unit(UnitType.NONE)]
[ReadOnly]
[Metadata(IsAdvanced = true, ContainedIn = "Out_SpicePlanetStateMsg")]
public Matrix3 J2000RotationDot { get; }

Property Value

Matrix3

MagneticField

Defines the current magnetic field model that is attached to the body

[ReadOnly]
[Metadata(IsAdvanced = true)]
public MagneticFieldPlanetModel? MagneticField { get; }

Property Value

MagneticFieldPlanetModel

Mass

The mass of the gravity body / planet

[Unit(UnitType.KILOGRAM)]
[ReadOnly]
public double Mass { get; }

Property Value

double

Mu

Gravitational Mu of the body

[Unit("Nm²/kg")]
[ReadOnly]
[Metadata(IsAdvanced = true)]
public double Mu { get; }

Property Value

double

OrbitEccentricity

Eccentricity of the orbit around the sun or parented body

[Unit(UnitType.NONE)]
[ReadOnly]
public double OrbitEccentricity { get; }

Property Value

double

OrbitInclination

Inclination of the orbit around the sun or parented body

[Unit(UnitType.DEGREE)]
[ReadOnly]
public double OrbitInclination { get; }

Property Value

double

OrbitPeriod

Period of the orbit around the sun or parented body

[Unit(UnitType.DAY)]
[ReadOnly]
public double OrbitPeriod { get; }

Property Value

double

OrbitSemiMajorAxis

Semi Major Axis of the orbit around the sun or parented body

[Unit(UnitType.METRE)]
[ReadOnly]
public double OrbitSemiMajorAxis { get; }

Property Value

double

PolarRadius

Polar Radius of the Body

[Unit(UnitType.METRE)]
[ReadOnly]
public double PolarRadius { get; }

Property Value

double

Radius

Equatorial Radius of the Body

[Unit(UnitType.METRE)]
[ReadOnly]
public double Radius { get; }

Property Value

double

SphericalHarmonics

Defines the current spherical harmonics model that is attached to the body

[ReadOnly]
[Metadata(IsAdvanced = true)]
public SphericalHarmonicsModel? SphericalHarmonics { get; }

Property Value

SphericalHarmonicsModel

SpiceName

The name of the object for the SPICE interface.

[Hidden]
public string SpiceName { get; }

Property Value

string

Velocity

The Inertial Velocity of the Body relative to the Central Body from SPICE

[Unit(UnitType.METRE_PER_SECOND)]
[ReadOnly]
[Metadata(ContainedIn = "Out_SpicePlanetStateMsg")]
public Vector3 Velocity { get; }

Property Value

Vector3

Methods

ComputeInertialGravity(Vector3, double)

Calculates the gravity from this body at some location.

public Vector3 ComputeInertialGravity(Vector3 inertialPosition, double step)

Parameters

inertialPosition Vector3

The inertial reference frame location of the object [m]

step double

The time difference in step for spherical harmonics [s]

Returns

Vector3

The gravitational force vector

ComputePotentialEnergy(Vector3)

Calculates the potential energy of the body at some location.

public double ComputePotentialEnergy(Vector3 inertialPosition)

Parameters

inertialPosition Vector3

[m] The inertial reference frame location of the object

Returns

double

[J] The gravitational energy

OnCreate()

Called when the 'Component' is created from the controller.

protected override void OnCreate()

OnLoad(double)

Called after all of the data has been loaded from a save state on this object. This enables any post-load operations to be performed and extra data to be loaded from the metadata.

protected override void OnLoad(double time)

Parameters

time double

[s] The current clock time of the simulation

OnUpdate(double, double)

Called when the object should update from the simulation tick. This will take in a time and a step, where the time is the time of the clock before updating the object.

protected override void OnUpdate(double time, double step)

Parameters

time double

[s] Current time of the simulation before the update

step double

[s] The time-step to update during this tick