Util module

Function helpers.

poliastro.util.norm(vec)

Norm of a Quantity vector that respects units.

Parameters

vec (Quantity) – Vector with units.

poliastro.util.time_range(start, *, periods=50, spacing=None, end=None, format=None, scale=None)

Generates range of astronomical times.

New in version 0.8.0.

Parameters
  • periods (int, optional) – Number of periods, default to 50.

  • spacing (Time or Quantity, optional) – Spacing between periods, optional.

  • end (Time or equivalent, optional) – End date.

Returns

Array of time values.

Return type

Time

poliastro.util.find_closest_value(value, values)

Calculates the closest value in the given values.

Parameters
  • value (Quantity) – Reference value.

  • values (Quantity) – Values to search from.

poliastro.util.alinspace(start, stop=None, *, num=50, endpoint=True)

Return increasing, evenly spaced angular values over a specified interval.