Class SolarSystem
- Namespace
- NominalSystems.Universe
- Assembly
- NominalSystems.Universe.dll
[Nominal] Container class for spawning in all Universe models and simulation objects. This will handle the creation of the planets, environments and the epoch of the simulation.
public class SolarSystem : UniverseSystem
- Inheritance
-
SolarSystem
- Extension Methods
Constructors
SolarSystem()
Default Constructor for creating the Universe Subsystem
protected SolarSystem()
Fields
DefaultIntegrator
Defines the Integrator type that is defined by all new components, unless specified otherwise.
[Hidden]
public IntegratorType DefaultIntegrator
Field Value
In_SunStateMsg
The message that stores the state of the Sun in the simulation
public SpicePlanetStateMessage? In_SunStateMsg
Field Value
Out_EpochMsg
The message storing the current date of the simulation including the current simulated time.
public EpochMessage? Out_EpochMsg
Field Value
Out_SpaceWeatherDataMsg
The space weather message if it has been created by the NRLMSIS model
public SpaceWeatherDataMessage? Out_SpaceWeatherDataMsg
Field Value
Out_SpiceTimeMsg
A reference to the SPICE time message and the epoch and coordinate frames of the simulation.
public SpiceTimeMessage? Out_SpiceTimeMsg
Field Value
StarSphere
A reference to the Star Map object
[Hidden]
public StarSphere? StarSphere
Field Value
Properties
CoordinateFrame
The base coordinate frame used by the Universe system
public CoordinateFrameType CoordinateFrame { get; set; }
Property Value
CurrentDate
The current date of the simulation including the current simulated time
[ReadOnly]
public DateTime CurrentDate { get; }
Property Value
CurrentElapsed
The elapsed time since the simulation started.
[ReadOnly]
public TimeSpan CurrentElapsed { get; }
Property Value
CurrentSeconds
The current number of seconds the Simulation has been executed for.
[Unit(UnitType.SECOND)]
[ReadOnly]
public double CurrentSeconds { get; }
Property Value
Epoch
The starting Epoch of the simulation
public DateTime Epoch { get; set; }
Property Value
NumCelestialBodies
The number of celestial bodies that exist in the simulation.
[Unit(UnitType.NONE)]
[ReadOnly]
[Metadata(IsAdvanced = true)]
public int NumCelestialBodies { get; }
Property Value
ZeroBase
The zero base (what is set to 0,0,0) in SPICE coordinates
public string ZeroBase { get; set; }
Property Value
Methods
ContainsBody(string)
Checks if a gravity body exists in the current simulation.
public bool ContainsBody(string bodyName)
Parameters
bodyName
stringThe name of the body
Returns
- bool
A flag for if the body exists
CreateAlbedoPlanetAverage(string, double, int, int)
Creates a new Albedo configuration around a certain planet using the average albedo planet model.
public void CreateAlbedoPlanetAverage(string planet, double average = -1, int numLat = -1, int numLon = -1)
Parameters
planet
stringThe name of the planet to add the albedo to
average
double[-] The average albedo value between 0 and 1
numLat
intThe number of latitude divisions
numLon
intThe number of longitude divisions
CreateAlbedoPlanetLookup(string, string)
Creates a new Albedo configuration around a certain planet using the lookup data model that uses a valid file-path to load the data.
public bool CreateAlbedoPlanetLookup(string planet, string filePath)
Parameters
planet
stringThe name of the planet to add the albedo to
filePath
stringThe data path for the file
Returns
- bool
A success flag
CreateAtmosphereExponential(string, double, double, double, double, double)
Creates a new exponential atmosphere and attaches it to a planet in the Universe
public void CreateAtmosphereExponential(string planet, double baseDensity = 1.217, double scaleHeight = 8500, double localTemperature = 293, double minReach = -1, double maxReach = -1)
Parameters
planet
stringThe name of the planet to attach to
baseDensity
double[kg/m^3] Density of the atmosphere at h=0
scaleHeight
double[m] Exponential characteristic height
localTemperature
double[K] Local atmospheric temperature (constant)
minReach
double[m] Minimum planet-relative position needed for the environment to work
maxReach
double[m] Maximum distance at which the environment will be calculated
CreateAtmosphereNRLMSIS()
Creates the NRL-MSIS-E-90 Atmosphere around the Earth and attaches it to the planet in the Universe. The series of parameters provided are the solar flux and space weather indices.
public void CreateAtmosphereNRLMSIS()
CreateMagneticFieldCenteredDipole(string, double, double, double, double, double)
Creates a new centered dipole magnetic field and attaches it to the planet in the Universe
public void CreateMagneticFieldCenteredDipole(string planet, double G10 = -15463, double G11 = -1159, double H11 = 2908.5, double minReach = -1, double maxReach = -1)
Parameters
planet
stringThe name of the planet to attach to
G10
double[nT] The IGRF Coefficient g_1^0
G11
double[nT] The IGRF Coefficient g_1^1
H11
double[nT] The IGRF Coefficient h_1^1
minReach
double[m] Minimum planet-relative position needed for the environment to work
maxReach
double[m] Maximum distance at which the environment will be calculated
CreateMagneticFieldWMM(string)
Creates the World Magnetic Model (WMM) Magnetosphere around the Earth and connects up all the associated data with the right data.
public void CreateMagneticFieldWMM(string coefficientFile = "WMM.COF")
Parameters
coefficientFile
stringThe coefficients file
CreateSolarSystem()
Attempts to create every single valid body in the Solar System that can exist in the simulation.
public void CreateSolarSystem()
GetBody(string)
Attempts to find a celestial body if it exists. If it does not exists, it will create the celestial body from the name that is passed in.
public CelestialBody? GetBody(string name)
Parameters
name
stringThe name of the body to create or find
Returns
- CelestialBody
The Celestial Body reference
GetCelestialBodies()
Returns a list of all celestial bodies that exist in the simulation.
public CelestialBody[] GetCelestialBodies()
Returns
- CelestialBody[]
All gravity bodies
GetPlanetMessages()
Returns the list of all the planet messages that exist in the simulation. This will not include the sun in this array.
public SpicePlanetStateMessage[] GetPlanetMessages()
Returns
- SpicePlanetStateMessage[]
An array of planet messages
GetPropagatedGeodetics(Vector3, Vector3, string, double, double)
Returns an Vector3 array with the propagated geodetics.
public Vector3[] GetPropagatedGeodetics(Vector3 initialPosition, Vector3 initialVelocity, string planet, double time, double delta = 10)
Parameters
initialPosition
Vector3The initial position in meters
initialVelocity
Vector3The initial velocity in meters per second
planet
stringThe name of the planet.
time
doubleThe current time in seconds.
delta
doubleThe delta time in seconds.
Returns
- Vector3[]
IsLineOfSight(Vector3, Vector3)
Determines if one object is in line of sight of another object taking in account all of the positions of the planets and their radius.
public bool IsLineOfSight(Vector3 start, Vector3 end)
Parameters
Returns
- bool
A flag for if line of sight exists
OnBegin(double)
Called when the object is beginning ticking for the first time. This is when the simulation calls the very first tick and will run before the update call.
protected override void OnBegin(double time)
Parameters
time
double[s] Current time of the simulation before the tick
OnCreate()
Called when the object is created from the controller and has been attached to the parent object. By this point, it has been registered to the simulation and will run after the constructor.
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
RemoveAlbedo(string)
Attempts to remove an albedo from a planet if it currently does exist. This will ensure that it will not run if expected.
public void RemoveAlbedo(string planet)
Parameters
planet
stringThe name of the planet to remove from
RemoveAtmosphere(string)
Attempts to remove an atmosphere from a planet if it currently does exist. This will ensure that it will not run if expected.
public void RemoveAtmosphere(string planet)
Parameters
planet
stringThe name of the planet to remove from
RemoveMagneticField(string)
Attempts to remove a magnetic field from a planet if it currently does exist. This will ensure that it will not run if expected.
public void RemoveMagneticField(string planet)
Parameters
planet
stringThe name of the planet to remove from
RemoveSphericalHarmonics(string)
Removes the spherical harmonics from a planet if it currently does exist.
public void RemoveSphericalHarmonics(string planet)
Parameters
planet
stringThe name of the body to remove the harmonics from
SetCoordinateFrame(CoordinateFrameType)
Updates the coordinate frame of the simulation to a new coordinate, based on whether the frame is a zero base or not.
public void SetCoordinateFrame(CoordinateFrameType frame)
Parameters
frame
CoordinateFrameType[-] The new coordinate frame to set
SetEarthSpaceWeather(double, double, double)
Creates the space weather flags around earth and attaches to the NRLMSIS model if it already exists.
public void SetEarthSpaceWeather(double f107a, double f107, double aph)
Parameters
f107a
doubleThe 81 day average space weather index
f107
doubleThe daily space weather index
aph
doubleThe current geomagnetic values
SetEpoch(DateTime)
Sets the Epoch of the Simulation and adjusts the time based on the current seconds.
public void SetEpoch(DateTime epoch)
Parameters
epoch
DateTimeThe new epoch of the system
SetIntegratorType(IntegratorType)
Method to set the integrator type for all integrator objects that exists.
public void SetIntegratorType(IntegratorType type)
Parameters
type
IntegratorType[-] The integrator type
SetSphericalHarmonics(string, int, string)
Sets the Spherical Harmonics level based on the degree and the body being used. This will use some default values.
public bool SetSphericalHarmonics(string bodyName, int degree, string filePath = "GGM03S.txt")
Parameters
bodyName
stringThe name of the Body to load harmonics from
degree
intThe degree of the harmonics
filePath
stringThe name of the file to load the CBar and SBar into
Returns
- bool
A successful adding of the spherical harmonics
SetZeroBase(string)
Updates the state of the zero-base of the simulation origin based on where the simulation is currently located.
public void SetZeroBase(string zeroBase)
Parameters
zeroBase
stringThe new center of the simulation