Orbital Elements

Using Orbital Elements for Ephemeris Objects


Orbital elements are specified in a file whose name ends with .eph in the /home/obs/xxx directory, where xxx is the observer's initials. The orbital elements should be calculated for the current date. That is, they need to be corrected for perturbations by the major planets, etc. How long the elements are valid depends on the object and the nearest perturbers. A comet ephemeris is usually good enough for a week. A minor planet ephemeris generally lasts longer before it diverges significantly. (One can check the accuracy by checking the RA and Dec on the Status screen with the geocentric position of the object calculated by JPL, for example. Or one can check how well a new ephemeris agrees with an older one as described below.

Generating an ephemeris file:

The JPL Horizons Ephemeris Generator and the Minor Planet Center normally give only elements for a standard epoch. However, there is a way to get JPL Horizons to perturb the standard elements to a particular date. (See here  or "telnet ssd.jpl.nasa.gov 6775"). A script has been written to enter the cryptic commands required in the telnet session and to extract the relevant data to a file. The obs login defines an alias, get_elem, to execute this script.

The syntax is:

get_elem <object> <file> [-d <date>]

where <object> is the object name and <file> is the file to which the elements are to be written. Optional <date> (default: today's date) is the date of the elements. <date> is any format OK for the --date option of the Unix date command. The object name must be one recognized by JPL Horizons. Although the script will write to any <file>, only files ending in ".eph" in the observer's /home/obs/xxx directory will be found by Rambo or Catalog.

For example, Comet T7/Linear is known as C/2002 T7 to Horizons. So to write the elements to a file linear.eph:

get_elem C/2002 T7 linear.eph

for the current date, and

get_elem C/2002 T7 linear.eph -d Jan 1 2005

gets elements for New Years Day 2005.

get_elem Ceres ceres.eph -d + 2 days

gets elements of Ceres for two days from now.

Note that the <object> name is allowed to contain more than one word. The last item/word before the -d (if any) is assumed to be the <file>. Everything before that is assumed to be the <object> name. Also the optional <date> can have several items. Therefore, the -d, if present, must follow <file>.

While the script executes, you will see on your screen the chatter between the script and JPL. As JPL sends escape sequences to query/set terminal characteristics, there will at first be some complaints about "unknown character", "window size could not be determined", ... These are normal and can be ignored. Finally, there will be a Horizons> prompt and the script will start entering the proper commands. There should be no further complaints and you do NOT need to enter any responses. After logging out, the script will look in the transcript of the session for the orbital elements. If it finds some, it will offer to strip out the extraneous information. This is recommended, but if you want to examine the full transcript type n. (The control system will ignore the extraneous lines when it reads the file.)

If the name is not recognized, there WILL be complaints from JPL, but the script will press on as if the name had been accepted. When the script ends, it should notice that there are no elements. If so, it will say that the name was not recognized and offer to delete the file. Sometimes the file will contain a list of objects it does recognize. If so, one might want to look for the proper name in the file and try again. Or one might use the JPL Ephemeris Generator to first find the correct spelling of the desired <object>.

The Horizons program accepts several different formats for <object>, nevertheless it can also be picky about the syntax. The program identifies an object by either Name or Designator or JPL ID/record number. For example, the asteroid Ixion is known by the Name (Ixion), the ID number (28978), and the Designator (2001 KX76). When it parses <object>, it decides which of these it must be (by an undocumented rule). One can force this choice to Name or Designator by proceeding it by NAME= or DES=. Names are sensitive to spaces but not to upper/lower case. Designators are sensitive to both. (For comets, uppercase Designators are generally used.) An asterisk following the Name/Designator means that the specified string is only a portion of the full Name/Designator. If this syntax is used, the result is likely to be a list of possible objects. This will confuse the script, but you may be able to find the desired object in the list and try again with that Name/Designator. A list can also be the result if a Name (of the discoverer) is used for a comet. For example, Linear produces a long list of possibilities. However, Machholz produces only one and can therefore be used for <object> in the script.

The contents of the ephemeris file:

If one has orbital elements obtained by some other means, one can edit them into a file manually.

Examples of the resulting file are:

JPL/HORIZONS LINEAR (C/2002 T7) 2004-Jul-30 09:57:17
Target body name: LINEAR {source: JPL#101}
2453216.500000000 = A.D. 2004-Jul-30 00:00:00.0000 (CT)
EC= 1.000579811794336E+00 QR= 6.146040606354138E-01 IN= 1.605839228587721E+02
OM= 9.486200689632537E+01 W = 1.577392612818464E+02 Tp= 2.453118562257732E+06
N = 2.855890186103608E-05 MA= 2.796994369930558E-03 TA= 1.108776736275935E+02
A =-1.060006137577697E+03 AD= 6.684586454211886E+91 PR= 1.157407291666667E+95


JPL/HORIZONS 1 Ceres 2004-Aug-12 00:38:17
Target body name: 1 Ceres {source: JPL#24}
2453229.500000000 = A.D. 2004-Aug-12 00:00:00.0000 (CT)
EC= 7.992012709846702E-02 QR= 2.546086744651279E+00 IN= 1.058127394159551E+01
OM= 8.045842154832782E+01 W = 7.392231842318330E+01 Tp= 2.453196905874877E+06
N = 2.141078427394553E-01 MA= 6.978657816056472E+00 TA= 8.213143605798097E+00
A = 2.767245344278671E+00 AD= 2.988403943906063E+00 PR= 1.681395671423763E+03

One can put comments in the file because the control system ignores all lines in the file except a line beginning "JPL/HORIZONS" and the lines from $$SOE to $$EOE. The $$ lines bracket the lines containing the ephemeris elements, so to keep from confusing the software, it would be best not to put comments here.

Changing the name of the object:

The "JPL/HORIZONS" line is used to specify the object name. The name used is taken starting from the third item in this line. If this item begins a parenthetical expression [such as (C/2002 T7) above], the name is this expression with underscores substituted for the blanks and without the parentheses. (The control system doesn't allow object names to be more than one word.) Otherwise, the name is simply the third item in the line. Thus in the above two examples the, names would be C/2002_T7 and Ceres. One is free to edit this line to change the name of the object.

The remaining lines in the file:

The "Target body" line is ignored, but retained in the file to document the source of orbital elements (in braces).

The line following $$SOE contains the Julian date of the perihelion passage. (The "=" and the rest of the line is ignored.) The lines following this up to the $$EOE line contain the orbital elements in keyword=value format. The keywords may be given in any order. The ones needed are:

EC Eccentricity, e
QR Periapsis distance, q (AU)
IN Inclination w.r.t xy-plane, i (degrees)
OM Longitude of Ascending Node, OMEGA, (degrees)
W Argument of Perifocus, w (degrees)
Tp Time of periapsis (Julian day number)
N Mean motion, n (degrees/day)
MA Mean anomaly, M (degrees)
A Semi-major axis, a (AU)

The remaining 3 in the JPL output are ignored:

TA True anomaly, nu (degrees)
AD Apoapsis distance (AU)
PR Orbital period (day)

Checking an older ephemeris against a newer one:

The first step is to change the name of the object in one of the ephemeris files. Next have the operator load the two files into Rambo. The Rambo catalog screen should now show both objects. Run the script:

check_ephem <old name> <new name>

This will produce output such as:

           RA      Dec     Az       El    Vel
new     11.58888 4.0805 279.0674 -6.3566 10.972
- old:   0.00000 0.0000   0.0001  0.0000  0.004

with <new name> substituted for "new" and <old name> for "old".

The "new" line contains the current RA, Dec, Az, El, and Vel of the <new name> object (RA in hours, Vel in km/sec, the rest in degrees). The "- old" line is the difference between the <new name> and the <old name> ephemerides.


Generating an ephemeris table for Comets and Minor Objects:

Sometimes, orbital elements will not work in the cactus control system and we need to resort to using the older method of ephemeris tables. We have writing a few scripts and programs to generate the proper formatted files.

  1. cd to ~tfolkers/cactus/ephem

  2. Make a new directory for you object.

    1. mkdir new_obj_dir

  3. cd to that new directory.

  4. cp ../Examples/*.request .

  5. Both example files contain the appropriate Long/Lat/Elevation for their respective telescope locations.

    1. Rename either the Example-kp.request or the Example-mg.request or both, depending on your needs.

    2. Edit your new file and change the following to the correct values:

      1. EMAIL_ADDR

        1. Where the resulting email will be sent.

      2. COMMAND

        1. Requested object. You may have to go to the Horizon web site and search out the object first to get the proper catalog and naming convention. Leave the ';NOFRAG' part.

      3. START_TIME

        1. Beginning of anticipated observing period minus a few hours/days.

      4. STOP_TIME

        1. Make sure Start_time and Stop_time cover the range of intended observations.

      5. STEP_SIZE

        1. Make sure the Step_size is appropriate for the object. Fast moving objects need smaller intervals; say '1 h'. Don't go courser then '1 d'.

        2. Make sure the (Step_size * number_of_days) doesn't produce a resulting file > 4096 elements.

  6. Once the request file is ready, it needs to be sent to JPL/Horizons email server:

    1. Type the following to send:

      1. ../send_mail.csh your_objectfile.request

        1. NOTE: You can cut and paste the request file directly into your email client and then send to: horizons@ssd.jpl.nasa.gov, Subject: JOB

        2. Make sure there are no other text elements in the file, like signatures etc.

  7. You should get a CC of the email sent and then, in <1 minute a reply from JPL

  8. Assuming no errors from JPL, save the resulting email, in .eml format, to the same directory as the request files.

  9. To convert the .eml file to the final table:

    1. ../parse -n table_number -i jpl-reply.eml -o your_obj.eph

    2. Where:

      1. table_number should be any number > 20.

      2. jpl-reply.eml is the JPL reply email

      3. your_obj.eph is the name of the output file to be loaded into the telescope control system (must end in .eph)

  10. sftp the resulting file to [modelo | smtoast]:/home/obs/'ini', where 'ini' are your initials.

  11. Edit the resulting file and make sure it looks OK:

    1. The name should not have any spaces or special characters in it. Just letters, numbers and '+-_'.

    2. When finished, the file should look similar to this:


# Source PANSTARRS_(C/2016_R2)

# Infile comet-R2_PS-kp.eml

# OutFile C-2016-R2.eph


EPHEM 22 D 67.625421 D 37.402609 J 58209.000000 2.97 17.51 C_2016_R2

EPHEM 22 D 67.701020 D 37.455930 J 58209.250000 2.97 17.73

EPHEM 22 D 67.778733 D 37.509260 J 58209.500000 2.97 17.32

EPHEM 22 D 67.856649 D 37.563397 J 58209.750000 2.97 17.04

EPHEM 22 D 67.933126 D 37.617416 J 58210.000000 2.96 17.37

EPHEM 22 D 68.010081 D 37.670526 J 58210.250000 2.96 17.58

EPHEM 22 D 68.089146 D 37.723654 J 58210.500000 2.96 17.17

EPHEM 22 D 68.168394 D 37.777590 J 58210.750000 2.96 16.89

EPHEM 22 D 68.246204 D 37.831398 J 58211.000000 2.95 17.22

EPHEM 22 D 68.324512 D 37.884295 J 58211.250000 2.95 17.42

EPHEM 22 D 68.404926 D 37.937221 J 58211.500000 2.95 17.02

EPHEM 22 D 68.485502 D 37.990954 J 58211.750000 2.95 16.74

EPHEM 22 D 68.564642 D 38.044550 J 58212.000000 2.94 17.07