Sun

Module holding functions to handle coordinates.

class pymeeus.Sun.Sun[source]

Class Sun handles the parameters related to the Sun.

__init__()[source]

Sun constructor.

Returns

Sun object.

Return type

Sun

__weakref__

list of weak references to the object (if defined)

static apparent_geocentric_position(epoch, nutation=True)[source]

This method computes the apparent geocentric position of the Sun for a given epoch, using the VSOP87 theory.

Parameters
  • epoch (bool) – Epoch to compute Sun position, as an Epoch object

  • nutation – Whether the nutation correction will be applied

Returns

A tuple with the heliocentric longitude and latitude (as Angle objects), and the radius vector (as a float, in astronomical units), in that order

Return type

tuple

Raises

TypeError if input values are of wrong type.

>>> epoch = Epoch(1992, 10, 13.0)
>>> lon, lat, r = Sun.apparent_geocentric_position(epoch)
>>> print(lon.to_positive().dms_str(n_dec=3))
199d 54' 21.548''
>>> print(lat.dms_str(n_dec=3))
0.721''
>>> print(round(r, 8))
0.99760852
static apparent_longitude_coarse(epoch)[source]

This method provides the Sun’s apparent longitude with a relatively low accuracy of about 0.01 degree.

Parameters

epoch (Epoch) – Epoch to compute the position of the Sun

Returns

A tuple containing the sun_apparent (ecliptical) longitude (as an Angle object) and the radius vector in astronomical units.

Return type

tuple

Raises

TypeError if input value is of wrong type.

>>> epoch = Epoch(1992, 10, 13)
>>> app_lon, r = Sun.apparent_longitude_coarse(epoch)
>>> print(app_lon.dms_str(n_dec=0))
199d 54' 32.0''
>>> print(round(r, 5))
0.99766
static apparent_rightascension_declination_coarse(epoch)[source]

This method provides the Sun’s apparent right ascension and declination with a relatively low accuracy of about 0.01 degree.

Parameters

epoch (Epoch) – Epoch to compute the position of the Sun

Returns

A tuple containing the right ascension and the declination (as Angle objects) and the radius vector in astronomical units.

Return type

tuple

Raises

TypeError if input value is of wrong type.

>>> epo = Epoch(1992, 10, 13)
>>> ra, delta, r = Sun.apparent_rightascension_declination_coarse(epo)
>>> print(ra.ra_str(n_dec=1))
13h 13' 31.4''
>>> print(delta.dms_str(n_dec=0))
-7d 47' 6.0''
>>> print(round(r, 5))
0.99766
static beginning_synodic_rotation(number)[source]

This method calculates the epoch when the Carrington’s synodic rotation No. ‘number’ starts.

Parameters

number (int) – Number of Carrington’s synodic rotation

Returns

Epoch when the provided rotation starts

Return type

Epoch

Raises

TypeError if input value is of wrong type.

>>> epoch = Sun.beginning_synodic_rotation(1699)
>>> print(round(epoch(), 3))
2444480.723
static ephemeris_physical_observations(epoch)[source]

This method uses Carrington’s formulas to compute the following quantities:

  • P : position angle of the northern extremity of the axis of rotation

  • B0 : heliographic latitude of the center of the solar disk

  • L0 : heliographic longitude of the center of the solar disk

Parameters

epoch (Epoch) – Epoch to compute the parameters

Returns

Parameters P, B0 and L0, in a tuple

Return type

tuple

Raises

TypeError if input value is of wrong type.

>>> epoch = Epoch(1992, 10, 13)
>>> p, b0, l0 = Sun.ephemeris_physical_observations(epoch)
>>> print(round(p, 2))
26.27
>>> print(round(b0, 2))
5.99
>>> print(round(l0, 2))
238.63
static equation_of_time(epoch)[source]

This method computes the equation of time for a given epoch, understood as the difference between apparent and mean time, or the difference between the hour angle of the true Sun and the mean Sun.

Parameters

epoch (Epoch) – Epoch to compute the equation of time, as an Epoch object

Returns

Difference between apparent and mean time, as a tuple, in minutes and seconds of time

Return type

tuple

Raises

TypeError if input values are of wrong type.

>>> epoch = Epoch(1992, 10, 13.0)
>>> m, s = Sun.equation_of_time(epoch)
>>> print(m)
13
>>> print(round(s, 1))
42.6
static geometric_geocentric_position(epoch, tofk5=True)[source]

This method computes the geometric geocentric position of the Sun for a given epoch, using the VSOP87 theory.

Parameters
  • epoch (Epoch) – Epoch to compute Sun position, as an Epoch object

  • tofk5 (bool) – Whether or not the small correction to convert to the FK5 system will be applied or not

Returns

A tuple with the geocentric longitude and latitude (as Angle objects), and the radius vector (as a float, in astronomical units), in that order

Return type

tuple

Raises

TypeError if input values are of wrong type.

>>> epoch = Epoch(1992, 10, 13.0)
>>> l, b, r = Sun.geometric_geocentric_position(epoch, tofk5=False)
>>> print(round(l.to_positive(), 6))
199.907297
>>> print(b.dms_str(n_dec=3))
0.744''
>>> print(round(r, 8))
0.99760852
static get_equinox_solstice(year, target='spring')[source]

