chickadee » ephem

Ephem

Description

ephem is a wrapper for libnova a "general purpose, double precision, Celestial Mechanics, Astrometry and Astrodynamics library."

Author

Rob Altenburg

Requirements

numbers, srfi-19, foreigners

Installation

ephem requires libnova v0.16. That version is available from the git repository.

Procedures

The libnova modules documentation provides essential details. Main differences from that library are:

Data Types

Rise, Set, Transit
make-rst #!optional rise set transitprocedure

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 as returned by srfi-19's (date->julian-day) function.

Note that I didn't expose the setters to mutate existing records of a given type.

rst-rise rstprocedure
rst-set rstprocedure
rst-transit rstprocedure
Rectangular Coordinates
make-rect #!optional x y xprocedure
rect-x rectprocedure
rect-y rectprocedure
rect-z rectprocedure
Heliocentric Coordinates
make-helio #!optional l b rprocedure
helio-l helioprocedure
helio-b helioprocedure
helio-r helioprocedure
Longitude and Latitude
make-ecl #!optional longitude latitudeprocedure
ecl-lng eclprocedure
ecl-lat eclprocedure
Equatorial Coordinates
make-equ #!optional ra decprocedure

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)
equ-ra equprocedure
equ-dec equprocedure
Horizontal Coordinates
make-hrz #!optional azimuth altitudeprocedure
hrz-az hrzprocedure
hrz-alt hrzprocedure
Hours, Minutes, Seconds
make-hms #!optional hours minuts secondsprocedure
hms-hours hmsprocedure
hms-minutes hmsprocedure
hms-seconds hmsprocedure
Nutation
make-nutation #!optional longitude obliquity eclipticprocedure
nutation-longitude nutationprocedure
nutation-obliquity nutationprocedure
nutation-ecliptic nutationprocedure
Orbital Elements
Elliptic Orbital Elements
make-ell #!optional a e i w omega n jdprocedure
ell-a ellprocedure
ell-e ellprocedure
ell-i ellprocedure
ell-w ellprocedure
ell-omega ellprocedure
ell-n ellprocedure
ell-jd ellprocedure
Hyperbolic Orbital Elements
make-hyp #!optional q e i w omega jdprocedure
hyp-q hypprocedure
hyp-e hypprocedure
hyp-i hypprocedure
hyp-w hypprocedure
hyp-omega hypprocedure
hyp-jd hypprocedure
Parabolic Orbital Elements
make-par #!optional q i w omega jdprocedure
par-q parprocedure
par-i parprocedure
par-w parprocedure
par-omega parprocedure
par-jd parprocedure

Sidereal Time

gmst jdprocedure
gast jdprocedure
lmst jd longitudeprocedure
last jd longitudeprocedure

Utility

get-versionprocedure
rad->deg radprocedure
deg->rad degprocedure
hms->deg hmsprocedure
deg->hms degprocedure
get-dateprocedure
vsop87->fk5 helio jdprocedure

Rise, Set, Transit

object-rst jd ecl-observer equ-objectprocedure
object-next-rst jd ecl-observer equ-objectprocedure
object-next-rst-horizon jd ecl-observer equ-object horizonprocedure
body-rst-horizon jd ecl-observer body-object horizonprocedure
body-next-rst-horizon jd ecl-observer body-object horizonprocedure
body-next-rst-horizon-future jd ecl-observer body-object horizon day-limitprocedure

Motion

