JPL planetary ephemerides access software in C

A short manual for the latest version (1.5)

  • From our public FTP server ftp://ftp.astro.amu.edu.pl/pub/jpleph/version_1.5 you should download two files:
    • jplbin.h
    • testeph.c
  • From the public JPL FTP server (ssd.jpl.nasa.gov/pub/eph/planets/Linux) you should download an ephemeris file. The latest versions are DE430 (short term) and DE431(long term). They can be accessed in de430 or de431 subdirectories.
    • The short term ephemeris DE430 covers years from 1550 to 2650, the file name is linux_p1550p2650.430 and its size is slightly above 100 MB.
    • The long term ephemeris DE431covers years from -13000 to +17000, the file name is lnxm13000p17000.431 and its size is 2.8 GB !
  • In order to test your installation you should also download an appropriate test file: testpo.430 (850 kB) or testpo.431 (24 MB)

You should gather in the same directory all four files:     jplbin.h     testeph.c     ehemeris_file     test_file.

Next you should edit first two files to adjust them to the ephemeris version you want to use.

  • In the jplbin.h you shoud uncomment only one line that defined the ephemeris version. For DE431 the beginning of the jplbin.h should look like this:

/* UNCOMMENT ONE AND ONLY ONE OF THE FOLLOWING DENUM DEFINITIONS: */

/*#define DENUM 200*/
/*#define DENUM 403*/
/*#define DENUM 404*/
/*#define DENUM 405*/
/*#define DENUM 406*/
/*#define DENUM 421*/
/*#define DENUM 422*/
/*#define DENUM 430*/
#define DENUM 431
 
  • In the testeph.c file you should edit two lines specifying an ephemeris file and a test file. Assuming that you use DE431 and that all files are in the same directory (in other cases you can add appropriate paths) it these two lines should read:

/**** YOU PROBABLY HAVE TO ALTERNATE FOLLOWING TWO DEFINITIONS: ************/

#define TESTFILE "testpo.431"

#define EPHFILE  "lnxm13000p17000.431"

/***** THERE IS NO NEED TO MODIFY THE REST OF THIS SOURCE (I hope) *********/
 

In a normal situation no other edits are necessary.

  • Assuming that you have all necessary tools installed ( e.g. compiler! ):
    • just compile the testeph.c:     gcc -lm testeph.c -o testeph
    • and run:     ./testeph

The output of this run consists of a listing of all ephemeris constants and the results for all test points. In the last column there is a difference between the original value and the value obtained with my software. All differences should be smaller than 10-13.

Here are the examples of results of testing DE430 and DE431 on my computer:     res430.txt     res431.txt