mirror of
https://github.com/cosinekitty/astronomy.git
synced 2026-01-21 22:08:45 -05:00
I'm not going to use type annotations in function signatures because they are causing more problems than they are worth. The last straw was that different versions of Python don't generate the same text representation. This broke my Travis CI tests.
58 lines
1.4 KiB
Markdown
58 lines
1.4 KiB
Markdown
---
|
|
|
|
<a name="functions"></a>
|
|
## Functions
|
|
|
|
|
|
---
|
|
|
|
<a name="BodyCode"></a>
|
|
### BodyCode(name)
|
|
Finds the Body enumeration value, given the name of a body.
|
|
|
|
name: str
|
|
The common English name of a supported celestial body.
|
|
|
|
Body
|
|
If `name` is a valid body name, returns the enumeration
|
|
value associated with that body.
|
|
Otherwise, returns `Body.Invalid`.
|
|
|
|
|
|
>>> astronomy.BodyCode('Mars')
|
|
<Body.Mars: 3>
|
|
|
|
|
|
|
|
---
|
|
|
|
<a name="GeoMoon"></a>
|
|
### GeoMoon(time)
|
|
Calculates the geocentric position of the Moon at a given time.
|
|
|
|
Given a time of observation, calculates the Moon's position as a vector.
|
|
The vector gives the location of the Moon's center relative to the Earth's center
|
|
with x-, y-, and z-components measured in astronomical units.
|
|
|
|
This algorithm is based on Nautical Almanac Office's *Improved Lunar Ephemeris* of 1954,
|
|
which in turn derives from E. W. Brown's lunar theories from the early twentieth century.
|
|
It is adapted from Turbo Pascal code from the book
|
|
[Astronomy on the Personal Computer](https://www.springer.com/us/book/9783540672210)
|
|
by Montenbruck and Pfleger.
|
|
|
|
time : Time
|
|
The date and time for which to calculate the Moon's position.
|
|
|
|
Vector
|
|
The Moon's position as a vector in J2000 Cartesian equatorial coordinates.
|
|
|
|
|
|
|
|
---
|
|
|
|
<a name="unique"></a>
|
|
### unique(enumeration)
|
|
Class decorator for enumerations ensuring unique member values.
|
|
|
|
|