poliastro.plotting.porkchop

This is the script for porkchop plotting

Module Contents

Functions

_get_state(body, time)

Computes the position of a body for a given time.

_targetting(departure_body, target_body, t_launch, t_arrival)

This function returns the increment in departure and arrival velocities.

porkchop(departure_body, target_body, launch_span, arrival_span, ax=None, tfl=True, vhp=True, max_c3=45.0 * u.km**2 / u.s**2, max_vhp=5 * u.km / u.s)

Plots porkchop between two bodies.

poliastro.plotting.porkchop._get_state(body, time)

Computes the position of a body for a given time.

poliastro.plotting.porkchop._targetting(departure_body, target_body, t_launch, t_arrival)

This function returns the increment in departure and arrival velocities.

poliastro.plotting.porkchop.targetting_vec
poliastro.plotting.porkchop.porkchop(departure_body, target_body, launch_span, arrival_span, ax=None, tfl=True, vhp=True, max_c3=45.0 * u.km ** 2 / u.s ** 2, max_vhp=5 * u.km / u.s)

Plots porkchop between two bodies.

Parameters
  • departure_body (poliastro.bodies.Body) – Body from which departure is done

  • target_body (poliastro.bodies.Body) – Body for targetting

  • launch_span (astropy.time.Time) – Time span for launch

  • arrival_span (astropy.time.Time) – Time span for arrival

  • ax (matplotlib.axes.Axes:) – For custom figures

  • tfl (boolean) – For plotting time flight contour lines

  • vhp (boolean) – For plotting arrival velocity contour lines

  • max_c3 (float) – Sets the maximum C3 value for porkchop

  • max_vhp (float) – Sets the maximum arrival velocity for porkchop

Returns

  • dv_launch (np.ndarray) – Launch delta v

  • dv_arrival (np.ndarray) – Arrival delta v

  • c3_launch (np.ndarray) – Characteristic launch energy

  • c3_arrrival (np.ndarray) – Characteristic arrival energy

  • tof (np.ndarray) – Time of flight for each transfer

Example

>>> from poliastro.plotting.porkchop import porkchop
>>> from poliastro.bodies import Earth, Mars
>>> from poliastro.util import time_range
>>> launch_span = time_range("2005-04-30", end="2005-10-07")
>>> arrival_span = time_range("2005-11-16", end="2006-12-21")
>>> dv_launch, dev_dpt, c3dpt, c3arr, tof = porkchop(Earth, Mars, launch_span, arrival_span)