Seperate the JWST mission to seperate assets

This commit is contained in:
Malin E
2021-09-22 14:57:58 +02:00
parent 4c3622316a
commit 24a14b2aac
9 changed files with 233 additions and 211 deletions

View File

@@ -1,6 +1,6 @@
local assetHelper = asset.require('util/asset_helper')
local transforms = asset.require('scene/solarsystem/planets/earth/transforms')
local jwstTransforms = asset.require('scene/solarsystem/missions/jwst/jwst')
local jwstTransforms = asset.require('./transforms')
local sunTransforms = asset.require('scene/solarsystem/sun/transforms')
local image = asset.syncedResource({
@@ -29,9 +29,12 @@ local HUDFPosition = {
}
},
GUI = {
Name = "Hubble Ultra Deep field",
Path = "/Solar System/Missions/JWST",
Hidden = true
Name = "Hubble Ultra Deep field Position",
Path = "/Solar System/Missions/JWST/HUDF",
Hidden = true,
Description = [[
Galactic cartesian position for the Hubble Ultra Deep field
]],
}
}
@@ -63,7 +66,10 @@ local HUDFJWSTLine = {
Tag = { "mission_jwst_hudf" },
GUI = {
Name = "JWST to HUDF Line",
Path = "/Solar System/Missions/JWST",
Path = "/Solar System/Missions/JWST/HUDF",
Description = [[
Line from the James Webb Space Telescope to the Hubble Ultra Deep field
]],
}
}

View File

@@ -0,0 +1,8 @@
local horizons = asset.syncedResource({
Name = "JWST Horizons",
Type = "HttpSynchronization",
Identifier = "jwst_horizons",
Version = 2
})
asset.export('horizons', horizons)

View File

