Runnable examples demonstrating goeph features. Each example is a standalone main.go that can be run from the repository root.
# Run any example from the repo root (needed for data/de440s.bsp path)
go run ./examples/positions/
go run ./examples/apparent/| Example | Description |
|---|---|
| positions | Load a BSP ephemeris and get planet positions (core workflow) |
| apparent | Apparent positions with aberration and gravitational deflection |
| velocity | Body velocities via Chebyshev polynomial derivatives |
| observefrom | Observe from arbitrary bodies (not just Earth) |
| Example | Description |
|---|---|
| coordinates | Convert positions to RA/Dec and ecliptic coordinates |
| geodetic | Observer on Earth's surface, zenith direction |
| altaz | Altitude and azimuth for a ground observer |
| galactic | Convert positions to galactic coordinates |
| Example | Description |
|---|---|
| timescales | UTC/TT/UT1 time conversion chain, TDB-TT difference |
| sidereal | GMST, GAST, and Earth Rotation Angle |
| separation | Angular separation between the Sun and Moon |
| phase | Phase angle and fraction illuminated for planets |
| elongation | Moon elongation from Sun and lunar phase names |
| refraction | Atmospheric refraction correction at various altitudes |
| Example | Description |
|---|---|
| search | Find season changes (equinoxes/solstices) using FindDiscrete |
| almanac | Sunrise/sunset, moon phases, and seasons for a ground observer |
| eclipse | Find lunar eclipses and classify them (penumbral/partial/total) |
| Example | Description |
|---|---|
| elements | Osculating orbital elements from state vectors |
| magnitude | Planetary visual magnitudes (Mallama & Hilton 2018) |
| kepler | Kepler orbit propagation for asteroids and comets |
| Example | Description |
|---|---|
| nutation | Compare NutationStandard vs NutationFull precision modes |
| Example | Description |
|---|---|
| projection | Stereographic projection of planet positions onto a 2D plane |
| constellation | Identify which IAU constellation a planet is in |
| Example | Description |
|---|---|
| units | Working with Angle and Distance types |
| satellite | SGP4 satellite propagation from TLE |
| lunarnodes | Mean lunar node ecliptic longitudes |