mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-21 03:48:32 -05:00
Merge pull request #2220 from OpenSpace/feature/jwst-trail-update
JWST trail update
This commit is contained in:
@@ -50,13 +50,15 @@ local function createForwardTimelapse()
|
||||
-- array complete
|
||||
openspace.scriptScheduler.loadScheduledScript("]] ..
|
||||
advance(launchTime, 0, 0, 30, 42) .. [[",
|
||||
"openspace.time.interpolateDeltaTime(7200)" ..
|
||||
"openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 2 hours/second\")"
|
||||
"openspace.time.interpolateDeltaTime(2400)" ..
|
||||
"openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 40 minutes/second\")"
|
||||
)
|
||||
|
||||
-- Make night layer more visible, at around 14:00
|
||||
openspace.scriptScheduler.loadScheduledScript("]] ..
|
||||
advance(detachTime, 0, 1, 10, 0) .. [[",
|
||||
"openspace.time.interpolateDeltaTime(7200)" ..
|
||||
"openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 2 hours/second\")" ..
|
||||
"openspace.setPropertyValueSingle(\"Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Settings.Gamma\", 0.7)" ..
|
||||
"openspace.setPropertyValueSingle(\"Scene.EarthAtmosphere.Renderable.Enabled\", false)"
|
||||
)
|
||||
@@ -280,8 +282,10 @@ local function createBackwardTimelapse()
|
||||
|
||||
-- Reset night layer, at around 14:00
|
||||
openspace.scriptScheduler.loadScheduledScript("]] ..
|
||||
advance(detachTime, 0, 1, 10, 0) .. [[",
|
||||
advance(detachTime, 0, 1 + 1, 10, 0) .. [[", -- 1h pre delay so time to interpolate
|
||||
"",
|
||||
"openspace.time.interpolateDeltaTime(-2400)" ..
|
||||
"openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -40 minutes/second\")" ..
|
||||
"openspace.setPropertyValueSingle(\"Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Settings.Gamma\", 1.0)" ..
|
||||
"openspace.setPropertyValueSingle(\"Scene.EarthAtmosphere.Renderable.Enabled\", true)"
|
||||
)
|
||||
@@ -520,6 +524,8 @@ local function createActions()
|
||||
openspace.scriptScheduler.clear(0)
|
||||
openspace.time.setDeltaTime(1)
|
||||
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.time.setTime("]] .. detachTime .. [[")
|
||||
]] .. createForwardTimelapse() .. [[
|
||||
openspace.time.setDeltaTime(1)
|
||||
|
||||
@@ -16,7 +16,7 @@ local toggle_trail = {
|
||||
|
||||
local launchTrail = "JWSTTrailLaunch"
|
||||
local cruiseTrail = "JWSTTrailCruise"
|
||||
local orbitTrail = "JWSTTrailOrbit"
|
||||
local coRevOrbitTrail = "JWSTTrailCoRevOrbit"
|
||||
|
||||
local visibility
|
||||
if is_declared("args") then
|
||||
@@ -31,7 +31,7 @@ local toggle_trail = {
|
||||
visibility = not (
|
||||
openspace.getPropertyValue("Scene." .. launchTrail .. ".Renderable.Enabled") or
|
||||
openspace.getPropertyValue("Scene." .. cruiseTrail .. ".Renderable.Enabled") or
|
||||
openspace.getPropertyValue("Scene." .. orbitTrail .. ".Renderable.Enabled")
|
||||
openspace.getPropertyValue("Scene." .. coRevOrbitTrail .. ".Renderable.Enabled")
|
||||
)
|
||||
end
|
||||
|
||||
@@ -44,7 +44,7 @@ local toggle_trail = {
|
||||
visibility
|
||||
)
|
||||
openspace.setPropertyValueSingle(
|
||||
"Scene." .. orbitTrail .. ".Renderable.Enabled",
|
||||
"Scene." .. coRevOrbitTrail .. ".Renderable.Enabled",
|
||||
visibility
|
||||
)
|
||||
]],
|
||||
|
||||
@@ -28,12 +28,12 @@ local JWSTTrailLaunch = {
|
||||
Renderable = {
|
||||
Type = "RenderableTrailTrajectory",
|
||||
Translation = {
|
||||
Type = 'SpiceTranslation',
|
||||
Target = 170, -- JWST
|
||||
Observer = 'EARTH',
|
||||
Frame = 'IAU_EARTH',
|
||||
Kernels = { kernels .. "webb.bsp" }
|
||||
},
|
||||
Type = 'SpiceTranslation',
|
||||
Target = 170, -- JWST
|
||||
Observer = 'EARTH',
|
||||
Frame = 'IAU_EARTH',
|
||||
Kernels = { kernels .. "webb.bsp" }
|
||||
},
|
||||
Color = { 0.9, 0.9, 0.0 },
|
||||
StartTime = launchTime,
|
||||
EndTime = detachTime,
|
||||
@@ -61,12 +61,12 @@ local JWSTTrailCruise = {
|
||||
Renderable = {
|
||||
Type = "RenderableTrailTrajectory",
|
||||
Translation = {
|
||||
Type = 'SpiceTranslation',
|
||||
Target = 170, -- JWST
|
||||
Observer = 'EARTH',
|
||||
Frame = 'GALACTIC',
|
||||
Kernels = { kernels .. "webb.bsp" }
|
||||
},
|
||||
Type = 'SpiceTranslation',
|
||||
Target = 170, -- JWST
|
||||
Observer = 'EARTH',
|
||||
Frame = 'GALACTIC',
|
||||
Kernels = { kernels .. "webb.bsp" }
|
||||
},
|
||||
Color = { 0.9, 0.9, 0.0 },
|
||||
StartTime = detachTime,
|
||||
EndTime = L2orbitInsertionTime,
|
||||
@@ -83,9 +83,10 @@ local JWSTTrailCruise = {
|
||||
|
||||
-- Trail of JWST relative to L2 after first month to reach L2
|
||||
-- Gives a better trail history of the orbit around L2 than if it was relative to Earth
|
||||
-- This does NOT co-rotate with L2 and gives a saddle look of the trail
|
||||
local JWSTTrailOrbit = {
|
||||
Identifier = "JWSTTrailOrbit",
|
||||
Parent = transforms.L2.Identifier,
|
||||
Parent = transforms.L2Position.Identifier,
|
||||
TimeFrame = {
|
||||
Type = "TimeFrameInterval",
|
||||
Start = L2orbitInsertionTime,
|
||||
@@ -94,13 +95,13 @@ local JWSTTrailOrbit = {
|
||||
Renderable = {
|
||||
Type = "RenderableTrailOrbit",
|
||||
Translation = {
|
||||
Type = 'SpiceTranslation',
|
||||
Target = 170, -- JWST
|
||||
Observer = 392, -- L2
|
||||
Frame = 'GALACTIC',
|
||||
Kernels = { kernels .. "webb.bsp" }
|
||||
},
|
||||
Color = { 0.9, 0.9, 0.0 },
|
||||
Type = 'SpiceTranslation',
|
||||
Target = 170, -- JWST
|
||||
Observer = 392, -- L2
|
||||
Frame = 'GALACTIC',
|
||||
Kernels = { kernels .. "webb.bsp" }
|
||||
},
|
||||
Color = { 0.863, 0.0, 0.902 },
|
||||
Period = 182.621099, -- About 6 months
|
||||
Resolution = 183 -- About a sample rate of once per day
|
||||
},
|
||||
@@ -113,6 +114,38 @@ local JWSTTrailOrbit = {
|
||||
}
|
||||
}
|
||||
|
||||
-- Trail of JWST in orbit around L2 that co-revolves with L2 around the Sun
|
||||
-- This gives the trail a look of a wheel going along L2 around the Sun
|
||||
local JWSTTrailCoRevOrbit = {
|
||||
Identifier = "JWSTTrailCoRevOrbit",
|
||||
Parent = transforms.L2CoRevFrame.Identifier,
|
||||
TimeFrame = {
|
||||
Type = "TimeFrameInterval",
|
||||
Start = L2orbitInsertionTime,
|
||||
End = endTime
|
||||
},
|
||||
Renderable = {
|
||||
Type = "RenderableTrailOrbit",
|
||||
Translation = {
|
||||
Type = 'SpiceTranslation',
|
||||
Target = 170, -- JWST
|
||||
Observer = 392, -- L2
|
||||
Frame = 'L2_COREV',
|
||||
Kernels = { kernels .. "webb.bsp" }
|
||||
},
|
||||
Color = { 1.0, 0.663, 0.157 },
|
||||
Period = 365.242198, -- About a year, 2 orbits. 1 orbit would be 182.621099 (6 months)
|
||||
Resolution = 365 -- About a sample rate of once per day
|
||||
},
|
||||
GUI = {
|
||||
Name = "JWST L2 Co-revolving Orbit Trail",
|
||||
Path = "/Solar System/Missions/JWST/Trails",
|
||||
Description = [[
|
||||
James Webb Space Telescope Orbit Trail that Co-revolves with L2.
|
||||
]],
|
||||
}
|
||||
}
|
||||
|
||||
local JWSTSunTrail = {
|
||||
Identifier = "JWSTSunTrail",
|
||||
Parent = sunTransforms.SolarSystemBarycenter.Identifier,
|
||||
@@ -124,12 +157,12 @@ local JWSTSunTrail = {
|
||||
Renderable = {
|
||||
Type = "RenderableTrailOrbit",
|
||||
Translation = {
|
||||
Type = 'SpiceTranslation',
|
||||
Target = 170, -- JWST
|
||||
Observer = 'SSB',
|
||||
Frame = 'GALACTIC',
|
||||
Kernels = { kernels .. "webb.bsp" }
|
||||
},
|
||||
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
|
||||
@@ -147,11 +180,13 @@ asset.onInitialize(function()
|
||||
openspace.addSceneGraphNode(JWSTTrailLaunch)
|
||||
openspace.addSceneGraphNode(JWSTTrailCruise)
|
||||
openspace.addSceneGraphNode(JWSTTrailOrbit)
|
||||
openspace.addSceneGraphNode(JWSTTrailCoRevOrbit)
|
||||
openspace.addSceneGraphNode(JWSTSunTrail)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.removeSceneGraphNode(JWSTSunTrail)
|
||||
openspace.removeSceneGraphNode(JWSTTrailCoRevOrbit)
|
||||
openspace.removeSceneGraphNode(JWSTTrailOrbit)
|
||||
openspace.removeSceneGraphNode(JWSTTrailCruise)
|
||||
openspace.removeSceneGraphNode(JWSTTrailLaunch)
|
||||
@@ -160,6 +195,7 @@ end)
|
||||
asset.export(JWSTTrailLaunch)
|
||||
asset.export(JWSTTrailCruise)
|
||||
asset.export(JWSTTrailOrbit)
|
||||
asset.export(JWSTTrailCoRevOrbit)
|
||||
asset.export(JWSTSunTrail)
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ local kernels = asset.syncedResource({
|
||||
Name = "Lagrange Kernels",
|
||||
Type = "HttpSynchronization",
|
||||
Identifier = "earth_lagrange_kernels",
|
||||
Version = 1
|
||||
Version = 2
|
||||
})
|
||||
|
||||
local L2Position = {
|
||||
@@ -34,6 +34,30 @@ local L2Position = {
|
||||
}
|
||||
}
|
||||
|
||||
-- This ref. frame co-revolves with L2 and is needed for a more intuitive trail of JWST in
|
||||
-- relation to L2
|
||||
local L2CoRevFrame = {
|
||||
Identifier = "L2CoRevFrame",
|
||||
Parent = L2Position.Identifier,
|
||||
Transform = {
|
||||
Rotation = {
|
||||
Type = "SpiceRotation",
|
||||
SourceFrame = "L2_COREV",
|
||||
DestinationFrame = 'GALACTIC',
|
||||
Kernels = {
|
||||
kernels .. "L2_de431.bsp",
|
||||
kernels .. "L2_corev.tf"
|
||||
}
|
||||
}
|
||||
},
|
||||
Tag = { "lagrange_points_earth", "lagrange_points_earth_l2" },
|
||||
GUI = {
|
||||
Name = "L2 Co-revolving Reference Frame",
|
||||
Path = "/Solar System/Planets/Earth/Lagrange points",
|
||||
Hidden = true
|
||||
}
|
||||
}
|
||||
|
||||
local L2Small = {
|
||||
Identifier = "L2Small",
|
||||
Parent = L2Position.Identifier,
|
||||
@@ -131,6 +155,7 @@ local L2SunLine = {
|
||||
|
||||
local nodes = {
|
||||
L2Position,
|
||||
L2CoRevFrame,
|
||||
L2Small,
|
||||
L2,
|
||||
L2SunLine,
|
||||
|
||||
@@ -73,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, cruise and orbit trails, not the Sun trail",
|
||||
"documentation": "Toggle JWST launch, cruise and L2 co-revolving 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.JWSTTrailCruise.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.JWSTTrailCoRevOrbit.Renderable.Enabled'}; for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)); end"
|
||||
}
|
||||
],
|
||||
"additional_scripts": [
|
||||
@@ -294,6 +294,11 @@
|
||||
"type": "setPropertyValueSingle",
|
||||
"value": "false"
|
||||
},
|
||||
{
|
||||
"name": "Scene.JWSTTrailOrbit.Renderable.Enabled",
|
||||
"type": "setPropertyValueSingle",
|
||||
"value": "false"
|
||||
},
|
||||
{
|
||||
"name": "Scene.JWSTSunTrail.Renderable.Enabled",
|
||||
"type": "setPropertyValueSingle",
|
||||
|
||||
Reference in New Issue
Block a user