Mars

Class to model Mars planet.

Mars examples

Mars - VSOP87-Parameters

class pyplanets.planets.mars.Mars(epoch)[source]

Class Mars models that planet.

__init__(epoch)[source]
Initializes an object of type planet for a given date (epoch) with

its orbital parameters (ephemeredes) given by VSOP87.

Parameters

epoch (Epoch) – Epoch to which all computations of this instance refer, as an Epoch object

Raises

TypeError if epoch is of wrong type.

aphelion()pyplanets.core.epoch.Epoch[source]

This method computes the time of Aphelion closer to a given epoch.

Returns

The epoch of the desired Aphelion

Return type

Epoch

>>> epoch = Epoch(2032, 1, 1.0)
>>> e = Mars(epoch).aphelion()
>>> y, m, d, h, mi, s = e.get_full_date()
>>> print(y)
2032
>>> print(m)
10
>>> print(d)
24
>>> print(h)
22
conjunction()pyplanets.core.epoch.Epoch[source]

This method computes the time of the conjunction closest to the given epoch.

Returns

The time when the conjunction happens, as an Epoch

Return type

Epoch

Raises

ValueError if input epoch outside the -2000/4000 range.

>>> epoch = Epoch(1993, 10, 1.0)
>>> conj = Mars(epoch).conjunction()
>>> y, m, d = conj.get_date()
>>> print(y)
1993
>>> print(m)
12
>>> print(round(d, 4))
27.0898
magnitude(sun_dist, earth_dist, phase_angle)float[source]

This function computes the approximate magnitude of Mars.

Parameters
  • sun_dist (float) – Distance from Mars to the Sun, in Astronomical Units

  • earth_dist (float) – Distance from Mars to Earth, in Astronomical Units

  • phase_angle (float, Angle) – Mars phase angle

Returns

Mars’ magnitude

Return type

float

opposition()pyplanets.core.epoch.Epoch[source]

This method computes the time of the opposition closest to the given epoch.

Returns

The time when the opposition happens, as an Epoch

Return type

Epoch

Raises

ValueError if input epoch outside the -2000/4000 range.

>>> epoch = Epoch(2729, 10, 1.0)
>>> oppo = Mars(epoch).opposition()
>>> y, m, d = oppo.get_date()
>>> print(y)
2729
>>> print(m)
9
>>> print(round(d, 4))
9.1412
perihelion()pyplanets.core.epoch.Epoch[source]

This method computes the time of Perihelion (or Aphelion) closer to a given epoch.

Returns

The epoch of the desired Perihelion (or Aphelion)

Return type

Epoch

>>> epoch = Epoch(2019, 2, 23.0)
>>> e = Mars(epoch).perihelion()
>>> y, m, d, h, mi, s = e.get_full_date()
>>> print(y)
2018
>>> print(m)
9
>>> print(d)
16
>>> print(h)
12
station_longitude_1()pyplanets.core.epoch.Epoch[source]

This method computes the time of the 1st station in longitude (i.e. when the planet is stationary and begins to move westward - retrograde - among the starts) closest to the given epoch.

Returns

Time when the 1st station in longitude happens, as an Epoch

Return type

Epoch

Raises

ValueError if input epoch outside the -2000/4000 range.

station_longitude_2()pyplanets.core.epoch.Epoch[source]

This method computes the time of the 2nd station in longitude (i.e. when the planet is stationary and begins to move eastward - prograde - among the starts) closest to the given epoch.

Returns

Time when the 2nd station in longitude happens, as an Epoch

Return type

Epoch

Raises

ValueError if input epoch outside the -2000/4000 range.