Mercury

Class to model Mercury planet.

Mercury examples

Mercury - VSOP87-Parameters

class pyplanets.planets.mercury.Mercury(epoch)[source]

Class Mercury 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 Perihelion (or Aphelion)

Return type

Epoch

>>> epoch = Epoch(2000, 3, 1.0)
>>> e = Mercury(epoch).aphelion()
>>> y, m, d, h, mi, s = e.get_full_date()
>>> print(y)
2000
>>> print(m)
3
>>> print(d)
30
>>> print(h)
17
eastern_elongation() -> (<class 'pyplanets.core.epoch.Epoch'>, <class 'pyplanets.core.angle.Angle'>)[source]

This method computes the time of the eastern elongation closest to the given epoch, as well as the corresponding maximum elongation angle.

Returns

A tuple with the time when the eastern elongation happens, as an Epoch, and the maximum elongation angle, as an Angle

Return type

tuple

Raises

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

>>> epoch = Epoch(1990, 8, 1.0)
>>> time, elongation = Mercury(epoch).eastern_elongation()
>>> y, m, d = time.get_date()
>>> print(y)
1990
>>> print(m)
8
>>> print(round(d, 4))
11.8514
>>> print(round(elongation, 4))
27.4201
inferior_conjunction()pyplanets.core.epoch.Epoch[source]

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

Returns

The time when the inferior conjunction happens, as an Epoch

Return type

Epoch

Raises

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

>>> epoch = Epoch(1993, 10, 1.0)
>>> conjunction = Mercury(epoch).inferior_conjunction()
>>> y, m, d = conjunction.get_date()
>>> print(y)
1993
>>> print(m)
11
>>> print(round(d, 4))
6.1449
>>> epoch = Epoch(1631, 10, 1.0)
>>> conjunction = Mercury(epoch).inferior_conjunction()
>>> y, m, d = conjunction.get_date()
>>> print(y)
1631
>>> print(m)
11
>>> print(round(d, 3))
7.306
magnitude(sun_dist, earth_dist, phase_angle)[source]

This function computes the approximate magnitude of Mercury.

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

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

  • phase_angle (float, Angle) – Mercury phase angle

Returns

Mercury’s magnitude

Return type

float

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

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

Returns

The epoch of the desired Perihelion (or Aphelion)

Return type

Epoch

>>> epoch = Epoch(2000, 1, 1.0)
>>> e = Mercury(epoch).perihelion()
>>> y, m, d, h, mi, s = e.get_full_date()
>>> print(y)
2000
>>> print(m)
2
>>> print(d)
15
>>> print(h)
18
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 statin in longitude happens, as an Epoch

Return type

Epoch

Raises

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

>>> epoch = Epoch(1993, 10, 1.0)
>>> sta1 = Mercury(epoch).station_longitude_1()
>>> y, m, d = sta1.get_date()
>>> print(y)
1993
>>> print(m)
10
>>> print(round(d, 4))
25.9358
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.

>>> epoch = Epoch(1993, 10, 1.0)
>>> sta2 = Mercury(epoch).station_longitude_2()
>>> y, m, d = sta2.get_date()
>>> print(y)
1993
>>> print(m)
11
>>> print(round(d, 4))
15.0724
superior_conjunction()pyplanets.core.epoch.Epoch[source]

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

Returns

The time when the superior conjunction happens, as an Epoch

Return type

Epoch

Raises

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

>>> epoch = Epoch(1993, 10, 1.0)
>>> conjunction = Mercury(epoch).superior_conjunction()
>>> y, m, d = conjunction.get_date()
>>> print(y)
1993
>>> print(m)
8
>>> print(round(d, 4))
29.3301
western_elongation() -> (<class 'pyplanets.core.epoch.Epoch'>, <class 'pyplanets.core.angle.Angle'>)[source]

This method computes the time of the western elongation closest to the given epoch, as well as the corresponding maximum elongation angle.

Returns

A tuple with the time when the western elongation happens, as an Epoch, and the maximum elongation angle, as an Angle

Return type

tuple

Raises

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

>>> epoch = Epoch(1993, 11, 1.0)
>>> time, elongation = Mercury(epoch).western_elongation()
>>> y, m, d = time.get_date()
>>> print(y)
1993
>>> print(m)
11
>>> print(round(d, 4))
22.6386
>>> print(round(elongation, 4))
19.7506