Skip to main content

Crate sweph_sys

Crate sweph_sys 

Source
Expand description

Raw FFI bindings to the Swiss Ephemeris C library.

The C sources (v2.10.03, pinned in vendor/UPSTREAM_COMMIT) are vendored and compiled by build.rs with TLSOFF, so the library keeps one process-wide state (ephemeris path, open file handles, caches) shared by all threads. The Swiss Ephemeris is not thread-safe: callers must serialize every call into this crate. The companion sweph crate does that behind a mutex and is the recommended entry point; use these raw bindings directly only if you provide equivalent locking.

Swiss Ephemeris is © Astrodienst AG, dual-licensed AGPL-3.0 or the Swiss Ephemeris Professional License. This crate is distributed under AGPL-3.0.

Constants§

SEFLG_ASTROMETRIC
SEFLG_BARYCTR
SEFLG_EPHMASK
Mask of the ephemeris-source bits. swe_calc_ut returns the flags it actually used — compare against this mask to detect a silent fallback (e.g. Swiss requested, Moshier substituted because data files are absent).
SEFLG_EQUATORIAL
SEFLG_HELCTR
SEFLG_J2000
SEFLG_JPLEPH
SEFLG_MOSEPH
SEFLG_NOABERR
SEFLG_NOGDEFL
SEFLG_NONUT
SEFLG_RADIANS
SEFLG_SIDEREAL
SEFLG_SPEED
SEFLG_SPEED3
SEFLG_SWIEPH
SEFLG_TOPOCTR
SEFLG_TRUEPOS
SEFLG_XYZ
SE_AST_OFFSET
Add a minor-planet catalogue number to this offset to address any numbered asteroid (requires the corresponding se*.se1 asteroid file).
SE_CERES
SE_CHIRON
SE_EARTH
SE_ECL_ANNULAR
SE_ECL_ANNULAR_TOTAL
SE_ECL_CENTRAL
SE_ECL_NONCENTRAL
SE_ECL_PARTIAL
SE_ECL_PENUMBRAL
SE_ECL_TOTAL
SE_GREG_CAL
SE_JUL_CAL
SE_JUNO
SE_JUPITER
SE_MARS
SE_MAX_STNAME
Size the C API requires for serr error-message buffers (AS_MAXCH).
SE_MEAN_APOG
SE_MEAN_NODE
SE_MERCURY
SE_MOON
SE_NEPTUNE
SE_OSCU_APOG
SE_PALLAS
SE_PHOLUS
SE_PLUTO
SE_SATURN
SE_SIDM_DELUCE
SE_SIDM_FAGAN_BRADLEY
SE_SIDM_KRISHNAMURTI
SE_SIDM_LAHIRI
SE_SIDM_RAMAN
SE_SUN
SE_TRUE_NODE
SE_URANUS
SE_VENUS
SE_VESTA

Functions§

swe_calc
swe_calc_ut
swe_close
swe_deltat
swe_get_ayanamsa_ex_ut
swe_get_planet_name
swe_house_name
swe_houses
swe_houses_ex
swe_julday
swe_lun_eclipse_when
swe_revjul
swe_set_ephe_path
swe_set_sid_mode
swe_set_topo
swe_sol_eclipse_when_glob
swe_utc_to_jd
swe_version