boinor.plotting.orbit.plotter

A module containing different orbit related plotters.

Classes

Trajectory

A class for collecting all information of a body within a plotter.

OrbitPlotter

A base class containing common attributes and methods for plotters.

Module Contents

class boinor.plotting.orbit.plotter.Trajectory

Bases: namedtuple('Trajectory', ['coordinates', 'position', 'colors', 'dashed', 'label'])

A class for collecting all information of a body within a plotter.

Information contains all the trajectory coordinates, the current position, the name of the label to be displayed in the plotter, the color to be used and if dashed mode is desired or not.

class boinor.plotting.orbit.plotter.OrbitPlotter(backend=None, num_points=150, *, plane=None, length_scale_units=u.km)

A base class containing common attributes and methods for plotters.

property backend

Backend instance used by the plotter.

Returns:

An instance of OrbitPlotterBackend used for rendendering the scene.

Return type:

OrbitPlotterBackend

property plane

Reference plane to be used when drawing the scene.

Returns:

Reference plane to be used when drawing the scene. Default to

Return type:

Plane, optional

property trajectories

List with all the Trajectory instances used in the plotter.

Returns:

A list containing all the trajectories rendered in the scene.

Return type:

List[Trajectory]

property length_scale_units

Units of length used for representing distances.

Returns:

length_units – Desired length units to be used when representing distances.

Return type:

Unit

set_attractor(attractor)

Set the desired plotting attractor.

Parameters:

attractor (Body) – Central body.

Raises:

NotImplementedError – Raised if attractor is already set.

set_orbit_frame(orbit)

Set the perifocal frame based on an orbit.

Parameters:

orbit (Orbit) – Orbit to use as frame.

set_body_frame(body, epoch=None)

Set perifocal frame based on the orbit of a body at a particular epoch if given.

Parameters:
plot(orbit, *, color=None, label=None, trail=False, dashed=True)

Plot state and osculating orbit in their plane.

Parameters:
  • orbit (Orbit) – Orbit to plot.

  • color (str, optional) – Color of the line and the position.

  • label (str, optional) – Label of the orbit.

  • trail (bool, optional) – Fade the orbit trail, default to False.

  • dashed (bool, optional) – True to use a dashed line style. False otherwise.

plot_body_orbit(body, epoch, *, label=None, color=None, trail=False)

Plot complete revolution of body and current position.

Parameters:
  • body (boinor.bodies.SolarSystemPlanet) – Body.

  • epoch (astropy.time.Time) – Epoch of current position.

  • label (str, optional) – Label of the orbit, default to the name of the body.

  • color (str, optional) – Color of the line and the position.

  • trail (bool, optional) – Fade the orbit trail, default to False.

plot_ephem(ephem, epoch=None, *, label=None, color=None, trail=False)

Plot Ephem object over its sampling period.

Parameters:
  • ephem (Ephem) – Ephemerides to plot.

  • epoch (astropy.time.Time, optional) – Epoch of the current position, None is used if not given.

  • label (str, optional) – Label of the orbit, default to the name of the body.

  • color (str, optional) – Color of the line and the position.

  • trail (bool, optional) – Fade the orbit trail, default to False.

plot_maneuver(initial_orbit, maneuver, label=None, color=None, trail=False)

Plot the maneuver trajectory applied to the provided initial orbit.

Parameters:
  • initial_orbit (Orbit) – The base orbit for which the maneuver will be applied.

  • maneuver (Maneuver) – The maneuver to be plotted.

  • label (str, optional) – Label of the trajectory.

  • color (str, optional) – Color of the trajectory.

  • trail (bool, optional) – Fade the orbit trail, default to False.

plot_coordinates(coordinates, *, position=None, label=None, color=None, trail=False, dashed=False)

Plot a precomputed trajectory.

Parameters:
  • coordinates (CartesianRepresentation) – Trajectory to plot.

  • label (str, optional) – Label of the trajectory.

  • color (str, optional) – Color of the trajectory.

  • trail (bool, optional) – Fade the orbit trail, default to False.

  • dashed (bool, optional) – True to use a dashed line style. False otherwise.

Raises:

ValueError – An attractor must be set first.

plot_trajectory(coordinates, *, label=None, color=None, trail=False, dashed=False)

Plot a precomputed trajectory.

Parameters:
  • coordinates (CartesianRepresentation) – Trajectory to plot.

  • label (str, optional) – Label of the trajectory.

  • color (str, optional) – Color of the trajectory.

  • trail (bool, optional) – Fade the orbit trail, default to False.

  • dashed (bool, optional) – True to use a dashed line style. False otherwise.

Raises:

ValueError – An attractor must be set first.

set_view(elevation_angle, azimuth_angle, distance=5 * u.km)

Change 3D view by setting the elevation, azimuth and distance.

Parameters:
  • elevation_angle (Quantity) – Desired elevation angle of the camera.

  • azimuth_angle (Quantity) – Desired azimuth angle of the camera.

  • distance (optional, Quantity) – Desired distance of the camera to the scene.

show()

Render the plot.