Separate JWST asset into multiple assets and avoid specifying timestamps in multiple files

This commit is contained in:
Emma Broman
2024-09-20 11:50:58 +02:00
parent 24a2247aa4
commit 56c2d4d07a
7 changed files with 263 additions and 175 deletions

View File

@@ -0,0 +1,58 @@
local transforms = asset.require("./transforms")
local model = asset.require("./model")
local JWSTFov = {
Identifier = "JWSTFov",
Parent = model.JWSTModel.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = transforms.LaunchTime
},
Renderable = {
Type = "RenderablePrism",
Segments = 6,
Lines = 3,
Radius = 3.25,
LineWidth = 1.0,
Color = { 1.0, 1.0, 1.0 },
Length = 9.2E15
},
Transform = {
Rotation = {
Type = "StaticRotation",
Rotation = { 0, 0, math.rad(30) }
}
},
Tag = { "mission_jwst_fov" },
GUI = {
Name = "JWST Field of View",
Path = "/Solar System/Telescopes/JWST",
Description = [[
The field of view for the James Webb Space Telescope at its current position.
]]
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(JWSTFov)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(JWSTFov)
end)
asset.export(JWSTFov)
asset.meta = {
Name = "JWST Field of View",
Description = [[
The field of view for the James Webb Space Telescope at its current position.
]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
}

View File

@@ -1,176 +1,26 @@
asset.require("./actions")
asset.require("./fieldofview")
asset.require("./label")
asset.require("./mission")
local sunTransforms = asset.require("scene/solarsystem/sun/transforms")
local transforms = asset.require("./transforms")
asset.require("./model")
asset.require("./viewingband")
local models = asset.resource({
Name = "JWST Model",
Type = "HttpSynchronization",
Identifier = "jwst_model",
Version = 3
})
local band = asset.resource({
Name = "JWST band texture",
Type = "HttpSynchronization",
Identifier = "jwst_band_texture",
Version = 1
})
local LaunchTime = "2021 DEC 25 12:20:00"
local JWSTBand = {
Identifier = "JWSTBand",
Parent = transforms.JWSTPosition.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = LaunchTime
},
Transform = {
Rotation = {
Type = "FixedRotation",
Attached = "JWSTBand",
XAxis = { 1.0, 0.0, 0.0 },
XAxisOrthogonal = true,
ZAxis = sunTransforms.SolarSystemBarycenter.Identifier
}
},
Renderable = {
Type = "RenderableSphereImageLocal",
Texture = band .. "JWST-band.png",
Size = 9.2E15,
Segments = 50,
DisableFadeInOut = true,
Orientation = "Inside",
Opacity = 0.05
},
Tag = { "mission_jwst_fov" },
GUI = {
Name = "JWST Safe Viewing Band",
Path = "/Solar System/Telescopes/JWST",
Description = [[
The safe viewing band for the James Webb Space Telescope at its current position
]]
}
}
local JWSTModel = {
Identifier = "JWSTModel",
Parent = transforms.JWSTRotation.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = LaunchTime
},
Renderable = {
Type = "RenderableModel",
GeometryFile = models .. "jwst_anim74_2fps_2018_nb.osmodel",
ModelScale = 0.0328, -- First scale down with centimeters then scale up with feet
EnableAnimation = true,
AnimationStartTime = "2021 12 25 12:20:00",
AnimationTimeScale = "Millisecond",
AnimationMode = "Once",
LightSources = {
sunTransforms.LightSource
},
PerformShading = true
},
GUI = {
Name = "James Webb Space Telescope Model",
Path = "/Solar System/Telescopes/JWST",
Description = [[
Animated model of the James Webb Space Telescope that shows its deployment in
real time
]]
}
}
local JWSTFov = {
Identifier = "JWSTFov",
Parent = JWSTModel.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = LaunchTime
},
Renderable = {
Type = "RenderablePrism",
Segments = 6,
Lines = 3,
Radius = 3.25,
LineWidth = 1.0,
Color = { 1.0, 1.0, 1.0 },
Length = 9.2E15
},
Transform = {
Rotation = {
Type = "StaticRotation",
Rotation = { 0, 0, math.rad(30) }
}
},
Tag = { "mission_jwst_fov" },
GUI = {
Name = "JWST Field of View",
Path = "/Solar System/Telescopes/JWST",
Description = [[
The field of view for the James Webb Space Telescope at its current position
]]
}
}
local JWSTLabel = {
Identifier = "JWSTLabel",
Parent = transforms.JWSTPosition.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = LaunchTime
},
Renderable = {
Type = "RenderableLabel",
Text = "JWST",
FontSize = 50,
Size = 6.5,
MinMaxSize = { 4.0, 30.0 },
OrientationOption = "Camera View Direction",
BlendMode = "Normal",
EnableFading = false
},
GUI = {
Name = "JWST Label",
Path = "/Solar System/Telescopes/JWST",
Description = "Main label for the James Webb Space Telescope"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(JWSTBand)
openspace.addSceneGraphNode(JWSTModel)
openspace.addSceneGraphNode(JWSTFov)
openspace.addSceneGraphNode(JWSTLabel)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(JWSTLabel)
openspace.removeSceneGraphNode(JWSTFov)
openspace.removeSceneGraphNode(JWSTModel)
openspace.removeSceneGraphNode(JWSTBand)
openspace.scriptScheduler.clear(2)
end)
asset.export(JWSTBand)
asset.export(JWSTModel)
asset.export(JWSTFov)
asset.export(JWSTLabel)
asset.meta = {
Name = "James Webb Space Telescope",
Description = [[
James Webb Space Telescope animated model, safe viewing band, field of view and label.
This assets adds the content for the James Webb Space Telescope mission, including
the animated model, safe viewing band, field of view, label, mission file and actions.
]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",

View File

@@ -0,0 +1,48 @@
local transforms = asset.require("./transforms")
local JWSTLabel = {
Identifier = "JWSTLabel",
Parent = transforms.JWSTPosition.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = transforms.LaunchTime
},
Renderable = {
Type = "RenderableLabel",
Text = "JWST",
FontSize = 50,
Size = 6.5,
MinMaxSize = { 4.0, 30.0 },
OrientationOption = "Camera View Direction",
BlendMode = "Normal",
EnableFading = false
},
GUI = {
Name = "JWST Label",
Path = "/Solar System/Telescopes/JWST",
Description = "Main label for the James Webb Space Telescope."
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(JWSTLabel)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(JWSTLabel)
end)
asset.export(JWSTLabel)
asset.meta = {
Name = "JWST Label",
Description = "Main label for the James Webb Space Telescope",
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
}

View File

@@ -0,0 +1,63 @@
local sunTransforms = asset.require("scene/solarsystem/sun/transforms")
local transforms = asset.require("./transforms")
local models = asset.resource({
Name = "JWST Model",
Type = "HttpSynchronization",
Identifier = "jwst_model",
Version = 3
})
local JWSTModel = {
Identifier = "JWSTModel",
Parent = transforms.JWSTRotation.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = transforms.LaunchTime
},
Renderable = {
Type = "RenderableModel",
Enabled = asset.enabled,
GeometryFile = models .. "jwst_anim74_2fps_2018_nb.osmodel",
ModelScale = 0.0328, -- First scale down with centimeters then scale up with feet
EnableAnimation = true,
AnimationStartTime = "2021 12 25 12:20:00",
AnimationTimeScale = "Millisecond",
AnimationMode = "Once",
LightSources = {
sunTransforms.LightSource
},
PerformShading = true
},
GUI = {
Name = "James Webb Space Telescope Model",
Path = "/Solar System/Telescopes/JWST",
Description = [[
Animated model of the James Webb Space Telescope that shows its deployment in
real time.
]]
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(JWSTModel)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(JWSTModel)
end)
asset.export(JWSTModel)
asset.meta = {
Name = "James Webb Space Telescope Model",
Description = [[James Webb Space Telescope animated model.]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
}

View File

@@ -1,14 +1,12 @@
local transforms = asset.require("scene/solarsystem/planets/earth/lagrange_points/l2")
local L2transforms = asset.require("scene/solarsystem/planets/earth/lagrange_points/l2")
local earthTransforms = asset.require("scene/solarsystem/planets/earth/transforms")
local sunTransforms = asset.require("scene/solarsystem/sun/transforms")
local kernels = asset.require("./kernels")
local transforms = asset.require("./transforms")
local coreKernels = asset.require("spice/core")
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
@@ -18,8 +16,8 @@ local JWSTTrailLaunch = {
Parent = earthTransforms.EarthIAU.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = LaunchTime,
End = DetachTime
Start = transforms.LaunchTime,
End = transforms.DetachTime
},
Renderable = {
Type = "RenderableTrailTrajectory",
@@ -30,8 +28,8 @@ local JWSTTrailLaunch = {
Frame = coreKernels.Frame.Earth
},
Color = { 0.9, 0.9, 0.0 },
StartTime = LaunchTime,
EndTime = DetachTime,
StartTime = transforms.LaunchTime,
EndTime = transforms.DetachTime,
SampleInterval = 60 -- Sample rate of once per minute
},
GUI = {
@@ -48,8 +46,8 @@ local JWSTTrailCruise = {
Parent = earthTransforms.EarthCenter.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = DetachTime,
End = L2orbitInsertionTime
Start = transforms.DetachTime,
End = transforms.L2orbitInsertionTime
},
Renderable = {
Type = "RenderableTrailTrajectory",
@@ -60,8 +58,8 @@ local JWSTTrailCruise = {
Frame = coreKernels.Frame.Galactic
},
Color = { 0.9, 0.9, 0.0 },
StartTime = DetachTime,
EndTime = L2orbitInsertionTime,
StartTime = transforms.DetachTime,
EndTime = transforms.L2orbitInsertionTime,
SampleInterval = 60 -- Sample rate of once per minute
},
GUI = {
@@ -76,10 +74,10 @@ local JWSTTrailCruise = {
-- This does NOT co-rotate with L2 and gives a saddle look of the trail
local JWSTTrailOrbit = {
Identifier = "JWSTTrailOrbit",
Parent = transforms.L2Position.Identifier,
Parent = L2transforms.L2Position.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = L2orbitInsertionTime,
Start = transforms.L2orbitInsertionTime,
End = EndTime
},
Renderable = {
@@ -87,7 +85,7 @@ local JWSTTrailOrbit = {
Translation = {
Type = "SpiceTranslation",
Target = kernels.ID.JWST,
Observer = transforms.ID.L2,
Observer = L2transforms.ID.L2,
Frame = coreKernels.Frame.Galactic
},
Color = { 0.863, 0.0, 0.902 },
@@ -105,10 +103,10 @@ local JWSTTrailOrbit = {
-- This gives the trail a look of a wheel going along L2 around the Sun
local JWSTTrailCoRevOrbit = {
Identifier = "JWSTTrailCoRevOrbit",
Parent = transforms.L2CoRevFrame.Identifier,
Parent = L2transforms.L2CoRevFrame.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = L2orbitInsertionTime,
Start = transforms.L2orbitInsertionTime,
End = EndTime
},
Renderable = {
@@ -116,7 +114,7 @@ local JWSTTrailCoRevOrbit = {
Translation = {
Type = "SpiceTranslation",
Target = kernels.ID.JWST,
Observer = transforms.ID.L2,
Observer = L2transforms.ID.L2,
Frame = "L2_COREV"
},
Color = { 1.0, 0.663, 0.157 },
@@ -135,7 +133,7 @@ local JWSTSunTrail = {
Parent = sunTransforms.SolarSystemBarycenter.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = L2orbitInsertionTime,
Start = transforms.L2orbitInsertionTime,
End = EndTime
},
Renderable = {

View File

@@ -105,6 +105,9 @@ asset.onDeinitialize(function()
openspace.scriptScheduler.clear(1)
end)
asset.export("LaunchTime", LaunchTime)
asset.export("DetachTime", DetachTime)
asset.export("L2orbitInsertionTime", L2orbitInsertionTime)
asset.export(JWSTPosition)
asset.export(JWSTRotation)

View File

@@ -0,0 +1,68 @@
local sunTransforms = asset.require("scene/solarsystem/sun/transforms")
local transforms = asset.require("./transforms")
local band = asset.resource({
Name = "JWST band texture",
Type = "HttpSynchronization",
Identifier = "jwst_band_texture",
Version = 1
})
local JWSTBand = {
Identifier = "JWSTBand",
Parent = transforms.JWSTPosition.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = transforms.LaunchTime
},
Transform = {
Rotation = {
Type = "FixedRotation",
Attached = "JWSTBand",
XAxis = { 1.0, 0.0, 0.0 },
XAxisOrthogonal = true,
ZAxis = sunTransforms.SolarSystemBarycenter.Identifier
}
},
Renderable = {
Type = "RenderableSphereImageLocal",
Texture = band .. "JWST-band.png",
Size = 9.2E15,
Segments = 50,
DisableFadeInOut = true,
Orientation = "Inside",
Opacity = 0.05
},
Tag = { "mission_jwst_fov" },
GUI = {
Name = "JWST Safe Viewing Band",
Path = "/Solar System/Telescopes/JWST",
Description = [[
The safe viewing band for the James Webb Space Telescope at its current position.
]]
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(JWSTBand)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(JWSTBand)
end)
asset.meta = {
Name = "JWST Safe Viewing Band",
Description = [[
The safe viewing band for the James Webb Space Telescope at its current position.
]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
}