poliastro.plotting._base

Module Contents

Classes

Trajectory

Built-in immutable sequence.

BaseOrbitPlotter

Base class for all the OrbitPlotter classes.

Mixin2D

class poliastro.plotting._base.Trajectory

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

Built-in immutable sequence.

If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

If the argument is a tuple, the return value is the same object.

__add__()

Return self+value.

__contains__()

Return key in self.

__delattr__()

Implement delattr(self, name).

__dir__()

Default dir() implementation.

__eq__()

Return self==value.

__format__()

Default object formatter.

__ge__()

Return self>=value.

__getattribute__()

Return getattr(self, name).

__getitem__()

Return self[key].

__getnewargs__()
__gt__()

Return self>value.

__hash__()

Return hash(self).

__iter__()

Implement iter(self).

__le__()

Return self<=value.

__len__()

Return len(self).

__lt__()

Return self<value.

__mul__()

Return self*value.

__ne__()

Return self!=value.

__reduce__()

Helper for pickle.

__reduce_ex__()

Helper for pickle.

__repr__()

Return repr(self).

__rmul__()

Return value*self.

__setattr__()

Implement setattr(self, name, value).

__sizeof__()

Size of object in memory, in bytes.

__str__()

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

count()

Return number of occurrences of value.

index()

Return first index of value.

Raises ValueError if the value is not present.

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)

Sets plotting attractor.

Parameters

attractor (Body) – Central body.

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 (str, optional) – Label of the trajectory.

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

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

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

Plots 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(self, orbit, *, label=None, color=None, trail=False)

Plots state and osculating orbit in their plane.

Parameters
  • orbit (Orbit) – Orbit to plot.

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

  • color (str, 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 (str, 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 (str, optional) – Color of the line and the position.

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

class poliastro.plotting._base.Mixin2D
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