Moon

Module holding functions to handle coordinates.

class pymeeus.Moon.Moon[source]

Class Moon models Earth’s satellite.

__weakref__

list of weak references to the object (if defined)

static apparent_ecliptical_pos(epoch)[source]

This method computes the apparent geocentric ecliptical position (longitude, latitude) of the Moon for a given instant, referred to the mean equinox of the date, as well as the Moon-Earth distance in kilometers and the equatorial horizontal parallax.

Parameters:epoch (Epoch) – Instant to compute the Moon’s position, as an py:class:Epoch object.
Returns:Tuple containing:
  • Apparent geocentric longitude of the center of the Moon, as an py:class:Epoch object.
  • Apparent geocentric latitude of the center of the Moon, as an py:class:Epoch object.
  • Distance in kilometers between the centers of Earth and Moon, in kilometers (float)
  • Equatorial horizontal parallax of the Moon, as an py:class:Epoch object.
Return type:tuple
Raises:TypeError if input value is of wrong type.
>>> epoch = Epoch(1992, 4, 12.0)
>>> Lambda, Beta, Delta, ppi = Moon.apparent_ecliptical_pos(epoch)
>>> print(round(Lambda, 5))
133.16726
>>> print(round(Beta, 6))
-3.229126
>>> print(round(Delta, 1))
368409.7
>>> print(round(ppi, 5))
0.99199
static apparent_equatorial_pos(epoch)[source]

This method computes the apparent equatorial position (right ascension, declination) of the Moon for a given instant, referred to the mean equinox of the date, as well as the Moon-Earth distance in kilometers and the equatorial horizontal parallax.

Parameters:epoch (Epoch) – Instant to compute the Moon’s position, as an py:class:Epoch object.
Returns:Tuple containing:
  • Apparent right ascension of the center of the Moon, as an py:class:Epoch object.
  • Apparent declination of the center of the Moon, as an py:class:Epoch object.
  • Distance in kilometers between the centers of Earth and Moon, in kilometers (float)
  • Equatorial horizontal parallax of the Moon, as an py:class:Epoch object.
Return type:tuple
Raises:TypeError if input value is of wrong type.
>>> epoch = Epoch(1992, 4, 12.0)
>>> ra, dec, Delta, ppi = Moon.apparent_equatorial_pos(epoch)
>>> print(round(ra, 6))
134.688469
>>> print(round(dec, 6))
13.768367
>>> print(round(Delta, 1))
368409.7
>>> print(round(ppi, 5))
0.99199
static geocentric_ecliptical_pos(epoch)[source]

This method computes the geocentric ecliptical position (longitude, latitude) of the Moon for a given instant, referred to the mean equinox of the date, as well as the Moon-Earth distance in kilometers and the equatorial horizontal parallax.

Parameters:epoch (Epoch) – Instant to compute the Moon’s position, as an py:class:Epoch object.
Returns:Tuple containing:
  • Geocentric longitude of the center of the Moon, as an py:class:Epoch object.
  • Geocentric latitude of the center of the Moon, as an py:class:Epoch object.
  • Distance in kilometers between the centers of Earth and Moon, in kilometers (float)
  • Equatorial horizontal parallax of the Moon, as an py:class:Epoch object.
Return type:tuple
Raises:TypeError if input value is of wrong type.
>>> epoch = Epoch(1992, 4, 12.0)
>>> Lambda, Beta, Delta, ppi = Moon.geocentric_ecliptical_pos(epoch)
>>> print(round(Lambda, 6))
133.162655
>>> print(round(Beta, 6))
-3.229126
>>> print(round(Delta, 1))
368409.7
>>> print(round(ppi, 5))
0.99199
static illuminated_fraction_disk(epoch)[source]

This method computes the approximate illuminated fraction ‘k’ of the disk of the Moon. The method used has a relatively low accuracy, but it is enough to the 2nd decimal place.

Parameters:epoch (Epoch) – Instant to compute the Moon’s illuminated fraction of the disk, as a py:class:Epoch object.
Returns:The approximate illuminated fraction of the Moon’s disk.
Return type:float
Raises:TypeError if input value is of wrong type.
>>> epoch = Epoch(1992, 4, 12.0)
>>> k = Moon.illuminated_fraction_disk(epoch)
>>> print(round(k, 2))
0.68
static longitude_mean_ascending_node(epoch)[source]

