From bc9e1e2a601ed627df50aaa6d04864b0ec691545 Mon Sep 17 00:00:00 2001 From: Malin E Date: Mon, 21 Mar 2022 11:50:52 +0100 Subject: [PATCH] Add Hubble trail asset and turn off ISS trail --- .../solarsystem/missions/jwst/hubble.asset | 89 +++++++++++++++++++ data/profiles/jwst.profile | 6 ++ 2 files changed, 95 insertions(+) create mode 100644 data/assets/scene/solarsystem/missions/jwst/hubble.asset diff --git a/data/assets/scene/solarsystem/missions/jwst/hubble.asset b/data/assets/scene/solarsystem/missions/jwst/hubble.asset new file mode 100644 index 0000000000..89e51683e3 --- /dev/null +++ b/data/assets/scene/solarsystem/missions/jwst/hubble.asset @@ -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" +} diff --git a/data/profiles/jwst.profile b/data/profiles/jwst.profile index d10e2ae1df..2becc75193 100644 --- a/data/profiles/jwst.profile +++ b/data/profiles/jwst.profile @@ -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": {