Elliptic Motion
solve-kepler e Mprocedure
ell-mean-anomaly n delta-jdprocedure
ell-true-anomaly e Eprocedure
ell-radius-vector a e Eprocedure
ell-smajor-diam e qprocedure
ell-sminor-diam e aprocedure
ell-mean-motion aprocedure
ell-geo-rect-posn ell jdprocedure
ell-helio-rect-posn ell jdprocedure
ell-orbit-len ellprocedure
ell-orbit-vel jd ellprocedure
ell-orbit-pvel ellprocedure
ell-orbit-avel ellprocedure
ell-body-phase-angle jd ellprocedure
ell-body-elong jd ellprocedure
ell-body-solar-dist jd ellprocedure
ell-body-earth-dist jd ellprocedure
ell-body-equ-coords jd ellprocedure
ell-body-rst jd eclprocedure
ell-body-rst-horizon jd ecl ell horizonprocedure
ell-body-next-rst-horizon jd ecl ell horizonprocedure
ell-body-next-rst-horizon-future jd ecl ell horizon day-limitprocedure
ell-last-perihelion epoch-jd M nprocedure
Hyperbolic Motion
solve-hyp-barker Q1 G tprocedure
hyp-true-anomaly q e tprocedure
hyp-radius-vector q e tprocedure
hyp-geo-rect-posn hprocedure
hyp-helio-rect-posn hyp jdprocedure
hyp-body-equ-coords jd hypprocedure
hyp-body-earth-dist jd hypprocedure
hyp-body-solar-dist jd hypprocedure
hyp-body-phase-angle jd hypprocedure
hyp-body-elong jd hypprocedure
hyp-body-rst jd ecl hypprocedure
hyp-body-rst-horizon jd ecl hyp horizonprocedure
hyp-body-next-rst-horizon jd ecl hyp horizonprocedure
hyp-body-next-rst-horizon-future jd ecl hyp horizon day-limitprocedure
Parabolic Motion
solve-barker q tprocedure
par-true-anomaly q tprocedure
par-radius-vector q tprocedure
par-geo-rect-posn par jdprocedure
par-helio-rect-posn par jdprocedure
par-body-equ-coords jd parprocedure
par-body-earth-dist jd parprocedure
par-body-solar-dist jd parprocedure
par-body-phase-angle jd parprocedure
par-body-elong jd parprocedure
par-body-rst jd ecl parprocedure
par-body-rst-horizon jd ecl par horizonprocedure
par-body-next-rst-horizon jd ecl par horizonprocedure
par-body-next-rst-horizon-future jd ecl par horizon day-limitprocedure

Bodies

Sun
solar-rst-horizon jd ecl horizonprocedure
solar-rst jd eclprocedure
solar-geom-coords jdprocedure
solar-equ-coords jdprocedure
solar-ecl-coords jdprocedure
solar-geo-coords jdprocedure
solar-sdiam jdprocedure
Earth
earth-helio-coords jdprocedure
earth-solar-dist jdprocedure
earth-rect-helio jdprocedure
earth-centre-dist height latitudeprocedure
Moon
lunar-phase jdprocedure
lunar-disk jdprocedure
lunar-sdiam jdprocedure
lunar-earth-dist jdprocedure
lunar-bright-limb jdprocedure
lunar-long-asc-node jdprocedure
lunar-long-perigee jdprocedure
lunar-equ-coords jd precisionprocedure
lunar-rst jd eclprocedure
lunar-geo-posn jd precisionprocedure
lunar-equ-coords-prec jd precisionprocedure
lunar-ecl-coords jd precisionprocedure

Mercury

