Merge pull request #2085 from OpenSpace/feature/jwst-spice-update

Feature/jwst spice update
This commit is contained in:
Malin E
2022-05-06 15:21:53 +02:00
committed by GitHub
6 changed files with 176 additions and 66 deletions

View File

@@ -17,13 +17,16 @@ local band = asset.syncedResource({
Version = 1
})
local launchTime = "2021 DEC 25 12:20:00"
local endTime = "2024 JAN 22 00:00:00"
local JWSTBand = {
Identifier = "JWSTBand",
Parent = transforms.JWSTPosition.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = "2021 DEC 25 12:50:00",
End = "2024 JAN 22"
Start = launchTime,
End = endTime
},
Transform = {
Rotation = {
@@ -59,8 +62,8 @@ local JWSTModel = {
Parent = transforms.JWSTRotation.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = "2021 DEC 25 12:50:00",
End = "2024 JAN 22"
Start = launchTime,
End = endTime
},
Renderable = {
Type = "RenderableModel",
@@ -91,8 +94,8 @@ local JWSTFov = {
Parent = JWSTModel.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = "2021 DEC 25 12:50:00",
End = "2024 JAN 22"
Start = launchTime,
End = endTime
},
Renderable = {
Type = "RenderablePrism",
@@ -124,8 +127,8 @@ local JWSTLabel = {
Parent = transforms.JWSTPosition.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = "2021 DEC 25 12:50:00",
End = "2024 JAN 22"
Start = launchTime,
End = endTime
},
Renderable = {
Type = "RenderableLabels",

View File

@@ -13,29 +13,36 @@ local function advance(time, days, hours, minutes, seconds)
end
local launchTime = "2021-12-25T12:20:00.000"
local dataStartTime = "2021-12-25T12:50:00.000"
local detachTime = "2021-12-25T12:50:00.000"
local actionsList = {}
-- JWST timelapse timeline, forwards
local function createForwardTimelapse()
local timelapse = [[
-- Mission start, setup 1 sec after, reset night layer
-- Mission start, setup 2 sec after, reset night layer
openspace.scriptScheduler.loadScheduledScript("]] ..
advance(dataStartTime, 0, 0, 0, 1) .. [[",
advance(launchTime, 0, 0, 0, 2) .. [[",
"openspace.setPropertyValueSingle(\"Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Settings.Gamma\", 1.0)" ..
"openspace.setPropertyValueSingle(\"Scene.EarthAtmosphere.Renderable.Enabled\", true)"
)
-- Mission start, GO 2 sec after
-- Mission start, GO 3 sec after
openspace.scriptScheduler.loadScheduledScript("]] ..
advance(dataStartTime, 0, 0, 0, 2) .. [[",
"openspace.time.interpolateDeltaTime(2)" ..
"openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 2 seconds/second\")"
advance(launchTime, 0, 0, 0, 3) .. [[",
"openspace.time.interpolateDeltaTime(5)" ..
"openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 5 seconds/second\")"
)
-- Speed up when reaching higher altitude
openspace.scriptScheduler.loadScheduledScript("]] ..
advance(launchTime, 0, 0, 2, 0) .. [[",
"openspace.time.interpolateDeltaTime(300)" ..
"openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 5 minutes/second\")"
)
-- array deploy
openspace.scriptScheduler.loadScheduledScript("]] ..
advance(launchTime, 0, 0, 30, 20 - 1) .. [[", -- 1 sec pre delay
advance(launchTime, 0, 0, 30 - 2, 20 - 40) .. [[", -- 2 min 40 sec pre delay
"openspace.time.interpolateDeltaTime(1)" ..
"openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 1 second/second\")"
)
@@ -49,7 +56,7 @@ local function createForwardTimelapse()
-- Make night layer more visible, at around 14:00
openspace.scriptScheduler.loadScheduledScript("]] ..
advance(dataStartTime, 0, 1, 10, 0) .. [[",
advance(detachTime, 0, 1, 10, 0) .. [[",
"openspace.setPropertyValueSingle(\"Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Settings.Gamma\", 0.7)" ..
"openspace.setPropertyValueSingle(\"Scene.EarthAtmosphere.Renderable.Enabled\", false)"
)
@@ -253,8 +260,6 @@ local function createBackwardTimelapse()
advance(launchTime, 0, 0, 30, 20) .. [[",
"",
"openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"\")" ..
"openspace.setPropertyValueSingle(\"Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Settings.Gamma\", 1.0)" ..
"openspace.setPropertyValueSingle(\"Scene.EarthAtmosphere.Renderable.Enabled\", true)" ..
"openspace.scriptScheduler.clear(0)"
)
@@ -275,7 +280,7 @@ local function createBackwardTimelapse()
-- Reset night layer, at around 14:00
openspace.scriptScheduler.loadScheduledScript("]] ..
advance(dataStartTime, 0, 1, 10, 0) .. [[",
advance(detachTime, 0, 1, 10, 0) .. [[",
"",
"openspace.setPropertyValueSingle(\"Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Settings.Gamma\", 1.0)" ..
"openspace.setPropertyValueSingle(\"Scene.EarthAtmosphere.Renderable.Enabled\", true)"
@@ -499,7 +504,7 @@ local function createActions()
openspace.scriptScheduler.clear(0)
openspace.time.setDeltaTime(1)
openspace.setPropertyValueSingle("Dashboard.JWSTStateText.Text", "")
openspace.time.setTime("]] .. dataStartTime .. [[")
openspace.time.setTime("]] .. advance(launchTime, 0, 0, 0, 1) .. [[")
]] .. createForwardTimelapse() .. [[
openspace.time.setDeltaTime(1)
]],
@@ -508,6 +513,22 @@ local function createActions()
IsLocal = false
}
local playFromDetach = {
Identifier = "jwst.play.detach",
Name = "Play JWST from detach",
Command = [[
openspace.scriptScheduler.clear(0)
openspace.time.setDeltaTime(1)
openspace.setPropertyValueSingle("Dashboard.JWSTStateText.Text", "")
openspace.time.setTime("]] .. detachTime .. [[")
]] .. createForwardTimelapse() .. [[
openspace.time.setDeltaTime(1)
]],
Documentation = "Jump to the JWST detach time and play the timelapse of deployment forward",
GuiPath = "/JWST",
IsLocal = false
}
local playBackwards = {
Identifier = "jwst.play.backwards",
Name = "Play JWST from end",
@@ -582,7 +603,7 @@ local function createActions()
IsLocal = false
}
return {playForwards, playBackwards, clearPlay, togglePlayDirection}
return {playForwards, playFromDetach, playBackwards, clearPlay, togglePlayDirection}
end
local text = {

View File

@@ -15,6 +15,7 @@ local toggle_trail = {
local launchTrail = "JWSTTrailLaunch"
local cruiseTrail = "JWSTTrailCruise"
local orbitTrail = "JWSTTrailOrbit"
local visibility
@@ -29,6 +30,7 @@ local toggle_trail = {
else
visibility = not (
openspace.getPropertyValue("Scene." .. launchTrail .. ".Renderable.Enabled") or
openspace.getPropertyValue("Scene." .. cruiseTrail .. ".Renderable.Enabled") or
openspace.getPropertyValue("Scene." .. orbitTrail .. ".Renderable.Enabled")
)
end
@@ -37,6 +39,10 @@ local toggle_trail = {
"Scene." .. launchTrail .. ".Renderable.Enabled",
visibility
)
openspace.setPropertyValueSingle(
"Scene." .. cruiseTrail .. ".Renderable.Enabled",
visibility
)
openspace.setPropertyValueSingle(
"Scene." .. orbitTrail .. ".Renderable.Enabled",
visibility

View File

@@ -3,46 +3,80 @@ local earthTransforms = asset.require("scene/solarsystem/planets/earth/transform
local sunTransforms = asset.require("scene/solarsystem/sun/transforms")
asset.require("spice/base")
local horizons = asset.syncedResource({
Name = "JWST Horizons",
Type = "HttpSynchronization",
Identifier = "jwst_horizons",
Version = 3
})
local kernels = asset.syncedResource({
Name = "JWST Kernel",
Type = "HttpSynchronization",
Identifier = "jwst_kernels",
Version = 1
Version = 2
})
-- Trail of JWST relative the Earth for the first month after launch
-- Makes histroy of trail to stay at Earth, that a trail relative to L2 won't
local launchTime = "2021 DEC 25 12:20:00"
local detachTime = "2021 DEC 25 12:50:00"
local L2orbitInsertionTime = "2022 JAN 25 00:00:00"
local endTime = "2024 JAN 22 00:00:00"
-- Trail of JWST relative the Earth Inertial for the first 30 minutes after launch
-- Makes histroy of trail to stay at launch site, that a trail relative to Earth Center won't
local JWSTTrailLaunch = {
Identifier = "JWSTTrailLaunch",
Parent = earthTransforms.EarthCenter.Identifier,
Parent = earthTransforms.EarthIAU.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = "2021 DEC 25 12:50:00",
End = "2022 JAN 25"
Start = launchTime,
End = detachTime
},
Renderable = {
Type = "RenderableTrailTrajectory",
Translation = {
Type = "HorizonsTranslation",
HorizonsTextFile = horizons .. "horizons_jwst_launch.hrz",
},
Type = 'SpiceTranslation',
Target = '170', -- JWST
Observer = 'EARTH',
Frame = 'IAU_EARTH',
Kernels = { kernels .. "webb.bsp" }
},
Color = { 0.9, 0.9, 0.0 },
StartTime = "2021 DEC 25 12:50:00",
EndTime = "2022 JAN 25",
StartTime = launchTime,
EndTime = detachTime,
SampleInterval = 60 -- Sample rate of once per minute
},
GUI = {
Name = "JWST Launch Trail",
Path = "/Solar System/Missions/JWST/Trails",
Description = [[
James Webb Space Telescope Launch Trail relative to Earth.
James Webb Space Telescope Launch Trail relative to Earth IAU.
]],
}
}
-- Trail of JWST relative the Earth for the first month after detatching from the rocket
-- Makes histroy of trail to stay at Earth, that a trail relative to L2 won't
local JWSTTrailCruise = {
Identifier = "JWSTTrailCruise",
Parent = earthTransforms.EarthCenter.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = detachTime,
End = L2orbitInsertionTime
},
Renderable = {
Type = "RenderableTrailTrajectory",
Translation = {
Type = 'SpiceTranslation',
Target = '170', -- JWST
Observer = 'EARTH',
Frame = 'GALACTIC',
Kernels = { kernels .. "webb.bsp" }
},
Color = { 0.9, 0.9, 0.0 },
StartTime = detachTime,
EndTime = L2orbitInsertionTime,
SampleInterval = 60 -- Sample rate of once per minute
},
GUI = {
Name = "JWST Cruise Trail",
Path = "/Solar System/Missions/JWST/Trails",
Description = [[
James Webb Space Telescope Cruise Trail relative to Earth.
]],
}
}
@@ -54,15 +88,18 @@ local JWSTTrailOrbit = {
Parent = transforms.L2.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = "2022 JAN 25",
End = "2024 JAN 22"
Start = L2orbitInsertionTime,
End = endTime
},
Renderable = {
Type = "RenderableTrailOrbit",
Translation = {
Type = "HorizonsTranslation",
HorizonsTextFile = horizons .. "horizons_jwst_orbit.hrz",
},
Type = 'SpiceTranslation',
Target = '170', -- JWST
Observer = '392', -- L2
Frame = 'GALACTIC',
Kernels = { kernels .. "webb.bsp" }
},
Color = { 0.9, 0.9, 0.0 },
Period = 182.621099, -- About 6 months
Resolution = 183 -- About a sample rate of once per day
@@ -81,15 +118,18 @@ local JWSTSunTrail = {
Parent = sunTransforms.SolarSystemBarycenter.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = "2022 JAN 25",
End = "2024 JAN 22"
Start = L2orbitInsertionTime,
End = endTime
},
Renderable = {
Type = "RenderableTrailOrbit",
Translation = {
Type = "HorizonsTranslation",
HorizonsTextFile = horizons .. "horizons_jwst_sun.hrz",
},
Type = 'SpiceTranslation',
Target = '170', -- JWST
Observer = 'SSB',
Frame = 'GALACTIC',
Kernels = { kernels .. "webb.bsp" }
},
Color = { 0.0, 0.9, 0.9 },
Period = 365.242,
Resolution = 365 -- About a sample rate of once per day
@@ -105,6 +145,7 @@ local JWSTSunTrail = {
asset.onInitialize(function()
openspace.addSceneGraphNode(JWSTTrailLaunch)
openspace.addSceneGraphNode(JWSTTrailCruise)
openspace.addSceneGraphNode(JWSTTrailOrbit)
openspace.addSceneGraphNode(JWSTSunTrail)
end)
@@ -112,10 +153,12 @@ end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(JWSTSunTrail)
openspace.removeSceneGraphNode(JWSTTrailOrbit)
openspace.removeSceneGraphNode(JWSTTrailCruise)
openspace.removeSceneGraphNode(JWSTTrailLaunch)
end)
asset.export(JWSTTrailLaunch)
asset.export(JWSTTrailCruise)
asset.export(JWSTTrailOrbit)
asset.export(JWSTSunTrail)

View File

@@ -2,28 +2,45 @@ local earthTransforms = asset.require("scene/solarsystem/planets/earth/transform
local sunTransforms = asset.require("scene/solarsystem/sun/transforms")
asset.require("spice/base")
local horizons = asset.syncedResource({
Name = "JWST Horizons",
local kernels = asset.syncedResource({
Name = "JWST Kernel",
Type = "HttpSynchronization",
Identifier = "jwst_horizons",
Version = 3
Identifier = "jwst_kernels",
Version = 2
})
local launchTime = "2021 DEC 25 12:20:00"
local detachTime = "2021 DEC 25 12:50:00"
local L2orbitInsertionTime = "2022 JAN 25 00:00:00"
local JWSTPosition = {
Identifier = "JWSTPosition",
Parent = earthTransforms.EarthCenter.Identifier,
Parent = earthTransforms.EarthIAU.Identifier,
Transform = {
Translation = {
Type = "TimelineTranslation",
ShouldInterpolate = false,
Keyframes = {
["2021 DEC 25 12:50:00"] = {
Type = "HorizonsTranslation",
HorizonsTextFile = horizons .. "horizons_jwst_launch.hrz",
[launchTime] = {
Type = 'SpiceTranslation',
Target = '170', -- JWST
Observer = 'EARTH',
Frame = 'IAU_EARTH',
Kernels = { kernels .. "webb.bsp" }
},
["2022 JAN 25 00:00:00"] = {
Type = "HorizonsTranslation",
HorizonsTextFile = horizons .. "horizons_jwst_orbit.hrz",
[detachTime] = {
Type = 'SpiceTranslation',
Target = '170', -- JWST
Observer = 'EARTH',
Frame = 'GALACTIC',
Kernels = { kernels .. "webb.bsp" }
},
[L2orbitInsertionTime] = {
Type = 'SpiceTranslation',
Target = '170', -- JWST
Observer = '392', -- L2
Frame = 'GALACTIC',
Kernels = { kernels .. "webb.bsp" }
}
}
},
@@ -64,7 +81,14 @@ local JWSTRotation = {
-- Reparent the JWSTPosition node when the data changes at 25 Jan 2022
asset.onInitialize(function()
openspace.scriptScheduler.loadScheduledScript(
"2022 JAN 25 00:00:00",
detachTime,
[[openspace.setParent("JWSTPosition", "EarthCenter")]],
[[openspace.setParent("JWSTPosition", "EarthIAU")]],
"",
1 -- Not default group, never clear this script
)
openspace.scriptScheduler.loadScheduledScript(
L2orbitInsertionTime,
[[openspace.setParent("JWSTPosition", "L2")]],
[[openspace.setParent("JWSTPosition", "EarthCenter")]],
"",

View File

@@ -46,6 +46,14 @@
"identifier": "profile.set.jwst_launch",
"is_local": false,
"name": "Set to JWST launch time",
"script": "openspace.time.setDeltaTime(1); openspace.time.setTime('2021-12-25T12:20:01');"
},
{
"documentation": "Set the time to the detach time of JWST",
"gui_path": "/JWST",
"identifier": "profile.set.jwst_detach",
"is_local": false,
"name": "Set to JWST detach time",
"script": "openspace.time.setDeltaTime(1); openspace.time.setTime('2021-12-25T12:50:00');"
},
{
@@ -65,12 +73,12 @@
"script": "local list = openspace.getProperty('{planetTrail_solarSystem}.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end local moonlist = openspace.getProperty('{moonTrail_solarSystem}.Renderable.Enabled') for _,v in pairs(moonlist) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end openspace.setPropertyValueSingle('Scene.MoonTrail.Renderable.Enabled', true)"
},
{
"documentation": "Toggle JWST launch and orbit trails, not the Sun trail",
"documentation": "Toggle JWST launch, cruise and orbit trails, not the Sun trail",
"gui_path": "/JWST",
"identifier": "profile.toggle.jwst_trails",
"is_local": false,
"name": "Toggle JWST trail",
"script": "local list = {'Scene.JWSTTrailLaunch.Renderable.Enabled', 'Scene.JWSTTrailOrbit.Renderable.Enabled'}; for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)); end"
"script": "local list = {'Scene.JWSTTrailLaunch.Renderable.Enabled', 'Scene.JWSTTrailCruise.Renderable.Enabled', 'Scene.JWSTTrailOrbit.Renderable.Enabled'}; for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)); end"
}
],
"additional_scripts": [
@@ -216,6 +224,11 @@
"type": "setPropertyValueSingle",
"value": "false"
},
{
"name": "Scene.JWSTTrailCruise.Renderable.Appearance.EnableFade",
"type": "setPropertyValueSingle",
"value": "false"
},
{
"name": "Scene.L1.Renderable.Enabled",
"type": "setPropertyValueSingle",
@@ -319,7 +332,7 @@
],
"time": {
"type": "absolute",
"value": "2021-12-25T12:50:00"
"value": "2021-12-25T12:50:01"
},
"version": {
"major": 1,