Updated Ecliptic to return ECL in all languages.

This commit is contained in:
Don Cross
2022-12-10 19:35:42 -05:00
parent d4660de2a7
commit 1a4f842764
29 changed files with 324 additions and 260 deletions

View File

@@ -1494,20 +1494,20 @@ The estimated difference TT-UT on the given date, expressed in seconds.
---
<a name="Ecliptic"></a>
### Ecliptic(equ)
### Ecliptic(eqj)
**Converts J2000 equatorial Cartesian coordinates to J2000 ecliptic coordinates.**
**Converts a J2000 mean equator (EQJ) vector to a true ecliptic of date (ETC) vector and angles.**
Given coordinates relative to the Earth's equator at J2000 (the instant of noon UTC
on 1 January 2000), this function converts those coordinates to J2000 ecliptic coordinates,
on 1 January 2000), this function converts those coordinates to true ecliptic coordinates of date,
which are relative to the plane of the Earth's orbit around the Sun.
| Type | Parameter | Description |
| --- | --- | --- |
| [`Equatorial`](#Equatorial) | `equ` | Equatorial coordinates in the J2000 frame of reference. |
| [`Equatorial`](#Equatorial) | `eqj` | Equatorial coordinates in the J2000 frame of reference. You can call [`GeoVector`](#GeoVector) to obtain suitable equatorial coordinates. |
**Returns**: [`EclipticCoordinates`](#EclipticCoordinates)
Ecliptic coordinates in the J2000 frame of reference.
Spherical and vector coordinates expressed in true ecliptic coordinates of date (ECT).
---
@@ -1542,12 +1542,12 @@ The Moon's position as a distance, ecliptic latitude, and ecliptic longitude.
<a name="EclipticLongitude"></a>
### EclipticLongitude(body, time)
**Calculates heliocentric ecliptic longitude of a body based on the J2000 equinox.**
**Calculates heliocentric ecliptic longitude of a body.**
This function calculates the angle around the plane of the Earth's orbit
of a celestial body, as seen from the center of the Sun.
The angle is measured prograde (in the direction of the Earth's orbit around the Sun)
in degrees from the J2000 equinox. The ecliptic longitude is always in the range [0, 360).
in degrees from the true equinox of date. The ecliptic longitude is always in the range [0, 360).
| Type | Parameter | Description |
| --- | --- | --- |

View File

@@ -5084,34 +5084,44 @@ def SunPosition(time):
true_obliq = math.radians(adjusted_time._etilt().tobl)
return _RotateEquatorialToEcliptic(sun_ofdate, true_obliq, time)
def Ecliptic(equ):
"""Converts J2000 equatorial Cartesian coordinates to J2000 ecliptic coordinates.
def Ecliptic(eqj):
"""Converts a J2000 mean equator (EQJ) vector to a true ecliptic of date (ETC) vector and angles.
Given coordinates relative to the Earth's equator at J2000 (the instant of noon UTC
on 1 January 2000), this function converts those coordinates to J2000 ecliptic coordinates,
on 1 January 2000), this function converts those coordinates to true ecliptic coordinates of date,
which are relative to the plane of the Earth's orbit around the Sun.
Parameters
----------
equ : Equatorial
eqj : Equatorial
Equatorial coordinates in the J2000 frame of reference.
You can call #GeoVector to obtain suitable equatorial coordinates.
Returns
-------
EclipticCoordinates
Ecliptic coordinates in the J2000 frame of reference.
Spherical and vector coordinates expressed in true ecliptic coordinates of date (ECT).
"""
# Based on NOVAS functions equ2ecl() and equ2ecl_vec().
ob2000 = 0.40909260059599012 # mean obliquity of the J2000 ecliptic in radians
return _RotateEquatorialToEcliptic([equ.x, equ.y, equ.z], ob2000, equ.t)
# Calculate nutation and obliquity for this time.
# As an optimization, the nutation angles are cached in `eqj.t`,
# and reused below when the `nutation` function is called.
et = _e_tilt(eqj.t)
# Convert J2000 mean equator (EQJ) to true equator of date (EQD).
mean_pos = _precession([eqj.x, eqj.y, eqj.z], eqj.t, _PrecessDir.From2000)
eqd_pos = _nutation(mean_pos, eqj.t, _PrecessDir.From2000)
# Rotate from EQD to true ecliptic of date (ECT).
return _RotateEquatorialToEcliptic(eqd_pos, math.radians(et.tobl), eqj.t)
def EclipticLongitude(body, time):
"""Calculates heliocentric ecliptic longitude of a body based on the J2000 equinox.
"""Calculates heliocentric ecliptic longitude of a body.
This function calculates the angle around the plane of the Earth's orbit
of a celestial body, as seen from the center of the Sun.
The angle is measured prograde (in the direction of the Earth's orbit around the Sun)
in degrees from the J2000 equinox. The ecliptic longitude is always in the range [0, 360).
in degrees from the true equinox of date. The ecliptic longitude is always in the range [0, 360).
Parameters
----------

View File

@@ -6,7 +6,7 @@ def _LoadFile(filename):
setup(
name='astronomy-engine',
version='2.1.12',
version='2.1.13',
description='Astronomy calculation for Sun, Moon, and planets.',
long_description=_LoadFile('README.md'),
long_description_content_type='text/markdown',