horizons

package
v0.0.0-...-46d2e35 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2023 License: CC0-1.0 Imports: 11 Imported by: 2

README

Package horizons

import "gitlab.com/fospathi/phyz/celestial/solsys/horizons"

Go package horizons generates ephemerides for Solar System objects by interfacing with the JPL Horizons System, an online Solar System data and ephemeris computation service.

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

View Source
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

func IsAPIVersionWarning(err error) bool

IsAPIVersionWarning reports whether the given error is a warning that the Horizons API version has changed but no other error occurred.

func IsHorizonsError

func IsHorizonsError(err error) bool

IsHorizonsError reports whether the given error indicates that the error field of the Horizons query result is not empty.

func Summary

func Summary(lm LookupMatch) (string, error)

Summary of the given celestial object.

Types

type DatedPosition

type DatedPosition struct {
	Date     celestial.JD
	Position maf.Vec
}

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

type EphemerisSpec struct {
	Object LookupMatch
	Start  celestial.JD
	Stop   celestial.JD
	Steps  int
}

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.

https://ssd-api.jpl.nasa.gov/doc/horizons_lookup.html

func (LookupMatch) HorizonsName

func (lm LookupMatch) HorizonsName() string

HorizonsName can be given to the Horizons API to produce a unique match.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL