Welcome, Guest

Author Topic: How to create Horizon Files  (Read 13877 times)

Dan Dixon

  • Creator of Universe Sandbox
  • Developer
  • *****
  • Posts: 3244
    • Personal Site
How to create Horizon Files
« on: August 28, 2009, 08:10:38 PM »
Here's how to automatically extract data from NASA's Horizon System. The Horizon system is an online service that will tell you the position of almost any body in our Solar System. These numbers can be plugged directly into Universe Sandbox to create new systems.

Here's the website:
http://ssd.jpl.nasa.gov/?horizons



If you only need the data for one or two bodies it's probably much easier to extract it manually from their website, but if you need data for five or more, this method will help dramatically. This is the method used to create all of the Horizon files that ship with Universe Sandbox.



A Universe Sandbox horizon file is a list of positions and velocities for various bodies at a specific date. They let you create multiple system/simulation files that share this data (so you don't have multiple copies of the same data in multiple files).

For example, 'Our Solar System.xml' and 'Earth & Moon' both gets their data from LocalObjects.xml and Horizon-2008-01-01.xml.



How to create a Horizon File

Send NASA an email to:
horizons@ssd.jpl.nasa.gov

With the subject:
Job

And a body that looks something like this:

Code: [Select]
!$$SOF

EMAIL_ADDR=''

START_TIME = '1990-Jan-01 00:00:00'
STOP_TIME = '1990-Jan-01 00:00:01'
TABLE_TYPE = 'Vector'
REF_PLANE = 'Ecliptic'
CENTER = '@010'
COMMAND=

10
199
299
399
499
599
699
799
899
999
1;
136199;

!$$EOF


After a few minutes you'll get back an email for each object (which is totally strange). You can't set a single date for some reason, you have to ask for two (start and stop). Universe Sandbox only reads the starting date. Note that the Horizon ID numbers with ';' are different than those without (you can get these many of these numbers from the LocalObject.xml and other data files) . The above COMMAND numbers are the sun, 8 planets, Pluto, Ceres, & Eris.

Save the text of all of these email to a single text file called 'data.txt'. I use Outlook and can do this by selecting all the emails and then exporting them to a single txt file with just a few clicks.
(For GMail instructions see post below)

Put the 'data.txt' file in (My) Documents\Universe Sandbox\Systems.

Start Universe Sandbox

Then with the main menu visible (in Universe Sandbox)... Press Shift+~ (the Tilde key). It will either say 'created Horizon data' or 'data file missing'.

Other key combos to note:
Ctrl+~ = Debug Info
Alt+~ = Saves current camera position to clipboard to add to system files

In the system folder you should find a new file called "Horizon.xml". You can open this file up to test it, but it's designed to be renamed with a date and then referenced by other system/simulation files.

If you use a HorizonID (the numbers in the COMMAND section of the email) that the Horizon email system doesn't have data for it just stops processing the rest of the bodies and sends you an error. (This can happen if you request moons discovered in 2000 when you're asking for data from 1974).

Please let me know if you need more help with this or have any problems. Feel free to send me your data.txt file if you run into problems.

(Note: If NASA ever changes the formatting of the emailed results, it will likely break Universe Sandbox's internal parser.)
« Last Edit: August 30, 2009, 09:27:25 PM by Dan Dixon »

atomic7732

  • Global Moderator
  • *****
  • Posts: 3849
  • caught in the river turning blue
    • Paladin of Storms
Re: How to create Horizon Files
« Reply #1 on: August 28, 2009, 09:03:48 PM »
I get it in how to email, but how would I get my specific objects. I remember the Horizons Automator that Tony made... But, it didn't half work, and I got it to work, like once. Then, I got the emais and put them in the place, or whatever, and the button didn't work. HA and GS have some problems. I always have problems with those. Gladly, (I hope I don't jenx myself) I don't get problems, except minor bugs, and XML problems. :)

Dan Dixon

  • Creator of Universe Sandbox
  • Developer
  • *****
  • Posts: 3244
    • Personal Site
Re: How to create Horizon Files
« Reply #2 on: August 29, 2009, 02:24:18 AM »
Replies to NeutronStar are here:
http://universesandbox.com/forum/index.php/topic,728.0.html

Can someone else try pressing Shift+~ and report if they see the "Horizon Data file not found" message?

The main menu must be visible in order for the key press to work.

atomic7732

  • Global Moderator
  • *****
  • Posts: 3849
  • caught in the river turning blue
    • Paladin of Storms
Re: How to create Horizon Files
« Reply #3 on: August 29, 2009, 01:29:18 PM »
If I can ever get this to work, I am so making an:

...Aten...
...Apollo...
...Amor...
...Halley-Type Comets...

...one!

Chaotic Cow

  • Universe Sandbox 1 Beta Team
  • *****
  • Posts: 588
  • President of Bovine Relations
    • Facebook
Re: How to create Horizon Files
« Reply #4 on: August 29, 2009, 04:29:54 PM »
@Dan - Yes it did appear.

Dan Dixon

  • Creator of Universe Sandbox
  • Developer
  • *****
  • Posts: 3244
    • Personal Site
Re: How to create Horizon Files
« Reply #5 on: August 30, 2009, 07:50:09 PM »
How to create the data.txt file if you use GMail

Short Version
Use a free program called Thunderbird (and an addon) to download your gmail messages and save them as a single text file.


Long Version

1
Enable POP access in Gmail
http://mail.google.com/support/bin/answer.py?answer=13273
(Be sure to set "When messages are accessed with POP" to "Keep Gmail's copy in Inbox")

2
Download and Install Thunderbird
http://www.mozillamessaging.com/

3
When you start Thunderbird, select Gmail, enter you login information and Thunderbird will begin downloading your Gmail

If you need help consult this:
http://mail.google.com/support/bin/answer.py?answer=86399
(I would not follow step 8 which says to uncheck "Leave messages on server". Leave this checked unless you know what you're doing.)

4
Now download this Thunderbird Addon (it lets you save multiple emails into one file):
(right click and select "Save Link As...")
http://nic-nac-project.de/~kaosmos/ImportExportTools-2.3.xpi

5
And install it in Thunderbird:
- Select "Tools" > "Addons" (or "Extensions") and click on "Install"
- Find the xpi file you downloaded (in step 4) and follow the instructions
- Restart Thunderbird

Here's the website for the addon:
http://nic-nac-project.de/~kaosmos/mboximport-en.html

6
Now create a new folder in Thunderbird.
Copy all of the NASA Horizon emails you want to combine into the folder.

7
Select the new folder and then from the menu:
- Select "Tools" > "ImportExportTools" > "Export all messages in the folder" > "Plain text format (one file)"

Select a folder to save the export to. (The addon will create a new folder in the folder you select and save all the emails into a single text file)

8
Rename this text file to 'data.txt'
Put the 'data.txt' file in (My) Documents\Universe Sandbox\Systems

9
Open up Universe Sandbox and press Shift+~ to create the horizon file.
« Last Edit: August 30, 2009, 09:22:47 PM by Dan Dixon »