This method computes the longitude of the mean ascending node of the Moon in degrees, for a given instant, measured from the mean equinox of the date.

Parameters:epoch (Epoch) – Instant to compute the Moon’s mean ascending node, as an py:class:Epoch object.
Returns:The longitude of the mean ascending node.
Return type:py:class:Angle
Raises:TypeError if input value is of wrong type.
>>> epoch = Epoch(1913, 5, 27.0)
>>> Omega = Moon.longitude_mean_ascending_node(epoch)
>>> print(round(Omega, 1))
0.0
>>> epoch = Epoch(2043, 9, 10.0)
>>> Omega = Moon.longitude_mean_ascending_node(epoch)
>>> print(round(Omega, 1))
0.0
>>> epoch = Epoch(1959, 12, 7.0)
>>> Omega = Moon.longitude_mean_ascending_node(epoch)
>>> print(round(Omega, 1))
180.0
>>> epoch = Epoch(2108, 11, 3.0)
>>> Omega = Moon.longitude_mean_ascending_node(epoch)
>>> print(round(Omega, 1))
180.0
static longitude_mean_perigee(epoch)[source]

This method computes the longitude of the mean perigee of the lunar orbitn in degrees, for a given instant, measured from the mean equinox of the date.

Parameters:epoch (Epoch) – Instant to compute the Moon’s mean perigee, as an py:class:Epoch object.
Returns:The longitude of the mean perigee.
Return type:py:class:Angle
Raises:TypeError if input value is of wrong type.
>>> epoch = Epoch(2021, 3, 5.0)
>>> Pi = Moon.longitude_mean_perigee(epoch)
>>> print(round(Pi, 5))
224.89194
static longitude_true_ascending_node(epoch)[source]

This method computes the longitude of the true ascending node of the Moon in degrees, for a given instant, measured from the mean equinox of the date.

Parameters:epoch (Epoch) – Instant to compute the Moon’s true ascending node, as an py:class:Epoch object.
Returns:The longitude of the true ascending node.
Return type:py:class:Angle
Raises:TypeError if input value is of wrong type.
>>> epoch = Epoch(1913, 5, 27.0)
>>> Omega = Moon.longitude_true_ascending_node(epoch)
>>> print(round(Omega, 4))
0.8763
static moon_perigee_apogee(epoch, target='perigee')[source]

This method computes the approximate times when the distance between the Earth and the Moon is a minimum (perigee) or a maximum (apogee). The resulting times will be expressed in the uniform time scale of Dynamical Time (TT).

Parameters:
  • epoch – Approximate epoch we want to compute the Moon’s perigee or apogee for.
  • target (str) – Either ‘perigee’ of ‘apogee’.
Returns:

A tuple containing the instant of time when the perigee of apogee happens, as a Epoch object, and the Moon’s corresponding equatorial horizontal parallax, as a Angle object.

Return type:

tuple

Raises:

TypeError if input values are of wrong type.

Raises:

ValueError if ‘target’ value is invalid.

>>> epoch = Epoch(1988, 10, 1.0)
>>> apogee, parallax = Moon.moon_perigee_apogee(epoch, target="apogee")
>>> y, m, d, h, mi, s = apogee.get_full_date()
>>> print("{}/{}/{} {}:{}".format(y, m, d, h, mi))
1988/10/7 20:30
>>> print("{}".format(parallax.dms_str(n_dec=3)))
54' 0.679''
static moon_phase(epoch, target='new')[source]

This method computes the time of the phase of the moon closest to the provided epoch. The resulting time is expressed in the uniform time scale of Dynamical Time (TT).

Parameters:
  • epoch – Approximate epoch we want to compute the Moon phase for.
  • target (str) – Corresponding phase. It can be “new” (New Moon), “first” (First Quarter), “full” (Full Moon) and “last” (Last Quarter).
Returns:

The instant of time when the provided phase happens.

Return type:

