mirror of
https://github.com/cosinekitty/astronomy.git
synced 2026-04-15 12:08:06 -04:00
HelioState functions support user-defined stars.
This commit is contained in:
@@ -1758,7 +1758,7 @@ of reference, consider using [`BaryState`](#BaryState) instead.
|
||||
|
||||
| Type | Parameter | Description |
|
||||
| --- | --- | --- |
|
||||
| [`Body`](#Body) | `body` | The celestial body whose heliocentric state vector is to be calculated. Supported values are `Body.Sun`, `Body.SSB`, `Body.Moon`, `Body.EMB`, and all planets: `Body.Mercury`, `Body.Venus`, `Body.Earth`, `Body.Mars`, `Body.Jupiter`, `Body.Saturn`, `Body.Uranus`, `Body.Neptune`, `Body.Pluto`. |
|
||||
| [`Body`](#Body) | `body` | The celestial body whose heliocentric state vector is to be calculated. Supported values are `Body.Sun`, `Body.SSB`, `Body.Moon`, `Body.EMB`, and all planets: `Body.Mercury`, `Body.Venus`, `Body.Earth`, `Body.Mars`, `Body.Jupiter`, `Body.Saturn`, `Body.Uranus`, `Body.Neptune`, `Body.Pluto`. Also allowed to be a user-defined star created by [`DefineStar`](#DefineStar). |
|
||||
| [`Time`](#Time) | `time` | The date and time for which to calculate position and velocity. |
|
||||
|
||||
**Returns**: [`StateVector`](#StateVector)
|
||||
@@ -1781,7 +1781,7 @@ If given an invalid value for `body`, this function raises an exception.
|
||||
|
||||
| Type | Parameter | Description |
|
||||
| --- | --- | --- |
|
||||
| [`Body`](#Body) | `body` | The celestial body whose heliocentric position is to be calculated: The Sun, Moon, EMB, SSB, or any of the planets. |
|
||||
| [`Body`](#Body) | `body` | The celestial body whose heliocentric position is to be calculated: The Sun, Moon, EMB, SSB, or any of the planets. Also allowed to be a user-defined star created by [`DefineStar`](#DefineStar). |
|
||||
| [`Time`](#Time) | `time` | The time at which to calculate the heliocentric position. |
|
||||
|
||||
**Returns**: [`Vector`](#Vector)
|
||||
|
||||
@@ -4503,6 +4503,7 @@ def HelioVector(body, time):
|
||||
body : Body
|
||||
The celestial body whose heliocentric position is to be calculated:
|
||||
The Sun, Moon, EMB, SSB, or any of the planets.
|
||||
Also allowed to be a user-defined star created by #DefineStar.
|
||||
time : Time
|
||||
The time at which to calculate the heliocentric position.
|
||||
|
||||
@@ -4910,6 +4911,7 @@ def HelioState(body, time):
|
||||
Supported values are `Body.Sun`, `Body.SSB`, `Body.Moon`, `Body.EMB`, and all planets:
|
||||
`Body.Mercury`, `Body.Venus`, `Body.Earth`, `Body.Mars`, `Body.Jupiter`,
|
||||
`Body.Saturn`, `Body.Uranus`, `Body.Neptune`, `Body.Pluto`.
|
||||
Also allowed to be a user-defined star created by #DefineStar.
|
||||
time : Time
|
||||
The date and time for which to calculate position and velocity.
|
||||
|
||||
@@ -4956,6 +4958,10 @@ def HelioState(body, time):
|
||||
time
|
||||
)
|
||||
|
||||
if _IsUserDefinedStar(body):
|
||||
vec = HelioVector(body, time)
|
||||
return StateVector(vec.x, vec.y, vec.z, 0.0, 0.0, 0.0, time)
|
||||
|
||||
raise InvalidBodyError(body)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user