Documentation ¶
Overview ¶
Package horizons interfaces with the JPL Horizons online solar system data and ephemeris computation service (https://ssd.jpl.nasa.gov/horizons/).
Index ¶
Constants ¶
const AllowedLookupCharacters = `^[[:alnum:] /'\-.]+$`
AllowedLookupCharacters for the Horizons lookup API expressed as a regular expression.
Valid lookup names consist of one or more of the following characters in any combination:
alphanumeric characters;
(.) period;
( ) space;
(') apostrophe;
(/) forward slash.
Variables ¶
This section is empty.
Functions ¶
func IsAPIVersionWarning ¶
IsAPIVersionWarning reports whether the given error is a warning that the Horizons API version has changed but no other error occurred.
func IsHorizonsError ¶
IsHorizonsError reports whether the given error indicates that the error field of the Horizons query result is not empty.
Types ¶
type DatedPosition ¶
DatedPosition of a celestial object.
func Ephemeris ¶
func Ephemeris(spec EphemerisSpec) ([]DatedPosition, string, error)
Ephemeris of the given celestial object.
Positions are measured in astronomical units (au) and are given relative to the Ecliptic reference frame which has its origin at the center of the Sun body. The positions are geometric: no corrections or aberrations are applied.
The returned string may be empty. If not it will be the raw response from the Horizons API or at least some part of it.
Normally the returned data values are empty zero values if an error is returned. However, for the special case of a Horizons API version warning then data may still be returned. Since in this case the API version has changed however, there is no guarantee that the data is correct.
type EphemerisSpec ¶
EphemerisSpec specifies the range of dates over which to calculate data for a celestial object.
type LookupMatch ¶
type LookupMatch struct { Aliases []string `json:"alias"` ObjectName string `json:"name"` PrimaryDesignation string `json:"pdes"` PrimarySPKID string `json:"spkid"` }
LookupMatch is one possible match for a lookup.
func Lookup ¶
func Lookup(name string) ([]LookupMatch, error)
Lookup the given name using the Horizons Lookup API.
The search is case insensitive, but space sensitive.
func (LookupMatch) HorizonsName ¶
func (lm LookupMatch) HorizonsName() string
HorizonsName can be given to the Horizons API to produce a unique match.