Epoch

Raises:

TypeError if input values are of wrong type.

Raises:

ValueError if ‘target’ value is invalid.

>>> epoch = Epoch(1977, 2, 15.0)
>>> new_moon = Moon.moon_phase(epoch, target="new")
>>> y, m, d, h, mi, s = new_moon.get_full_date()
>>> print("{}/{}/{} {}:{}:{}".format(y, m, d, h, mi, round(s, 0)))
1977/2/18 3:37:42.0
>>> epoch = Epoch(2044, 1, 15.0)
>>> new_moon = Moon.moon_phase(epoch, target="last")
>>> y, m, d, h, mi, s = new_moon.get_full_date()
>>> print("{}/{}/{} {}:{}:{}".format(y, m, d, h, mi, round(s, 0)))
2044/1/21 23:48:17.0
static position_bright_limb(epoch)[source]

This method computes the position angle of the Moon’s bright limb, i.e., the position angle of the midpoint of the illuminated limb, reckoned eastward from the North Point of the disk (not from the axis of rotation of the lunar globe).

Parameters:epoch (Epoch) – Instant to compute the position angle of the Moon’s bright limb, as a py:class:Epoch object.
Returns:The position angle of the Moon’s bright limb.
Return type:Angle
Raises:TypeError if input value is of wrong type.
>>> epoch = Epoch(1992, 4, 12.0)
>>> xi = Moon.position_bright_limb(epoch)
>>> print(round(xi, 1))
285.0
pymeeus.Moon.PERIODIC_TERMS_B_TABLE = [[0, 0, 0, 1, 5128122.0], [0, 0, 1, 1, 280602.0], [0, 0, 1, -1, 277693.0], [2, 0, 0, -1, 173237.0], [2, 0, -1, 1, 55413.0], [2, 0, -1, -1, 46271.0], [2, 0, 0, 1, 32573.0], [0, 0, 2, 1, 17198.0], [2, 0, 1, -1, 9266.0], [0, 0, 2, -1, 8822.0], [2, -1, 0, -1, 8216.0], [2, 0, -2, -1, 4324.0], [2, 0, 1, 1, 4200.0], [2, 1, 0, -1, -3359.0], [2, -1, -1, 1, 2463.0], [2, -1, 0, 1, 2211.0], [2, -1, -1, -1, 2065.0], [0, 1, -1, -1, -1870.0], [4, 0, -1, -1, 1828.0], [0, 1, 0, 1, -1794.0], [0, 0, 0, 3, -1749.0], [0, 1, -1, 1, -1565.0], [1, 0, 0, 1, -1491.0], [0, 1, 1, 1, -1475.0], [0, 1, 1, -1, -1410.0], [0, 1, 0, -1, -1344.0], [1, 0, 0, -1, -1335.0], [0, 0, 3, 1, 1107.0], [4, 0, 0, -1, 1021.0], [4, 0, -1, 1, 833.0], [0, 0, 1, -3, 777.0], [4, 0, -2, 1, 671.0], [2, 0, 0, -3, 607.0], [2, 0, 2, -1, 596.0], [2, -1, 1, -1, 491.0], [2, 0, -2, 1, -451.0], [0, 0, 3, -1, 439.0], [2, 0, 2, 1, 422.0], [2, 0, -3, -1, 421.0], [2, 1, -1, 1, -366.0], [2, 1, 0, 1, -351.0], [4, 0, 0, 1, 331.0], [2, -1, 1, 1, 315.0], [2, -2, 0, -1, 302.0], [0, 0, 1, 3, -283.0], [2, 1, 1, -1, -229.0], [1, 1, 0, -1, 223.0], [1, 1, 0, 1, 223.0], [0, 1, -2, -1, -220.0], [2, 1, -1, -1, -220.0], [1, 0, 1, 1, -185.0], [2, -1, -2, -1, 181.0], [0, 1, 2, 1, -177.0], [4, 0, -2, -1, 176.0], [4, -1, -1, -1, 166.0], [1, 0, 1, -1, -164.0], [4, 0, 1, -1, 132.0], [1, 0, -1, -1, -119.0], [4, -1, 0, -1, 115.0], [2, -2, 0, 1, 107.0]]

