Add Hubble trail asset and turn off ISS trail

This commit is contained in:
Malin E
2022-03-21 11:50:52 +01:00
parent c57fc64b81
commit bc9e1e2a60
2 changed files with 95 additions and 0 deletions

View File

@@ -0,0 +1,89 @@
local transforms = asset.require('scene/solarsystem/planets/earth/transforms')
local satelliteHelper = asset.require('util/tle_helper')
local url = "https://celestrak.com/satcat/tle.php?CATNR=20580"
local identifier = "HST"
local filename = "HST.txt"
local nodes = {}
local tle = satelliteHelper.downloadTLEFile(asset, url, identifier, filename)
local initializeAndAddNodes = function()
local lineElement = satelliteHelper.makeSingleLineElement(tle, filename)
local period = satelliteHelper.getPeriodFromElement(lineElement)
local path = tle .. "/" .. filename
local HubblePosition = {
Identifier = "HubblePosition",
Parent = transforms.EarthInertial.Identifier,
Transform = {
Translation = {
Type = "TLETranslation",
Body = identifier,
Observer = transforms.EarthInertial.Identifier,
File = path,
LineNumber = 1
},
Rotation = {
Type = "SpiceRotation",
SourceFrame = "GALACTIC",
DestinationFrame = "J2000",
}
},
Tag = { "earth_satellite", "hubble" },
GUI = {
Name = "Hubble Position",
Path = "/Solar System/Planets/Earth/Satellites/Hubble",
Hidden = true
}
}
local HubbleTrail = {
Identifier = "HubbleTrail",
Parent = transforms.EarthInertial.Identifier,
Renderable = {
Type = "RenderableTrailOrbit",
Translation = {
Type = "TLETranslation",
Body = identifier,
Observer = transforms.EarthInertial.Identifier,
File = path,
LineNumber = 1
},
RenderBinMode = "PostDeferredTransparent",
Color = { 0.0, 0.902, 0.6},
Fade = 1.5,
Period = period,
Resolution = 320
},
Tag = { "earth_satellite", "hubble" },
GUI = {
Name = "Hubble Trail",
Path = "/Solar System/Planets/Earth/Satellites/Hubble"
}
}
return { HubblePosition, HubbleTrail }
end
asset.onInitialize(function ()
nodes = initializeAndAddNodes()
for _, node in ipairs(nodes) do
openspace.addSceneGraphNode(node)
end
end)
asset.onDeinitialize(function ()
for i=1, #nodes do
openspace.removeSceneGraphNode(nodes[#nodes + 1 - i].Identifier)
end
end)
asset.meta = {
Name = "Hubble Space Telescope",
Version = "1.0",
Description = [[ Position and Trail for Hubble Space Telescope, trail from
celestrak.com]],
Author = "Dan Tell",
URL = "www.calacademy.org",
License = "CC-BY"
}

View File

@@ -84,6 +84,7 @@
"scene/solarsystem/missions/jwst/jwst",
"scene/solarsystem/missions/jwst/trail",
"scene/solarsystem/missions/jwst/hudf",
"scene/solarsystem/missions/jwst/hubble",
"scene/solarsystem/missions/jwst/timelapse",
"scene/solarsystem/missions/jwst/toggle_trail",
"scene/digitaluniverse/hdf"
@@ -308,6 +309,11 @@
"name": "Scene.Earth.Renderable.Layers.ColorLayers.ESRI_VIIRS_Combo.Enabled",
"type": "setPropertyValueSingle",
"value": "false"
},
{
"name": "Scene.ISS_trail.Renderable.Enabled",
"type": "setPropertyValueSingle",
"value": "false"
}
],
"time": {