|
HORIZONS Batch-Interface
This tool provides a web-based batch-mode interface to
JPL's HORIZONS system
which can be used to generate ephemerides for solar-system bodies.
To use this tool, you will need to fully understand the format
and content of Horizons's E-mail interface
and also how to properly submit the required URL.
Please submit one job at a time (not simultaneously).
If you have several jobs, you can automate your submission such that
as soon as one job finishes, the next is submitted.
The general concept for web-based batch submission is that you
take your Horizons batch input file, convert it to an
appropriate URL, then process the Horizons output.
For example, given the following input file,
!$$SOF
COMMAND= '499'
MAKE_EPHEM= 'YES'
TABLE_TYPE= 'OBSERVER'
START_TIME= '2000-01-01'
STOP_TIME= '2000-12-31'
STEP_SIZE= '15 d'
QUANTITIES= '1,9,20,23,24'
CSV_FORMAT= 'YES'
|
you should form the corresponding URL for submission:
https://ssd.jpl.nasa.gov/horizons_batch.cgi?batch=1&COMMAND;='499'&MAKE;_EPHEM='YES'
&TABLE;_TYPE='OBSERVER'&START;_TIME='2000-01-01'&STOP;_TIME='2000-12-31'&STEP;_SIZE='15%20d'
&QUANTITIES;='1,9,20,23,24'&CSV;_FORMAT='YES'
(Note that the above URL should be a single line and is only separated for readability.)
|
Essentially, the URL is formed by discarding all comments from the input file,
including the "!$$SOF" directive, removing extraneous spaces from both sides
of the '=', and escaping any special URL characters.
For example, spaces should be converted to '%20'.
Similarly for characters '?' (%3F), '&' (%26) and ';' (%3B).
If the content of a parameter contains line-endings (e.g. "TLE="),
those line-endings must also be escaped
(e.g., carriage-returns converted to '%0D' and line-feeds converted to '%0A').
There may be others as well.
A sample Perl script
to read an input file from STDIN, submit the HTTP request using the
CPAN
LWP::UserAgent
module, and display the results
is available here.
It should be possible to write such scripts in other languages and using other HTTP methods as well.
You should ensure your script checks for error messages.
Ideally, check for the expected Horizons output and if not found, assume an error occurred.
Please note that appended to the output from a successful Horizons job
is the formatted version of your input parameters which were used by Horizons
(i.e. in the form described for use by the E-mail batch interface).
This is designed to assist in case of errors from Horizons or other unexpected
output.
|