Programming Interface to the Swiss Ephemeris
Total Page:16
File Type:pdf, Size:1020Kb
Swiss Ephemeris 1 Programming interface to the Swiss Ephemeris Copyright Astrodienst AG 1997,1998,1999,2000. This document describes the proprietary programmer's interface to the Swiss Ephemeris DLL. Swiss Ephemeris is available under two different licenses: ?? Swiss Ephemeris Free Edition under the Swiss Ephemeris Public License, for use in non-commercial, Open Source projects ?? Swiss Ephemeris Professional Edition under a license with a fee, for use in commercial or non-Open-Source projects Table of contents 1. The programming steps to get a planet’s position................................................... 4 2. The functions swe_calc_ut() and swe_calc().......................................................... 6 2.1. The call parameters ......................................................................................................... 6 2.2. Error handling and return values ........................................................................................ 6 2.3. Bodies ( int ipl )............................................................................................................... 7 Additional asteroids ................................................................................................................................... 7 Fictitious planets........................................................................................................................................ 9 Obliquity and nutation...............................................................................................................................11 2.4. Options chosen by flag bits (long iflag)..............................................................................11 2.4.1. The use of flag bits..........................................................................................................................11 2.4.2. Ephemeris flags ..............................................................................................................................11 2.4.3. Speed flag......................................................................................................................................12 2.4.4. Coordinate systems, degrees and radians...........................................................................................12 2.4.5. Specialties (going beyond common interest) .......................................................................................12 a. True or apparent positions ............................................................................................12 b. Topocentric positions ...................................................................................................12 c. Heliocentric positions ...................................................................................................12 d. Barycentric positions....................................................................................................12 e. Astrometric positions ...................................................................................................13 f. True or mean equinox of date ........................................................................................13 g. J2000 positions and positions referred to other equinoxes..................................................13 h. Sidereal positions ........................................................................................................13 2.5. Position and Speed (double xx[6]).....................................................................................13 3. The function swe_get_planet_name() .................................................................. 13 4. Fixed stars functions ............................................................................................. 15 4.1 swe_fixstar_ut ................................................................................................................15 4.2 swe_fixstar() ..................................................................................................................15 5. Apsides functions .................................................................................................. 16 5.1 swe_nod_aps_ut .............................................................................................................16 5.2 swe_nod_aps() ...............................................................................................................16 6. Eclipse and planetary phenomena functions ......................................................... 17 6.1. swe_sol_eclipse_when_loc().............................................................................................17 6.2. swe_sol_eclipse_when_glob()...........................................................................................18 6.3. swe_sol_eclipse_how () ...................................................................................................18 6.4. swe_sol_eclipse_where () ................................................................................................18 6.5. swe_lun_eclipse_when ().................................................................................................19 6.6. swe_lun_eclipse_how ()...................................................................................................20 6.7. swe_rise_trans(), risings, settings, meridian transits............................................................20 6.8. swe_pheno_ut() and swe_pheno(), planetary phenomena ....................................................21 6.9. swe_azalt(), horizontal coordinates, azimuth, altitude ..........................................................22 6.10. swe_azalt_rev()............................................................................................................22 6.11. swe_refrac(), refraction .................................................................................................22 7. The date conversion functions swe_julday(), swe_date_conversion(), swe_revjul().....................23 Mean solar time versus True solar time .......................................................................................................23 8. Time functions....................................................................................................... 24 8.1 swe_deltat() ...................................................................................................................24 8.2 swe_set_tid_acc(), swe_get_tid_acc() ................................................................................24 Swiss Ephemeris 2 9. The function swe_set_topo() for topocentric planet positions.............................. 24 10. Sidereal mode functions...................................................................................... 25 10.1. swe_set_sid_mode() .....................................................................................................25 10.2. swe_get_ayanamsa_ut() and swe_get_ayanamsa() ...........................................................26 11. The Ephemeris file related functions ................................................................... 27 11.1 swe_set_ephe_path().....................................................................................................27 11.2 swe_close() ..................................................................................................................27 11.3 swe_set_jpl_file() ..........................................................................................................27 12. House cusp calculation........................................................................................ 28 12.1 swe_houses()................................................................................................................28 12.2 swe_houses_armc() .......................................................................................................28 12.3 swe_houses_ex()...........................................................................................................28 13. The sign of geographical longitudes in Swisseph functions................................. 30 14. Getting the house position of a planet with swe_house_pos() ........................... 30 15. Sidereal time with swe_sidtime() and swe_sidtime0()....................................... 30 16. Summary of SWISSEPH functions ....................................................................... 32 16.1. Calculation of planets and stars.......................................................................................32 Planets, moon, asteroids, lunar nodes, apogees, fictitious bodies ....................................................................32 Fixed stars...............................................................................................................................................32 Set the geographic location for topocentric planet computation ......................................................................32 Set the sidereal mode for sidereal planet positions........................................................................................32 16.2 Eclipses and planetary phenomena ...................................................................................33 Find the next eclipse for a given geographic position.....................................................................................33 Find the next eclipse globally .....................................................................................................................33 Compute