mercury-sdiam jdprocedure
mercury-rst jd eclprocedure
mercury-helio-coords jdprocedure
mercury-equ-coords jdprocedure
mercury-earth-dist jdprocedure
mercury-solar-dist jdprocedure
mercury-magnitude jdprocedure
mercury-disk jdprocedure
mercury-phase jdprocedure
mercury-rect-helio jdprocedure
Venus
venus-sdiam jdprocedure
venus-rst jd eclprocedure
venus-helio-coords jdprocedure
venus-equ-coords jdprocedure
venus-earth-dist jdprocedure
venus-solar-dist jdprocedure
venus-magnitude jdprocedure
venus-disk jdprocedure
venus-phase jdprocedure
venus-rect-helio jdprocedure
Mars
mars-sdiam jdprocedure
mars-rst jd eclprocedure
mars-helio-coords jdprocedure
mars-equ-coords jdprocedure
mars-earth-dist jdprocedure
mars-solar-dist jdprocedure
mars-magnitude jdprocedure
mars-disk jdprocedure
mars-phase jdprocedure
mars-rect-helio jdprocedure
Jupiter
jupiter-equ-sdiam jdprocedure
jupiter-pol-sdiam jdprocedure
jupiter-rst jd eclprocedure
jupiter-helio-coords jdprocedure
jupiter-equ-coords jdprocedure
jupiter-earth-dist jdprocedure
jupiter-solar-dist jdprocedure
jupiter-magnitude jdprocedure
jupiter-disk jdprocedure
jupiter-phase jdprocedure
jupiter-rect-helio jdprocedure
Saturn
saturn-equ-sdiam jdprocedure
saturn-pol-sdiam jdprocedure
saturn-rst jd eclprocedure
saturn-helio-coords jdprocedure
saturn-equ-coords jdprocedure
saturn-earth-dist jdprocedure
saturn-solar-dist jdprocedure
saturn-magnitude jdprocedure
saturn-disk jdprocedure
saturn-phase jdprocedure
saturn-rect-helio jdprocedure
Uranus
uranus-sdiam jdprocedure
uranus-rst jd eclprocedure
uranus-helio-coords jdprocedure
uranus-equ-coords jdprocedure
uranus-earth-dist jdprocedure
uranus-solar-dist jdprocedure
uranus-magnitude jdprocedure
uranus-disk jdprocedure
uranus-phase jdprocedure
uranus-rect-helio jdprocedure
Neptune
neptune-sdiam jdprocedure
neptune-rst jd eclprocedure
neptune-helio-coords jdprocedure
neptune-equ-coords jdprocedure
neptune-earth-dist jdprocedure
neptune-solar-dist jdprocedure
neptune-magnitude jdprocedure
neptune-disk jdprocedure
neptune-phase jdprocedure
neptune-rect-helio jdprocedure
Pluto
pluto-sdiam jdprocedure
pluto-rst jd eclprocedure
pluto-helio-coords jdprocedure
pluto-equ-coords jdprocedure
pluto-earth-dist jdprocedure
pluto-solar-dist jdprocedure
pluto-magnitude jdprocedure
pluto-disk jdprocedure
pluto-phase jdprocedure
pluto-rect-helio jdprocedure

Misc

heliocentric-time-diff jd equprocedure
refraction-adj altitude atm-pressure tempprocedure
equ-aberration equ jdprocedure
ecl-aberration equ jdprocedure
dynamical-time-diff jdeprocedure
jde jdprocedure
angular-separation equ equprocedure
rel-posn-angle equ equprocedure
constellationprocedure
apparent-posn equ-mean equ-proper jdprocedure
nutation jdprocedure
equ-prec equ-mean jdprocedure
equ-prec2 equ-mean jd jdprocedure
ecl-prec ecl jdprocedure
ell-comet-mag jd ell g kprocedure
par-comet-mag jd par g kprocedure

Transforms

hrz-from-equ equ ecl jdprocedure
hrz-from-equ-sidereal-time equ ecl siderealprocedure
equ-from-ecl ecl jdprocedure
ecl-from-equ equ jdprocedure
rect-from-helio helioprocedure
ecl-from-rect rectprocedure
equ-from-gal galprocedure
equ2000-from-gal galprocedure
gal-from-equ equprocedure
gal-from-equ2000 equprocedure

Non-Libnova

range-hours hoursprocedure
range-degrees degreesprocedure
range-degrees180 degreesprocedure
is-above-horizon? equ ecl jdprocedure
dms->deg dmsprocedure
hms->hr hmsprocedure

Examples

(use numbers srfi-19 ephem)

; set time using srfi-19
(define dd (exact->inexact (date->julian-day 
                             (make-date 0 0 30 7 13 12 2016 (* 3600 0)  #f))))

; 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

Contents »