HorizonsTranslation
Inherits Translation
Computes an object’s position from ephemeris data files exported from JPL Horizons. It is intended for bodies whose motion is best represented by sampled positional data over time rather than by an analytic orbit model.
The class reads one or more Horizons text files and converts their contents into a time-ordered position timeline. At runtime, it evaluates the object’s position by interpolating between the surrounding keyframes, which produces smooth motion across the sampled interval. If the requested time falls outside the covered range, it returns the nearest available position at the start or end of the dataset.
This makes HorizonsTranslation well suited for objects whose trajectories come directly from external ephemeris products, such as spacecraft, planets, moons, asteroids, or observational targets generated through Horizons. It is particularly useful when authoritative trajectory samples are preferred over simplified orbital parameterization.
The implementation also supports combining multiple Horizons files into a single translation timeline. New samples are merged while avoiding duplicate timestamps, which allows a trajectory to be assembled from multiple exports or extended over longer time spans.
Members
Name |
Documentation |
Type |
Description |
Optional |
|---|---|---|---|---|
|
This value is the path to the file or files generated by Horizons with either a Vector table or an Observer table with the correct settings. |
|
Value of type ‘File’, or Value of type ‘Table’ |
No |
|
The type of translation that is described in this element. The available types of translations depend on the configuration of the application and can be written to disk on application startup into the FactoryDocumentation. |
|
Must name a valid Translation type |
No |
|
The time frame in which this |
|
Yes |
Inherited members from Translation
Name |
Documentation |
Type |
Description |
Optional |
|---|---|---|---|---|
|
The type of translation that is described in this element. The available types of translations depend on the configuration of the application and can be written to disk on application startup into the FactoryDocumentation. |
|
Must name a valid Translation type |
No |
|
The time frame in which this |
|
Yes |
Asset Examples
1local sunAsset = asset.require("scene/solarsystem/sun/transforms")
2
3
4
5local trajectory = asset.resource({
6 Name = "3I/ATLAS Trajectory",
7 Type = "HttpSynchronization",
8 Identifier = "atlas_horizons",
9 Version = 1
10})
11
12
13local AtlasPosition = {
14 Identifier = "3I_AtlasPosition",
15 Parent = sunAsset.SolarSystemBarycenter.Identifier,
16 Transform = {
17 Translation = {
18 Type = "HorizonsTranslation",
19 HorizonsTextFile = trajectory .. "i3_atlas.hrz"
20 }
21 },
22 GUI = {
23 Name = "3I/ATLAS",
24 Path = "/Solar System/Interstellar/ATLAS",
25 Description = [[Position of 3I/ATLAS from 2020 JUL 01 00:00:00 to 2030 JUL 01
26 00:00:00. Data from JPL Horizons.]]
27 }
28}
29
30
31asset.onInitialize(function()
32 openspace.addSceneGraphNode(AtlasPosition)
33end)
34
35asset.onDeinitialize(function()
36 openspace.removeSceneGraphNode(AtlasPosition)
37end)
38
39-- As the identifier starts with a number, it is not a valid Lua identifier
40asset.export("AtlasPosition", AtlasPosition)
41
42
43
44asset.meta = {
45 Name = "3I/ATLAS Position",
46 Description = [[This asset contains the position of 3I/ATLAS from 2020 JUL 01 00:00:00
47 to 2030 JUL 01 00:00:00. Data from JPL Horizons.]],
48 Author = "OpenSpace Team",
49 URL = "https://ssd.jpl.nasa.gov/horizons.cgi",
50 License = "NASA"
51}