simIncludeGravBody

class simIncludeGravBody.BodyData(identifier: str, planetName: str, displayName: str, modelDictionaryKey: str, mu: float, radEquator: float, spicePlanetFrame: str, radiusRatio: float = 1)[source]

Bases: object

A class that contains information about a body in the simulation.

Parameters
  • identifier (str) – The SPICE identifier of the body.

  • planetName (str) – The name that identifies the body within the simulation.

  • displayName (str) – The name for the body in the Vizard display.

  • modelDictionaryKey (str) – Vizard model key name.

  • mu (float) – Gravitational parameter in m^3/s^2.

  • radEquator (float) – Equatorial radius of the body in meters.

  • spicePlanetFrame (str) – The name of the SPICE frame (attitude provider).

  • radiusRatio (float, optional) – Used to compute ellipticity. It is provided for bodies in the basic Vizard body dictionary. Defaults to 1.

class simIncludeGravBody.WithGravField(*args, **kwargs)[source]

Bases: Protocol

class simIncludeGravBody.gravBodyFactory(bodyNames: Iterable[str] = [])[source]

Bases: object

Class to create gravitational bodies.

addBodiesTo(objectToAddTheBodies: Union[Basilisk.simulation.gravityEffector.GravityEffector, simIncludeGravBody.WithGravField])[source]

Can be called with a GravityEffector or an object that has a gravField variable to set the gravity bodies used in the object.

createBodies(*bodyNames: Union[str, Iterable[str]]) Dict[str, Basilisk.simulation.gravityEffector.GravBodyData][source]

A convenience function to create multiple typical solar system bodies.

Parameters

bodyNames (Union[str, Iterable[str]]) – Planet name strings. Each planet name must be a valid SPICE celestial body string.

Returns

A dictionary of gravity body objects held by the gravity factory.

Return type

Dict[str, gravityEffector.GravBodyData]

createBody(bodyData: Union[str, simIncludeGravBody.BodyData]) Basilisk.simulation.gravityEffector.GravBodyData[source]

Convenience function to create a body given its name.

Parameters

bodyData (Union[str, BodyData]) – A valid SPICE celestial body string or a BodyData class with the relevant data.

Returns

The body object with corresponding data.

Return type

gravityEffector.GravBodyData

createCustomGravObject(label: str, mu: float, displayName: Optional[str] = None, modelDictionaryKey: Optional[str] = None, radEquator: Optional[float] = None, radiusRatio: Optional[float] = None, planetFrame: Optional[str] = None) Basilisk.simulation.gravityEffector.GravBodyData[source]

Create a custom gravity body object.

Parameters
  • label (str) – Gravity body name

  • mu (float) – Gravity constant in m^3/s^2

  • displayName (Optional[str], optional) – Vizard celestial body name, if not provided then planetFrame becomes the Vizard name. Defaults to None.

  • modelDictionaryKey (Optional[str], optional) – Vizard model key name. If not set, then either the displayName or planetName is used to set the model. Defaults to None.

  • radEquator (Optional[float], optional) – Equatorial radius in meters. Defaults to None.

  • radiusRatio (Optional[float], optional) – Ratio of the polar radius to the equatorial radius. Defaults to None.

  • planetFrame (Optional[str], optional) – Name of the spice planet frame. Defaults to None.

Returns

The body object with the given data.

Return type

gravityEffector.GravBodyData

unloadSpiceKernels()[source]

Method to unload spice kernals at the end of a simulation.

simIncludeGravBody.loadGravFromFile(fileName: str, spherHarm: Basilisk.simulation.sphericalHarmonicsGravityModel.SphericalHarmonicsGravityModel, maxDeg: int = 2)[source]

Load the gravitational body spherical harmonics coefficients from a file.

Note that this function calls the gravityEffector function loadGravFromFile().

Parameters
  • fileName (str) – The full path to the specified data file.

  • spherHarm (gravityEffector.SphericalHarmonicsGravityModel) – The spherical harmonics container of the gravity body.

  • maxDeg (int, optional) – Maximum degree of spherical harmonics to load. Defaults to 2.

simIncludeGravBody.loadPolyFromFile(fileName: str, poly: Basilisk.simulation.polyhedralGravityModel.PolyhedralGravityModel)[source]

Load the gravitational body polyhedral coefficients from a file.

Parameters
  • fileName (str) – The full path to the specified data file.

  • poly (gravityEffector.PolyhedralGravityModel) – The polyhedarl gravity model container of the body.