Ephem
Description
ephem is a wrapper for libnova a "general purpose, double precision, Celestial Mechanics, Astrometry and Astrodynamics library."
Author
Repository
https://github.com/RobAltenburg/ephem5
Requirements
Installation
ephem requires libnova v0.16. That version is available from the git repository.
Note: It has been reported that the libnova library has returned incorrect results when run under debian linux in a VM. Please verify that the included test routines function correctly.
Procedures
The libnova modules documentation provides essential details. Main differences from that library are:
- ephem function names are separated with dashes instead of underscores and the "ln" or "ln_get" prefix is omitted.
- ephem functions are not passed structures to hold results--when necessary they allocate and return a new object of the required foreign type.
Data Types
Rise, Set, Transit
[procedure] (make-rst #!optional rise set transit)Returns a ln_rst_time foreign record type. If rise, set, or transit is not specified an empty structure is allocated and returned.
Rise, set, and transit are Julian dates.
Note that I didn't expose the setters to mutate existing records of a given type.
[procedure] (rst-rise rst)[procedure] (rst-set rst)
[procedure] (rst-transit rst)
Rectangular Coordinates
[procedure] (make-rect #!optional x y x)[procedure] (rect-x rect)
[procedure] (rect-y rect)
[procedure] (rect-z rect)
Heliocentric Coordinates
[procedure] (make-helio #!optional l b r)[procedure] (helio-l helio)
[procedure] (helio-b helio)
[procedure] (helio-r helio)
Longitude and Latitude
[procedure] (make-ecl #!optional longitude latitude)[procedure] (ecl-lng ecl)
[procedure] (ecl-lat ecl)
Equatorial Coordinates
[procedure] (make-equ #!optional ra dec)Note: Right ascension and declination are both expressed in degrees, right ascensions given in h:m:s must be converted:
(hms->deg 12 30 1)
[procedure] (equ-ra equ)
[procedure] (equ-dec equ)
Horizontal Coordinates
[procedure] (make-hrz #!optional azimuth altitude)[procedure] (hrz-az hrz)
[procedure] (hrz-alt hrz)
Hours, Minutes, Seconds
[procedure] (make-hms #!optional hours minuts seconds)[procedure] (hms-hours hms)
[procedure] (hms-minutes hms)
[procedure] (hms-seconds hms)
Nutation
[procedure] (make-nutation #!optional longitude obliquity ecliptic)[procedure] (nutation-longitude nutation)
[procedure] (nutation-obliquity nutation)
[procedure] (nutation-ecliptic nutation)
Orbital Elements
Elliptic Orbital Elements
[procedure] (make-ell #!optional a e i w omega n jd)[procedure] (ell-a ell)
[procedure] (ell-e ell)
[procedure] (ell-i ell)
[procedure] (ell-w ell)
[procedure] (ell-omega ell)
[procedure] (ell-n ell)
[procedure] (ell-jd ell)
Hyperbolic Orbital Elements
[procedure] (make-hyp #!optional q e i w omega jd)[procedure] (hyp-q hyp)
[procedure] (hyp-e hyp)
[procedure] (hyp-i hyp)
[procedure] (hyp-w hyp)
[procedure] (hyp-omega hyp)
[procedure] (hyp-jd hyp)
Parabolic Orbital Elements
[procedure] (make-par #!optional q i w omega jd)[procedure] (par-q par)
[procedure] (par-i par)
[procedure] (par-w par)
[procedure] (par-omega par)
[procedure] (par-jd par)
Sidereal Time
[procedure] (gmst jd)[procedure] (gast jd)
[procedure] (lmst jd longitude)
[procedure] (last jd longitude)
Utility
[procedure] (get-version)[procedure] (rad->deg rad)
[procedure] (deg->rad deg)
[procedure] (hms->deg hms)
[procedure] (deg->hms deg)
[procedure] (get-date)
[procedure] (vsop87->fk5 helio jd)
Rise, Set, Transit
[procedure] (object-rst jd ecl-observer equ-object)[procedure] (object-next-rst jd ecl-observer equ-object)
[procedure] (object-next-rst-horizon jd ecl-observer equ-object horizon)
[procedure] (body-rst-horizon jd ecl-observer body-object horizon)
[procedure] (body-next-rst-horizon jd ecl-observer body-object horizon)
[procedure] (body-next-rst-horizon-future jd ecl-observer body-object horizon day-limit)
Motion
Elliptic Motion
[procedure] (solve-kepler e M)[procedure] (ell-mean-anomaly n delta-jd)
[procedure] (ell-true-anomaly e E)
[procedure] (ell-radius-vector a e E)
[procedure] (ell-smajor-diam e q)
[procedure] (ell-sminor-diam e a)
[procedure] (ell-mean-motion a)
[procedure] (ell-geo-rect-posn ell jd)
[procedure] (ell-helio-rect-posn ell jd)
[procedure] (ell-orbit-len ell)
[procedure] (ell-orbit-vel jd ell)
[procedure] (ell-orbit-pvel ell)
[procedure] (ell-orbit-avel ell)
[procedure] (ell-body-phase-angle jd ell)
[procedure] (ell-body-elong jd ell)
[procedure] (ell-body-solar-dist jd ell)
[procedure] (ell-body-earth-dist jd ell)
[procedure] (ell-body-equ-coords jd ell)
[procedure] (ell-body-rst jd ecl)
[procedure] (ell-body-rst-horizon jd ecl ell horizon)
[procedure] (ell-body-next-rst-horizon jd ecl ell horizon)
[procedure] (ell-body-next-rst-horizon-future jd ecl ell horizon day-limit)
[procedure] (ell-last-perihelion epoch-jd M n)
Hyperbolic Motion
[procedure] (solve-hyp-barker Q1 G t)[procedure] (hyp-true-anomaly q e t)
[procedure] (hyp-radius-vector q e t)
[procedure] (hyp-geo-rect-posn h)
[procedure] (hyp-helio-rect-posn hyp jd)
[procedure] (hyp-body-equ-coords jd hyp)
[procedure] (hyp-body-earth-dist jd hyp)
[procedure] (hyp-body-solar-dist jd hyp)
[procedure] (hyp-body-phase-angle jd hyp)
[procedure] (hyp-body-elong jd hyp)
[procedure] (hyp-body-rst jd ecl hyp)
[procedure] (hyp-body-rst-horizon jd ecl hyp horizon)
[procedure] (hyp-body-next-rst-horizon jd ecl hyp horizon)
[procedure] (hyp-body-next-rst-horizon-future jd ecl hyp horizon day-limit)
Parabolic Motion
[procedure] (solve-barker q t)[procedure] (par-true-anomaly q t)
[procedure] (par-radius-vector q t)
[procedure] (par-geo-rect-posn par jd)
[procedure] (par-helio-rect-posn par jd)
[procedure] (par-body-equ-coords jd par)
[procedure] (par-body-earth-dist jd par)
[procedure] (par-body-solar-dist jd par)
[procedure] (par-body-phase-angle jd par)
[procedure] (par-body-elong jd par)
[procedure] (par-body-rst jd ecl par)
[procedure] (par-body-rst-horizon jd ecl par horizon)
[procedure] (par-body-next-rst-horizon jd ecl par horizon)
[procedure] (par-body-next-rst-horizon-future jd ecl par horizon day-limit)
Bodies
Sun
[procedure] (solar-rst-horizon jd ecl horizon)[procedure] (solar-rst jd ecl)
[procedure] (solar-geom-coords jd)
[procedure] (solar-equ-coords jd)
[procedure] (solar-ecl-coords jd)
[procedure] (solar-geo-coords jd)
[procedure] (solar-sdiam jd)
Earth
[procedure] (earth-helio-coords jd)[procedure] (earth-solar-dist jd)
[procedure] (earth-rect-helio jd)
[procedure] (earth-centre-dist height latitude)
Moon
[procedure] (lunar-phase jd)[procedure] (lunar-disk jd)
[procedure] (lunar-sdiam jd)
[procedure] (lunar-earth-dist jd)
[procedure] (lunar-bright-limb jd)
[procedure] (lunar-long-asc-node jd)
[procedure] (lunar-long-perigee jd)
[procedure] (lunar-equ-coords jd precision)
[procedure] (lunar-rst jd ecl)
[procedure] (lunar-geo-posn jd precision)
[procedure] (lunar-equ-coords-prec jd precision)
[procedure] (lunar-ecl-coords jd precision)
Mercury
[procedure] (mercury-sdiam jd)[procedure] (mercury-rst jd ecl)
[procedure] (mercury-helio-coords jd)
[procedure] (mercury-equ-coords jd)
[procedure] (mercury-earth-dist jd)
[procedure] (mercury-solar-dist jd)
[procedure] (mercury-magnitude jd)
[procedure] (mercury-disk jd)
[procedure] (mercury-phase jd)
[procedure] (mercury-rect-helio jd)
Venus
[procedure] (venus-sdiam jd)[procedure] (venus-rst jd ecl)
[procedure] (venus-helio-coords jd)
[procedure] (venus-equ-coords jd)
[procedure] (venus-earth-dist jd)
[procedure] (venus-solar-dist jd)
[procedure] (venus-magnitude jd)
[procedure] (venus-disk jd)
[procedure] (venus-phase jd)
[procedure] (venus-rect-helio jd)
Mars
[procedure] (mars-sdiam jd)[procedure] (mars-rst jd ecl)
[procedure] (mars-helio-coords jd)
[procedure] (mars-equ-coords jd)
[procedure] (mars-earth-dist jd)
[procedure] (mars-solar-dist jd)
[procedure] (mars-magnitude jd)
[procedure] (mars-disk jd)
[procedure] (mars-phase jd)
[procedure] (mars-rect-helio jd)
Jupiter
[procedure] (jupiter-equ-sdiam jd)[procedure] (jupiter-pol-sdiam jd)
[procedure] (jupiter-rst jd ecl)
[procedure] (jupiter-helio-coords jd)
[procedure] (jupiter-equ-coords jd)
[procedure] (jupiter-earth-dist jd)
[procedure] (jupiter-solar-dist jd)
[procedure] (jupiter-magnitude jd)
[procedure] (jupiter-disk jd)
[procedure] (jupiter-phase jd)
[procedure] (jupiter-rect-helio jd)
Saturn
[procedure] (saturn-equ-sdiam jd)[procedure] (saturn-pol-sdiam jd)
[procedure] (saturn-rst jd ecl)
[procedure] (saturn-helio-coords jd)
[procedure] (saturn-equ-coords jd)
[procedure] (saturn-earth-dist jd)
[procedure] (saturn-solar-dist jd)
[procedure] (saturn-magnitude jd)
[procedure] (saturn-disk jd)
[procedure] (saturn-phase jd)
[procedure] (saturn-rect-helio jd)
Uranus
[procedure] (uranus-sdiam jd)[procedure] (uranus-rst jd ecl)
[procedure] (uranus-helio-coords jd)
[procedure] (uranus-equ-coords jd)
[procedure] (uranus-earth-dist jd)
[procedure] (uranus-solar-dist jd)
[procedure] (uranus-magnitude jd)
[procedure] (uranus-disk jd)
[procedure] (uranus-phase jd)
[procedure] (uranus-rect-helio jd)
Neptune
[procedure] (neptune-sdiam jd)[procedure] (neptune-rst jd ecl)
[procedure] (neptune-helio-coords jd)
[procedure] (neptune-equ-coords jd)
[procedure] (neptune-earth-dist jd)
[procedure] (neptune-solar-dist jd)
[procedure] (neptune-magnitude jd)
[procedure] (neptune-disk jd)
[procedure] (neptune-phase jd)
[procedure] (neptune-rect-helio jd)
Pluto
[procedure] (pluto-sdiam jd)[procedure] (pluto-rst jd ecl)
[procedure] (pluto-helio-coords jd)
[procedure] (pluto-equ-coords jd)
[procedure] (pluto-earth-dist jd)
[procedure] (pluto-solar-dist jd)
[procedure] (pluto-magnitude jd)
[procedure] (pluto-disk jd)
[procedure] (pluto-phase jd)
[procedure] (pluto-rect-helio jd)
Misc
[procedure] (heliocentric-time-diff jd equ)[procedure] (refraction-adj altitude atm-pressure temp)
[procedure] (equ-aberration equ jd)
[procedure] (ecl-aberration equ jd)
[procedure] (dynamical-time-diff jde)
[procedure] (jde jd)
[procedure] (angular-separation equ equ)
[procedure] (rel-posn-angle equ equ)
[procedure] (constellation)
[procedure] (apparent-posn equ-mean equ-proper jd)
[procedure] (nutation jd)
[procedure] (equ-prec equ-mean jd)
[procedure] (equ-prec2 equ-mean jd jd)
[procedure] (ecl-prec ecl jd)
[procedure] (ell-comet-mag jd ell g k)
[procedure] (par-comet-mag jd par g k)
Transforms
[procedure] (hrz-from-equ equ ecl jd)[procedure] (hrz-from-equ-sidereal-time equ ecl sidereal)
[procedure] (equ-from-ecl ecl jd)
[procedure] (ecl-from-equ equ jd)
[procedure] (rect-from-helio helio)
[procedure] (ecl-from-rect rect)
[procedure] (equ-from-gal gal)
[procedure] (equ2000-from-gal gal)
[procedure] (gal-from-equ equ)
[procedure] (gal-from-equ2000 equ)
Non-Libnova
[procedure] (range-hours hours)[procedure] (range-degrees degrees)
[procedure] (range-degrees180 degrees)
[procedure] (is-above-horizon? equ ecl jd)
[procedure] (dms->deg dms)
[procedure] (hms->hr hms)
Examples
(import ephem) (define dd 2457734.16667) ; set the longitude and latitude of the observer (define my-ecl (make-ecl -76.8867 40.2732)) ; calculate the Sun's rise, set, and transit using different methods (define rst (solar-rst dd my-ecl)) ; print the Julian date of the rise time (display (rst-rise rst)) (newline)
License
LGPL-3.0
Version History
- 1.0 Initial Release