GPTranslation

Inherits Translation

Members

Name

Documentation

Type

Description

Optional

File

Specifies the filename of the general pertubation file

File

Value of type ‘File’

No

Format

A NORAD-style Two-Line element Orbit Mean-Elements Message in the KVN notation JPL’s Small Bodies Database The file format that is contained in the file

String

In list { TLE, OMM, SBDB }

No

Element

Specifies the element within the file that should be used in case the file provides multiple general pertubation elements. Defaults to 1.

Integer

Greater than: 0

Yes

Inherited members from Translation

Name

Documentation

Type

Description

Optional

Type

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

String

Must name a valid Translation type

No

Asset Examples

 1local transforms = asset.require("scene/solarsystem/planets/earth/transforms")
 2local coreKernels = asset.require("spice/core")
 3
 4
 5
 6local omm = asset.resource({
 7  Name = "Satellite OMM Data (Hubble)",
 8  Type = "UrlSynchronization",
 9  Identifier = "satellite_omm_data_hst",
10  Url = "https://www.celestrak.com/NORAD/elements/gp.php?CATNR=20580&FORMAT=kvn",
11  Filename = "hst.txt",
12  SecondsUntilResync = 24 * 60 * 60
13})
14
15
16local HubblePosition = {
17  Identifier = "HubblePosition",
18  Parent = transforms.EarthInertial.Identifier,
19  Transform = {
20    Translation = {
21      Type = "GPTranslation",
22      Observer = transforms.EarthInertial.Identifier,
23      File = omm .. "hst.txt",
24      Format = "OMM"
25    },
26    Rotation = {
27      Type = "SpiceRotation",
28      SourceFrame = coreKernels.Frame.Galactic,
29      DestinationFrame = coreKernels.Frame.J2000
30    }
31  },
32  Tag = { "earth_satellite", "hubble" },
33  GUI = {
34    Name = "Hubble Position",
35    Path = "/Solar System/Planets/Earth/Satellites/Hubble",
36    Hidden = true
37  }
38}
39
40local HubbleTrail = {
41  Identifier = "HubbleTrail",
42  Parent = transforms.EarthInertial.Identifier,
43  Renderable = {
44    Type = "RenderableTrailOrbit",
45    Translation = {
46      Type = "GPTranslation",
47      Observer = transforms.EarthInertial.Identifier,
48      File = omm .. "hst.txt",
49      Format = "OMM"
50    },
51    RenderBinMode = "PostDeferredTransparent",
52    Color = { 0.0, 0.902, 0.6 },
53    Fade = 1.5,
54    Resolution = 320
55  },
56  Tag = { "earth_satellite", "hubble" },
57  GUI = {
58    Name = "Hubble Trail",
59    Path = "/Solar System/Planets/Earth/Satellites/Hubble"
60  }
61}
62
63
64asset.onInitialize(function()
65  local hubble = openspace.space.readKeplerFile(omm .. "hst.txt", "OMM")
66  HubbleTrail.Renderable.Period = hubble[1].Period / (60 * 60 * 24)
67
68  openspace.addSceneGraphNode(HubblePosition)
69  openspace.addSceneGraphNode(HubbleTrail)
70end)
71
72asset.onDeinitialize(function()
73  openspace.removeSceneGraphNode(HubbleTrail)
74  openspace.removeSceneGraphNode(HubblePosition)
75end)
76
77asset.export(HubblePosition)
78asset.export(HubbleTrail)
79
80
81
82asset.meta = {
83  Name = "Hubble Space Telescope Trail",
84  Version = "1.0",
85  Description = "Position and Trail for Hubble Space Telescope, trail from Celestrak",
86  Author = "Dan Tell",
87  URL = "www.calacademy.org",
88  License = "CC-BY"
89}