This method computes the times of the equinoxes or the solstices.

Parameters
  • year (int) – Year we want to compute the equinox or solstice for

  • target (str) – Corresponding equinox or solstice. It can be “spring”, “summer”, “autumn”, “winter”

Returns

The instant of time when the equinox or solstice happens

Return type

Epoch

Raises

TypeError if input values are of wrong type.

Raises

ValueError if ‘target’ value is invalid.

>>> epoch = Sun.get_equinox_solstice(1962, target="summer")
>>> y, m, d, h, mi, s = epoch.get_full_date()
>>> print("{}/{}/{} {}:{}:{}".format(y, m, d, h, mi, round(s, 0)))
1962/6/21 21:24:42.0
static rectangular_coordinates_b1950(epoch)[source]

This method computes the rectangular geocentric equatorial coordinates (X, Y, Z) of the Sun, referred to the mean equinox of B1950.0. The X axis is directed towards the vernal equinox (longitude 0), the Y axis lies in the plane of the equator and is directed towards longitude 90, and the Z axis is directed towards the north celestial pole.

Parameters

epoch (Epoch) – Epoch to compute Sun position, as an Epoch object

Returns

A tuple with the X, Y, Z values in astronomical units

Return type

tuple

Raises

TypeError if input values are of wrong type.

>>> epoch = Epoch(1992, 10, 13.0)
>>> x, y, z = Sun.rectangular_coordinates_b1950(epoch)
>>> print(round(x, 8))
-0.94149557
>>> print(round(y, 8))
-0.30259922
>>> print(round(z, 8))
-0.11578695
static rectangular_coordinates_equinox(epoch, equinox_epoch)[source]

This method computes the rectangular geocentric equatorial coordinates (X, Y, Z) of the Sun, referred to an arbitrary mean equinox. The X axis is directed towards the vernal equinox (longitude 0), the Y axis lies in the plane of the equator and is directed towards longitude 90, and the Z axis is directed towards the north celestial pole.

Parameters
  • epoch (Epoch) – Epoch to compute Sun position, as an Epoch object

  • equinox_epoch (Epoch) – Epoch corresponding to the mean equinox

Returns

A tuple with the X, Y, Z values in astronomical units

Return type

tuple

Raises

TypeError if input values are of wrong type.

>>> epoch = Epoch(1992, 10, 13.0)
>>> e_equinox = Epoch(2467616.0)
>>> x, y, z = Sun.rectangular_coordinates_equinox(epoch, e_equinox)
>>> print(round(x, 8))
-0.93368986
>>> print(round(y, 8))
-0.32235085
>>> print(round(z, 8))
-0.13977098
static rectangular_coordinates_j2000(epoch)[source]

This method computes the rectangular geocentric equatorial coordinates (X, Y, Z) of the Sun, referred to the standard equinox of J2000.0. The X axis is directed towards the vernal equinox (longitude 0), the Y axis lies in the plane of the equator and is directed towards longitude 90, and the Z axis is directed towards the north celestial pole.

Parameters

epoch (Epoch) – Epoch to compute Sun position, as an Epoch object

Returns

A tuple with the X, Y, Z values in astronomical units

Return type

tuple

Raises

TypeError if input values are of wrong type.

>>> epoch = Epoch(1992, 10, 13.0)
>>> x, y, z = Sun.rectangular_coordinates_j2000(epoch)
>>> print(round(x, 8))
-0.93740485
>>> print(round(y, 8))
-0.3131474
>>> print(round(z, 8))
-0.13577045
static rectangular_coordinates_mean_equinox(epoch)[source]

This method computes the rectangular geocentric equatorial coordinates (X, Y, Z) of the Sun, referred to the mean equinox of the date. The X axis is directed towards the vernal equinox (longitude 0), the Y axis lies in the plane of the equator and is directed towards longitude 90, and the Z axis is directed towards the north celestial pole.

Parameters

epoch (Epoch) – Epoch to compute Sun position, as an Epoch object

Returns

A tuple with the X, Y, Z values in astronomical units

Return type

tuple

Raises

TypeError if input values are of wrong type.

>>> epoch = Epoch(1992, 10, 13.0)
>>> x, y, z = Sun.rectangular_coordinates_mean_equinox(epoch)
>>> print(round(x, 7))
-0.9379963
>>> print(round(y, 6))
-0.311654
>>> print(round(z, 7))
-0.1351207
static true_longitude_coarse(epoch)[source]

This method provides the Sun’s true longitude with a relatively low accuracy of about 0.01 degree.

Parameters

epoch (Epoch) – Epoch to compute the position of the Sun

Returns

A tuple containing the true (ecliptical) longitude (as an Angle object) and the radius vector in astronomical units.

Return type

tuple

Raises

TypeError if input value is of wrong type.

>>> epoch = Epoch(1992, 10, 13)
>>> true_lon, r = Sun.true_longitude_coarse(epoch)
>>> print(true_lon.dms_str(n_dec=0))
199d 54' 36.0''
>>> print(round(r, 5))
0.99766