The current original JPL page on the planetary ephemerides is here
The ANSI C language version of the software for accessing JPL planetary ephemerides.
This software is available as a "public domain". You can download it from this page or from our FTP server.
All suggestions, bug reports or questions should be sent directly to the author:
Piotr A. Dybczyński, (dybol@amu.edu.pl)
Please send me a word if you use my software with success also.
Release 1.6.1, June 15, 2024
Files for the release 1.6.1:
It has been pointed to me (thanks to Tess Harding) that there is an inconsistency between jplbin.h and official binary ephemeris files from JPL.
When preparing my software update in March 2021 I noticed that the binary ephemerides are not available. It was one of the reasons I revived my asc2eph.c code and produce binary ephemerides for my own usage.
According to JPL fortran asc2eph.f (lines 101-102 and 197-198) I added new lines handling RPT and TPT arrays.
After my notification that binary files are missing Ryan S. Park produced and made public the missing ephemerides in binary format. But he used older asc2eph.f code in which RPT and TPT arrays are not put into the binary file first record (in contrary to the official documentation).
For a long time I used my own binary ephemerides so the handling of RPT and TPT in my jplbin.h header file was necessary.
As you can read in ascii_format.txt (see: https://ssd.jpl.nasa.gov/ftp/eph/planets/ascii/ascii_format.txt)
at JPL they introduced RPT and TPT arrays almost ten years ago but in the most popular ephemerides (both 430/431 and 440/441) they do not include Lunar mantle angular velocity and TT-TDB which can be verified looking at the appropriate header files, where the corresponding RPT and TPT elements are equal to zero. Moreover observe that Lunar mantle angular velocity and TT-TDB values are absent in all testpo files.
For that reason I have not implemented reading of these parameters from the binary files in my latest testeph.c
But in the testeph1.f (lines 705 - 742) you can find the full implementation which I will have to incorporate in future versions.
In summary:
In version 1.6.1 I decided to comment out all lines handling these arrays both in jplbin.h and asc2eph.c.
The code of testeph.c remains unchanged, except for some additional comments.
Release 1.6, April 18, 2021
I have learned recently (the spring 2021) that the FTP protocol has been depreciated in many popular web browsers so I decided to put the necessary files available for download directly from this page (but our FTP server is still working and this new release is available there).
Files for the release 1.6:
There are two important changes in this software since the release 1.5:
- In the jplbin.h file the definitions for DE440 and DE441 were added.
- I have revived the old asc2eph.c program for two reasons:
- there were no binary files at the JPL server when I started to use the DE440 ephemeris. Happily now the Linux binary files are available.
- binary ephemeris files are now very large so a user might wish to create smaller ephemeris, covering some sub-interval.
I have added several new definitions to the end of the jplbih.h file to allow asc2eph.c program to work with different ephemeris versions.
According to my tests this software works correctly on both 64 bit and 32 bit Linux systems. The tests were performed under Debian 10 with the default gcc version (8.3.0).
Release 1.5, March 25, 2020
The only important change is in jplbin.h file. Explicit rules for packing structures were added because of some changes in the default gcc behavior.
As a result this software works correctly both on 64 bit and 32 bit Linux systems.
In the testeph.c file the usage of 'long int' has been abandoned since it is identical with 'int' with current releases of the gcc compiler.
Release 1.4, March 13, 2014
Release (1.4) works with DE200, DE403, DE404, DE405, DE406, DE421, DE422, DE430 and DE431.
CHANGES FROM RELEASE 1.3:
added support for DE430 and DE431. The main change is to allow for more than 400 ephemeris constants, as required in case of DE430 and DE431. Some minor improvements are also done. Works in a standard, 32-bit Linux environment.
The original JPL data files, FORTRAN code and documentation can be found at:
http://ssd.jpl.nasa.gov/?planet_eph_export
Release 1.3, February 19, 2012
Release (1.3) works with DE200, DE403, DE404, DE405, DE406, DE421 and DE422.
CHANGES FROM RELEASE 1.2:
added support for DE421 and DE422. In fact only some definitions were added to the jplbin.h header file. The testeph.c file is a copy of that file from version 1.2. Only the formulas for calculating the differences between test points and calculated values are updated in accordance with the JPL Fortran file testeph.f . All other sources and files are obsolete, since Linux binary ephemerides can be obtained from JPL.
Release 1.2, June 23, 1997 (this README.txt file was updated March 1, 2008)
File list at the FTP server:
Size date time file 10218 2007-04-20 10:38 asc2eph.c 6405 2007-04-20 10:38 conv.c 9098 2007-04-20 10:38 convm.c 1892 2007-04-20 10:39 jplbin.h 5759 2007-04-20 10:47 readme.txt 33421 2007-04-20 10:39 testeph.c 409808 1998-06-03 00:00 testpo1.405
CHANGES FROM RELEASE 1.1:
- added support for DE405 and DE406,
- ASC2EPH.C can work with incomplete source file set,
- added CONVM.C - new program for converting and merging multiple binary files,
- bug in libration calculations fixed,
- some minor changes and bug fixes
The original JPL data files, FORTRAN code and documentation can be found at: http://ssd.jpl.nasa.gov/?planet_eph_export
This release (1.2) works with DE200, DE403, DE404, DE405 and DE406.
This file describes public domain software for using and manipulating JPL export planetary ephemerides, written in C language.
In original JPL export packages you can find several FORTRAN source files for reading and testing ephemerides.
Here you can find C versions of ASC2EPH and TESTEPH programs and additional two programs: CONV and CONVM, for converting original JPL supplied Unix binary files to DOS/LINUX binaries, without using any additional source files. Please note, that we assume you do not rename any of the original, JPL supplied files.
ASC2EPH.C and TESTEPH.C are manual translations of the original JPL FORTRAN code, slightly changed and adapted for C language. They are designed to keep FORTRAN-based structure of the binary ephemeris files so they can be shared between C and Fortran programmers working both under DOS and LINUX on PC-based machines. ASC2EPH uses original JPL supplied source (ASCII) ephemeris files. There is no need for editing them to replace 'D' with 'E' in exponent parts of double precision numbers.
IT IS NECESSARY TO ADJUST MANUALLY SOURCE FILES before you compile and run them. First, look at the file: JPLBIN.H, used by ASC2EPH.c and TESTEPH.C It contains the definition of DENUM, JPL ephemeris number. Some variables obtain their values depending on DENUM (eg. RECSIZE - the record size ). Second, look at lines with fopen() calls in ASC2EPH.C, TESTEPH.C and CONV.C Adjust them for your environment, adding a path before filenames where necessary.
Program CONV.C is an additional tool for obtaining DOS/LINUX, FORTRAN/C binary files with JPL ephemerides DIRECTLY from JPL supplied binary Unix files (*.unx). It simply reverses the order of bytes in each integer (4 byte) and double (8 byte) number stored in the single JPL Unix binary file found on the original CD-ROM for example. Additionally it can produce the subset of the whole ephemeris - you have to specify starting and final JED epochs.
New program (release 1.2): CONVM.C is designed for simultaneous merging and converting original JPL supplied binary UNIX files (you can obtain them from an anonymous FTP site: ftp://ssd.jpl.nasa.gov/pub/eph/planets ) into a single, binary ephemeris file, readable with FORTRAN and C under both DOS and Linux. It works similarly to CONV.C. You can specify smaller interval of time than the original ephemeris time span.
All source files are rich of comments and ( I hope ) therefore are self explanatory.
On July 8, 1997 JPL released corrected file TESTPO.405, without fictitious "test points" for 5-th and 6-th components of nutation. You can find this file at: ftp://ssd.jpl.nasa.gov/pub/eph/planets/test-data. There is a new file: testpo.406 there!
PLEASE NOTE that due to including of nutation and librations in the test points file (GREAT!) you can expect differences greater than 1.0e-13 when using TESTEPH program. Some values of librations have more than three digits before decimal point and we do not have 17 significant digits on PC-based machines! JPL have changed (June 23 version of TESTEPH.F) the formula for the difference calculation from absolute (del = |xc-xo|) to relative: del = |xc-xo|/(|xc|+|xo|). I have applied this correction in my software and found that now almost all del values are greater than 1e-13, generating software alert. So I decided to comment out this modification. Instead I used the old formula and I found that for all points in TESTPO.405 I have obtained del < 1e-13. This happened even for libration value for JD=2524897.5: 19440.0251465376386. My calculated value was: 19440.0251465376386 ! I have 18 correct significant digits ! I have not switched to long double type, I still use standard 8 byte double precision arithmetic .
All suggestions, bug reports or questions may be directed to the author:
Piotr A. Dybczyński, (dybol@amu.edu.pl)
Please send me a word if you use my software with success also.