This table contains the periodic terms for the latitude of the Moon Sigmab. Units are 0.000001 degree. In Meeus’ book this is Table 47.B and can be found in page 341.

pymeeus.Moon.PERIODIC_TERMS_LR_TABLE = [[0, 0, 1, 0, 6288774.0, -20905355.0], [2, 0, -1, 0, 1274027.0, -3699111.0], [2, 0, 0, 0, 658314.0, -2955968.0], [0, 0, 2, 0, 213618.0, -569925.0], [0, 1, 0, 0, -185116.0, 48888.0], [0, 0, 0, 2, -114332.0, -3149.0], [2, 0, -2, 0, 58793.0, 246158.0], [2, -1, -1, 0, 57066.0, -152138.0], [2, 0, 1, 0, 53322.0, -170733.0], [2, -1, 0, 0, 45758.0, -204586.0], [0, 1, -1, 0, -40923.0, -129620.0], [1, 0, 0, 0, -34720.0, 108743.0], [0, 1, 1, 0, -30383.0, 104755.0], [2, 0, 0, -2, 15327.0, 10321.0], [0, 0, 1, 2, -12528.0, 0.0], [0, 0, 1, -2, 10980.0, 79661.0], [4, 0, -1, 0, 10675.0, -34782.0], [0, 0, 3, 0, 10034.0, -23210.0], [4, 0, -2, 0, 8548.0, -21636.0], [2, 1, -1, 0, -7888.0, 24208.0], [2, 1, 0, 0, -6766.0, 30824.0], [1, 0, -1, 0, -5163.0, -8379.0], [1, 1, 0, 0, 4987.0, -16675.0], [2, -1, 1, 0, 4036.0, -12831.0], [2, 0, 2, 0, 3994.0, -10445.0], [4, 0, 0, 0, 3861.0, -11650.0], [2, 0, -3, 0, 3665.0, 14403.0], [0, 1, -2, 0, -2689.0, -7003.0], [2, 0, -1, 2, -2602.0, 0.0], [2, -1, -2, 0, 2390.0, 10056.0], [1, 0, 1, 0, -2348.0, 6322.0], [2, -2, 0, 0, 2236.0, -9884.0], [0, 1, 2, 0, -2120.0, 5751.0], [0, 2, 0, 0, -2069.0, 0.0], [2, -2, -1, 0, 2048.0, -4950.0], [2, 0, 1, -2, -1773.0, 4130.0], [2, 0, 0, 2, -1595.0, 0.0], [4, -1, -1, 0, 1215.0, -3958.0], [0, 0, 2, 2, -1110.0, 0.0], [3, 0, -1, 0, -892.0, 3258.0], [2, 1, 1, 0, -810.0, 2616.0], [4, -1, -2, 0, 759.0, -1897.0], [0, 2, -1, 0, -713.0, -2117.0], [2, 2, -1, 0, -700.0, 2354.0], [2, 1, -2, 0, 691.0, 0.0], [2, -1, 0, -2, 596.0, 0.0], [4, 0, 1, 0, 549.0, -1423.0], [0, 0, 4, 0, 537.0, -1117.0], [4, -1, 0, 0, 520.0, -1571.0], [1, 0, -2, 0, -487.0, -1739.0], [2, 1, 0, -2, -399.0, 0.0], [0, 0, 2, -2, -381.0, -4421.0], [1, 1, 1, 0, 351.0, 0.0], [3, 0, -2, 0, -340.0, 0.0], [4, 0, -3, 0, 330.0, 0.0], [2, -1, 2, 0, 327.0, 0.0], [0, 2, 1, 0, -323.0, 1165.0], [1, 1, -1, 0, 299.0, 0.0], [2, 0, 3, 0, 294.0, 0.0], [2, 0, -1, -2, 0.0, 8752.0]]

This table contains the periodic terms for the longitude (Sigmal) and distance (Sigmar) of the Moon. Units are 0.000001 degree for Sigmal, and 0.001 kilometer for Sigmar. In Meeus’ book this is Table 47.A and can be found in pages 339-340.