@@ -1,30 +1,8 @@
local assetHelper = asset.require('util/asset_helper')
local sunTransforms = asset.require('scene/solarsystem/sun/transforms')
local transforms = asset.require('./transforms')
local models = asset.require('./model').models
asset.require('spice/base')
asset.require('scene/solarsystem/planets/earth/lagrange_points/lagrange_points')
local transforms = asset.require('scene/solarsystem/planets/earth/lagrange_points/L2')
local JWSTKernel = asset.syncedResource({
Name = "JWST Kernel",
Type = "HttpSynchronization",
Identifier = "jwst_kernels",
Version = 1
})
local JWSTHorizons = asset.syncedResource({
Name = "JWST Horizons",
Type = "HttpSynchronization",
Identifier = "jwst_horizons",
Version = 1
})
local model = asset.syncedResource({
Name = "JWST Model",
Type = "HttpSynchronization",
Identifier = "jwst_model",
Version = 3
})
local band = asset.syncedResource({
Name = "JWST band texture",
@@ -33,47 +11,9 @@ local band = asset.syncedResource({
Version = 1
})
local JWSTPosition = {
Identifier = "JWSTPosition",
Parent = transforms.L2.Identifier,
Transform = {
Translation = {
Type = "SpiceTranslation",
Target = "JWST",
Observer = "392", -- L2
Kernels = JWSTKernel .. "/jwst_horizons_20200101_20240101_v01.bsp"
},
},
GUI = {
Name = "JWST Position",
Path = "/Solar System/Missions/JWST",
Hidden = true,
}
}
local JWSTRotation = {
Identifier = "JWSTRotation",
Parent = JWSTPosition.Identifier,
Transform = {
Rotation = {
Type = "FixedRotation",
Attached = "JWSTRotation",
XAxis = { 1, 0, 0 },
XAxisOrthogonal = true,
YAxisInvert = true,
YAxis = sunTransforms.SolarSystemBarycenter.Identifier
}
},
GUI = {
Name = "JWST Rotation",
Path = "/Solar System/Missions/JWST",
Hidden = true,
}
}
local JWSTBand = {
Identifier = "JWSTBand",
Parent = JWSTPosition.Identifier,
Parent = transforms.JWSTPosition.Identifier,
Transform = {
Rotation = {
Type = "FixedRotation",
@@ -97,21 +37,24 @@ local JWSTBand = {
Tag = { "mission_jwst_fov" },
GUI = {
Name = "JWST Safe Viewing Band",
Path = "/Solar System/Missions/JWST"
Path = "/Solar System/Missions/JWST",
Description = [[
The Safe viewing band for the James Webb Space Telescope at its current position
]],
}
}
local JWSTModel = {
Identifier = "JWSTModel",
Parent = JWSTRotation.Identifier,
Parent = transforms.JWSTRotation.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = "2020 JAN 01",
End = "2024 JAN 01"
Start = "2018 OCT 01 14:05:52",
End = "2021 OCT 01"
},
Renderable = {
Type = "RenderableModel",
GeometryFile = model .. "/jwst_anim74_2fps_2018_nb.osmodel",
GeometryFile = models .. "/jwst_anim74_2fps_2018_nb.osmodel",
ModelScale = 0.0328, -- First scale down with centimeters then scale up with feet
EnableAnimation = true,
AnimationStartTime = "2018 10 01 14:05:52",
@@ -131,49 +74,10 @@ local JWSTModel = {
GUI = {
Name = "James Webb Space Telescope Model",
Path = "/Solar System/Missions/JWST",
}
}
local JWSTTrail = {
Identifier = "JWSTTrail",
Parent = transforms.L2.Identifier,
Renderable = {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
Target = "JWST",
Observer = "392", -- L2
Kernels = JWSTKernel .. "/jwst_horizons_20200101_20240101_v01.bsp"
},
Color = { 0.9, 0.9, 0.0 },
Period = 91.3105,
Resolution = 100
},
GUI = {
Name = "JWST Trail",
Path = "/Solar System/Missions/JWST"
}
}
local JWSTSunTrail = {
Identifier = "JWSTSunTrail",
Parent = sunTransforms.SolarSystemBarycenter.Identifier,
Renderable = {
Enabled = false,
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
Target = "JWST",
Observer = "SSB",
Kernels = JWSTKernel .. "/jwst_horizons_20200101_20240101_v01.bsp"
},
Color = { 0.0, 0.9, 0.9 },
Period = 365.242,
Resolution = 1000
},
GUI = {
Name = "JWST Sun Trail",
Path = "/Solar System/Missions/JWST"
Description = [[
Animated model of the James Webb Space Telescope that shows its deployment in
real time
]],
}
}
@@ -200,102 +104,14 @@ local JWSTFov = {
GUI = {
Name = "JWST Field of View",
Path = "/Solar System/Missions/JWST",
}
}
local JWSTLaunchPosition = {
Identifier = "JWSTLaunchPosition",
Parent = transforms.L2.Identifier,
Transform = {
Translation = {
Type = "HorizonsTranslation",
HorizonsTextFile = JWSTHorizons .. "/horizons_jwst_launch.dat",
},
},
GUI = {
Name = "JWST Launch Position",
Path = "/Solar System/Missions/JWST",
Hidden = true,
}
}
local JWSTLaunchModel = {
Identifier = "JWSTLaunchModel",
Parent = JWSTLaunchPosition.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = "2018 OCT 01 14:05:52",
End = "2019 OCT 01"
},
Transform = {
Rotation = {
Type = "FixedRotation",
Attached = "JWSTRotation",
XAxis = { 1, 0, 0 },
XAxisOrthogonal = true,
YAxisInvert = true,
YAxis = sunTransforms.SolarSystemBarycenter.Identifier
}
},
Renderable = {
Type = "RenderableModel",
GeometryFile = model .. "/jwst_anim74_2fps_2018_nb.osmodel",
ModelScale = 0.0328, -- First scale down with centimeters then scale up with feet
EnableAnimation = true,
AnimationStartTime = "2018 10 01 14:05:52",
AnimationTimeScale = "Millisecond",
AnimationMode = "Once",
LightSources = {
{
Type = "SceneGraphLightSource",
Identifier = "Sun",
Node = sunTransforms.SolarSystemBarycenter.Identifier,
Intensity = 1.0
}
},
PerformShading = true,
DisableFaceCulling = true
},
GUI = {
Name = "JWST Launch Model",
Path = "/Solar System/Missions/JWST",
}
}
local JWSTLaunchTrail = {
Identifier = "JWSTLaunchTrail",
Parent = transforms.L2.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = "2018 OCT 01 13:18:00",
End = "2019 OCT 01"
},
Renderable = {
Type = "RenderableTrailTrajectory",
Translation = {
Type = "HorizonsTranslation",
HorizonsTextFile = JWSTHorizons .. "/horizons_jwst_launch.dat",
},
Color = { 0.9, 0.9, 0.0 },
StartTime = "2018 OCT 01 13:18:00",
EndTime = "2019 OCT 01",
SampleInterval = 600
},
GUI = {
Name = "JWST Launch Trail",
Path = "/Solar System/Missions/JWST"
Description = [[
The field of view for the James Webb Space Telescope at its current position
]],
}
}
assetHelper.registerSceneGraphNodesAndExport(asset, {
JWSTTrail,
JWSTSunTrail,
JWSTLaunchTrail,
JWSTPosition,
JWSTLaunchPosition,
JWSTRotation,
JWSTBand,
JWSTModel,
JWSTLaunchModel,
JWSTFov
})

View File

@@ -0,0 +1,8 @@
local kernels = asset.syncedResource({
Name = "JWST Kernel",
Type = "HttpSynchronization",
Identifier = "jwst_kernels",
Version = 1
})
asset.export('kernels', kernels)

View File

@@ -0,0 +1,8 @@
local models = asset.syncedResource({
Name = "JWST Model",
Type = "HttpSynchronization",
Identifier = "jwst_model",
Version = 3
})
asset.export('models', models)

View File

@@ -1,5 +1,3 @@
local assetHelper = asset.require('util/asset_helper')
asset.onInitialize(function()
-- JWST timelaps timeline
-- Mission start
@@ -236,7 +234,18 @@ asset.onInitialize(function()
end)
asset.onDeinitialize(function ()
openspace.scriptScheduler.clear()
end)
asset.meta = {
Name = "James Webb Space Telescope Timelapse",
Version = "1.0",
Description = [[
Scripts that are scheduled to alter the speed of the simulation time so the deployment
of the James Webb Space Telescope looks smoother.
]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
}

View File

@@ -0,0 +1,99 @@
local assetHelper = asset.require('util/asset_helper')
local transforms = asset.require('scene/solarsystem/planets/earth/lagrange_points/L2')
local sunTransforms = asset.require('scene/solarsystem/sun/transforms')
local horizons = asset.require('./horizons').horizons
local kernels = asset.require('./kernels').kernels
asset.require("spice/base")
local JWSTTrail = {
Identifier = "JWSTTrail",
Parent = transforms.L2.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = "2018 OCT 01 13:18:00",
End = "2021 OCT 01"
},
Renderable = {
Type = "RenderableTrailTrajectory",
Translation = {
Type = "HorizonsTranslation",
HorizonsTextFile = horizons .. "/horizons_jwst.dat",
},
Color = { 0.9, 0.9, 0.0 },
StartTime = "2018 OCT 01 13:18:00",
EndTime = "2021 OCT 01",
SampleInterval = 600
},
GUI = {
Name = "JWST Trail",
Path = "/Solar System/Missions/JWST/Trails",
Description = [[
James Webb Space Telescope Trail relative to L2 based on horizons data from the
2018 launch.
]],
}
}
local JWSTSunTrail = {
Identifier = "JWSTSunTrail",
Parent = sunTransforms.SolarSystemBarycenter.Identifier,
Renderable = {
Enabled = false,
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
Target = "JWST",
Observer = "SSB",
Kernels = kernels .. "/jwst_horizons_20200101_20240101_v01.bsp"
},
Color = { 0.0, 0.9, 0.9 },
Period = 365.242,
Resolution = 1000
},
GUI = {
Name = "JWST Sun Trail",
Path = "/Solar System/Missions/JWST/Trails",
Description = [[
James Webb Space Telescope Trail relative to the Sun based on horizons data from the
2018 launch.
]],
}
}
local JWSTOrbitTrail = {
Identifier = "JWSTOrbitTrail",
Parent = transforms.L2.Identifier,
Renderable = {
Enabled = false,
Type = "RenderableTrailOrbit",
Translation = {
Type = "HorizonsTranslation",
HorizonsTextFile = horizons .. "/horizons_jwst.dat",
},
Color = { 0.9, 0.9, 0.0 },
Period = 91.3105,
Resolution = 100
},
GUI = {
Name = "JWST Orbit Trail",
Path = "/Solar System/Missions/JWST/Trails"
}
}
assetHelper.registerSceneGraphNodesAndExport(asset, {
JWSTTrail,
JWSTSunTrail,
JWSTOrbitTrail
})
asset.meta = {
Name = "James Webb Space Telescope Trails",
Version = "1.0",
Description = [[
Trail of James Webb Space Telescope in respect to L2, the Sun and as an orbit trail
]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license",
Identifiers = {"JWSTTrail", "JWSTSunTrail", "JWSTOrbitTrail"}
}

View File

@@ -0,0 +1,67 @@
local assetHelper = asset.require('util/asset_helper')
local transforms = asset.require('scene/solarsystem/planets/earth/lagrange_points/L2')
local sunTransforms = asset.require('scene/solarsystem/sun/transforms')
local horizons = asset.require('./horizons').horizons
asset.require('spice/base')
local JWSTPosition = {
Identifier = "JWSTPosition",
Parent = transforms.L2.Identifier,
Transform = {
Translation = {
Type = "HorizonsTranslation",
HorizonsTextFile = horizons .. "/horizons_jwst.dat",
},
},
GUI = {
Name = "JWST Position",
Path = "/Solar System/Missions/JWST",
Description = [[
James Webb Space Telescope Position relative to L2 based on horizons data from the
2018 launch.
]],
Hidden = true,
}
}
local JWSTRotation = {
Identifier = "JWSTRotation",
Parent = JWSTPosition.Identifier,
Transform = {
Rotation = {
Type = "FixedRotation",
Attached = "JWSTRotation",
XAxis = { 1, 0, 0 },
XAxisOrthogonal = true,
YAxisInvert = true,
YAxis = sunTransforms.SolarSystemBarycenter.Identifier
}
},
GUI = {
Name = "JWST Rotation",
Path = "/Solar System/Missions/JWST",
Description = [[
James Webb Space Telescope Rotation so the sunshield always faces the Sun.
]],
Hidden = true,
}
}
assetHelper.registerSceneGraphNodesAndExport(asset, {
JWSTPosition,
JWSTRotation
})
asset.meta = {
Name = "James Webb Space Telescope Transforms",
Version = "1.0",
Description = [[
JWST transforms: JWST position relative to L2 using horizons data from the planned
launch of 2018. JWST rotation, a fixed rotation so sunshield always points toward
the Sun.
]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license",
Identifiers = {"JWSTPosition", "JWSTRotation"}
}

View File

@@ -46,13 +46,14 @@
"scene/solarsystem/planets/earth/earth",
"scene/solarsystem/planets/earth/satellites/satellites",
"scene/solarsystem/missions/jwst/jwst",
"scene/solarsystem/missions/jwst/trail",
"scene/solarsystem/missions/jwst/HUDFImage",
"scene/solarsystem/missions/jwst/timelaps",
"scene/digitaluniverse/hdf"
],
"camera": {
"aim": "",
"anchor": "JWSTLaunchModel",
"anchor": "JWSTModel",
"frame": "",
"position": {
"x": 17.363674,