poliastro.plotting._base

Module Contents

Classes

Trajectory

docstring

BaseOrbitPlotter

Base class for all the OrbitPlotter classes.

Mixin2D

class poliastro.plotting._base.Trajectory

Bases: collections.namedtuple()

docstring

class poliastro.plotting._base.BaseOrbitPlotter(num_points=150, *, plane=None)

Base class for all the OrbitPlotter classes.

property trajectories(self)
property plane(self)
_set_attractor(self, attractor)
set_attractor(self, attractor)

Sets plotting attractor.

Parameters

attractor (Body) – Central body.

abstract _clear_attractor(self)
_redraw_attractor(self)
_redraw(self)
abstract _get_colors(self, color, trail)
abstract _draw_point(self, radius, color, name, center=None)
abstract _draw_sphere(self, radius, color, name, center=None)
abstract _plot_coordinates(self, coordinates, label, colors, dashed)
_plot_position(self, position, label, colors)
__plot_coordinates_and_position(self, trajectory)
__add_trajectory(self, coordinates, position=None, *, label, colors, dashed)
_plot_trajectory(self, coordinates, *, label=None, color=None, trail=False)
_plot(self, orbit, *, label=None, color=None, trail=False)
_plot_body_orbit(self, body, epoch, *, label=None, color=None, trail=False)
_plot_ephem(self, ephem, epoch=None, *, label=None, color=None, trail=False)
plot_trajectory(self, coordinates, *, label=None, color=None, trail=False)

Plots a precomputed trajectory.

An attractor must be set first.

Parameters
  • coordinates (CartesianRepresentation) – Trajectory to plot.

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

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

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

plot(self, orbit, *, label=None, color=None, trail=False)

Plots state and osculating orbit in their plane.

Parameters
  • orbit (Orbit) – Orbit to plot.

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

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

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

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

Plots complete revolution of body and current position.

Parameters
  • body (poliastro.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 (string, optional) – Color of the line and the position.

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

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

Plots Ephem object over its sampling period.

Parameters
  • ephem (Ephem) – Ephemerides to plot.

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

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

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

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

class poliastro.plotting._base.Mixin2D
_trajectories :List[Trajectory]
abstract _redraw(self)
_project(self, rr)
_set_frame(self, p_vec, q_vec, w_vec)
set_frame(self, p_vec, q_vec, w_vec)

Sets perifocal frame.

Raises

ValueError – If the vectors are not a set of mutually orthogonal unit vectors.

set_orbit_frame(self, orbit)

Sets perifocal frame based on an orbit.

Parameters

orbit (Orbit) – Orbit to use as frame.

set_body_frame(self, body, epoch=None)

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

Parameters