Merge pull request #1611 from OpenSpace/feature/jwst

Feature/jwst
This commit is contained in:
Malin E
2021-05-31 19:09:42 +02:00
committed by GitHub
24 changed files with 1526 additions and 3 deletions
@@ -0,0 +1,84 @@
local assetHelper = asset.require('util/asset_helper')
local circle = asset.require('util/circle').circle
local HUDFSpeck = asset.syncedResource({
Name = "HUDF Speck",
Type = "HttpSynchronization",
Identifier = "digitaluniverse_hudf_speck",
Version = 1
})
local ColorMap = asset.syncedResource({
Name = "HUDF color map",
Type = "HttpSynchronization",
Identifier = "digitaluniverse_hudf_textures",
Version = 1
})
local object = {
Identifier = "HubbleDeepField",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = { 1.0, 1.0, 1.0 },
Opacity = 1.0,
File = HUDFSpeck .. "/hudf.speck",
Texture = circle .. "/circle.png",
ColorMap = ColorMap .. "/hudf.cmap",
ColorOption = { "redshift", "proximity" },
ColorRange = { { 0.0, 0.075 }, { 1.0, 25.0 } },
Unit = "Mpc",
ScaleFactor = 520.0,
BillboardMaxSize = 4.7,
EnablePixelSizeControl = true
},
GUI = {
Name = "Hubble Deep Field",
Path = "/Universe/Galaxies",
Description = [[
Hubble Ultra Deep Field galaxy survey <br><br>
Data Reference: Hubble Ultra Deep Field 2012 program (Ellis+, Koekemoer+, 2013)
]],
}
}
assetHelper.registerSceneGraphNodesAndExport(asset, { object })
asset.meta = {
Name = "Hubble Ultra Deep Field",
Version = "1.1",
Description = "Hubble Ultra Deep Field galaxy survey",
Author = "Frank Summers (STScI), Brian Abbott (AMNH)",
Identifiers = {"HubbleDeepField"},
URL = "http://www.haydenplanetarium.org/universe",
License = [[
Copyright (c) American Museum of Natural History. All rights reserved.<br><br>
Downloading the Atlas:<br>
AMNH offers the Atlas free of charge via our website, http://www.haydenplanetarium.org/.
The User is free to download and/or duplicate verbatim copies of the Atlas provided this
license and copyright information accompany the Atlas.<br><br>
Modifying the Atlas:<br>
The user is free to modify the Atlas by either adding data or altering existing data,
provided it is for personal use only. Once the user modifies the Atlas, it is no longer
part of AMNH's Atlas and cannot be used publicly alongside or within the Atlas without
written permission from AMNH.<br><br>
Distributing the Atlas:<br>
The user is forbidden to distribute and use the Atlas for profit, as part of a software
and/or production system that will subsequently be redistributed, or for public consumption
(via print, electronic media, or broadcast/produced pieces) without written permission
from AMNH.<br><br>
Neither the names of American Museum of Natural History and Hayden Planetarium nor the names
of their contributors may be used to endorse or promote products derived from this Atlas
without specific, prior written permission.<br><br>
The Atlas is free but is offered WITHOUT ANY WARRANTY of any kind. We provide the Atlas as
is and take no responsibility for any damage resulting from the use of this Atlas. The entire
risk as to the quality and performance of this product is with the user.<br><br>
For more information, please visit http://www.haydenplanetarium.org/universe
]]
}
@@ -0,0 +1,77 @@
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 sunTransforms = asset.require('scene/solarsystem/sun/transforms')
local image = asset.syncedResource({
Name = "HUDF image",
Type = "HttpSynchronization",
Identifier = "hudf_image",
Version = 1
})
local DISTANCE = 9.2E15;
-- ra = 3h32m38.92s
-- dec = -27d47m29.37s
-- distance = 9.2E15 m (set to size of view sphere)
local HUDFPosition = {
Identifier = "HUDFPosition",
Parent = transforms.EarthInertial.Identifier,
Transform = {
Translation = {
Type = "StaticTranslation",
Position = {
0.53039024 * DISTANCE,
0.70802069 * DISTANCE,
-0.46625412 * DISTANCE
}
}
},
GUI = {
Name = "Hubble Ultra Deep field",
Path = "/Solar System/Missions/JWST",
Hidden = true
}
}
local HUDFImage = {
Identifier = "HUDFImage",
Enabled = false,
Type = "ScreenSpaceImageLocal",
Name = "Hubble Ultra Deep field",
UseRadiusAzimuthElevation = true,
FaceCamera = false,
RadiusAzimuthElevation = { 200.0, 0.5, 0.15 },
UsePerspectiveProjection = false,
Opacity = 1.0,
TexturePath = image .. "/Hubble_ultra_deep_field.jpg",
Tag = { "mission_jwst_hudf" },
}
local HUDFJWSTLine = {
Identifier = "HUDFJWSTLine",
Parent = sunTransforms.SolarSystemBarycenter.Identifier,
Renderable = {
Enabled = false,
Type = "RenderableNodeLine",
StartNode = HUDFPosition.Identifier,
EndNode = jwstTransforms.JWSTPosition.Identifier,
Color = { 0.5, 0.5, 0.5 },
LineWidth = 2
},
Tag = { "mission_jwst_hudf" },
GUI = {
Name = "JWST to HUDF Line",
Path = "/Solar System/Missions/JWST",
}
}
assetHelper.registerSceneGraphNodesAndExport(asset, { HUDFPosition, HUDFImage, HUDFJWSTLine })
asset.onInitialize(function()
openspace.addScreenSpaceRenderable(HUDFImage)
end)
asset.onDeinitialize(function()
openspace.removeScreenSpaceRenderable(HUDFImage.Identifier)
end)
@@ -0,0 +1,304 @@
local assetHelper = asset.require('util/asset_helper')
local sunTransforms = asset.require('scene/solarsystem/sun/transforms')
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 = 1
})
local band = asset.syncedResource({
Name = "JWST band texture",
Type = "HttpSynchronization",
Identifier = "jwst_band_texture",
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,
Transform = {
Rotation = {
Type = "FixedRotation",
Attached = "JWSTBand",
XAxis = { 1, 0, 0 },
XAxisOrthogonal = true,
ZAxis = sunTransforms.SolarSystemBarycenter.Identifier
}
},
Renderable = {
Enabled = false,
Type = "RenderableSphere",
Texture = band .. "/JWST-band.png",
Size = 9.2E15,
Segments = 50,
DisableFadeInOut = true,
Orientation = "Inside",
Opacity = 0.05,
UseAdditiveBlending = true,
},
Tag = { "mission_jwst_fov" },
GUI = {
Name = "JWST View Band",
Path = "/Solar System/Missions/JWST"
}
}
local JWSTModel = {
Identifier = "JWSTModel",
Parent = JWSTRotation.Identifier,
TimeFrame = {
Type = "TimeFrameInterval",
Start = "2020 JAN 01",
End = "2024 JAN 01"
},
Renderable = {
Type = "RenderableModel",
GeometryFile = model .. "/JWSTFBX.osmodel",
ModelScale = "Foot",
InvertModelScale = true,
EnableAnimation = true,
--TODO: Update theese when the new animation is finished
AnimationStartTime = "2018 10 01 15:00:00",
AnimationMode = "Once",
LightSources = {
{
Type = "SceneGraphLightSource",
Identifier = "Sun",
Node = sunTransforms.SolarSystemBarycenter.Identifier,
Intensity = 1.0
}
},
PerformShading = true,
DisableFaceCulling = true
},
GUI = {
Name = "James Webb Space Telescope",
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 = "SUN",
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"
}
}
local JWSTFov = {
Identifier = "JWSTFov",
Parent = JWSTModel.Identifier,
Renderable = {
Enabled = false,
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/Missions/JWST",
}
}
-- Launch
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 13:18:00",
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 .. "/JWSTFBX.osmodel",
ModelScale = "Foot",
InvertModelScale = true,
EnableAnimation = true,
--TODO: Update theese when the new animation is finished
AnimationStartTime = "2018 10 01 15:00:00",
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"
}
}
assetHelper.registerSceneGraphNodesAndExport(asset, {
JWSTTrail,
JWSTSunTrail,
JWSTLaunchTrail,
JWSTPosition,
JWSTLaunchPosition,
JWSTRotation,
JWSTBand,
JWSTModel,
JWSTLaunchModel,
JWSTFov
})
@@ -0,0 +1,59 @@
local assetHelper = asset.require('util/asset_helper')
local transforms = asset.require('scene/solarsystem/sun/transforms')
local circle = asset.require('util/circle').circle
local kernels = asset.require('scene/solarsystem/planets/earth/lagrange_points/lagrange_kernels').kernels
asset.require('spice/base')
local L1 = {
Identifier = "L1",
Parent = transforms.SolarSystemBarycenter.Identifier,
Renderable = {
Enabled = false,
Type = "RenderablePlaneImageLocal",
RenderableType = "Opaque",
Billboard = true,
Size = 700E5,
Texture = circle .. "/circle.png",
BlendMode = "Additive"
},
Transform = {
Translation = {
Type = "SpiceTranslation",
Target = "391", -- L1
Observer = "SUN",
Kernels = kernels .. "/L1_de431.bsp"
}
},
Tag = { "lagrange_points_earth" , "lagrange_points_earth_l1" },
GUI = {
Name = "L1",
Path = "/Solar System/Planets/Earth/Lagrange points",
}
}
local L1Label = {
Identifier = "L1Label",
Parent = L1.Identifier,
Renderable = {
Enabled = false,
Type = "RenderableLabels",
Text = "L1",
FontSize = 20,
Size = 7.5,
MinMaxSize = { 1.0, 100.0},
OrientationOption = "Camera View Direction",
BlendMode = "Normal",
EnableFading = false
},
Tag = { "lagrange_points_earth", "lagrange_points_earth_l1" },
GUI = {
Name = "L1 Label",
Path = "/Solar System/Planets/Earth/Lagrange points",
Description = "Main label for L1"
}
}
assetHelper.registerSceneGraphNodesAndExport(asset, {
L1,
L1Label
})
@@ -0,0 +1,127 @@
local assetHelper = asset.require('util/asset_helper')
local transforms = asset.require('scene/solarsystem/sun/transforms')
local circle = asset.require('util/circle').circle
local kernels = asset.require('scene/solarsystem/planets/earth/lagrange_points/lagrange_kernels').kernels
asset.require('spice/base')
local L2Small = {
Identifier = "L2Small",
Parent = transforms.SolarSystemBarycenter.Identifier,
Renderable = {
Type = "RenderablePlaneImageLocal",
RenderableType = "Opaque",
Billboard = true,
Size = 400E4,
Texture = circle .. "/circle.png",
BlendMode = "Additive"
},
Transform = {
Translation = {
Type = "SpiceTranslation",
Target = "392", -- L2
Observer = "SUN",
Kernels = kernels .. "/L2_de431.bsp"
}
},
Tag = { "lagrange_points_earth_l2_small" },
GUI = {
Name = "Small L2",
Path = "/Solar System/Planets/Earth/Lagrange points",
}
}
local L2 = {
Identifier = "L2",
Parent = transforms.SolarSystemBarycenter.Identifier,
Renderable = {
Enabled = false,
Type = "RenderablePlaneImageLocal",
RenderableType = "Opaque",
Billboard = true,
Size = 700E5,
Texture = circle .. "/circle.png",
BlendMode = "Additive"
},
Transform = {
Translation = {
Type = "SpiceTranslation",
Target = "392", -- L2
Observer = "SUN",
Kernels = kernels .. "/L2_de431.bsp"
}
},
Tag = { "lagrange_points_earth", "lagrange_points_earth_l2" },
GUI = {
Name = "L2",
Path = "/Solar System/Planets/Earth/Lagrange points",
}
}
local L2SmallLabel = {
Identifier = "L2SmallLabel",
Parent = L2.Identifier,
Renderable = {
Enabled = true,
Type = "RenderableLabels",
Text = "L2",
FontSize = 20.0,
Size = 6.0,
MinMaxSize = { 1.0, 100.0 },
OrientationOption = "Camera View Direction",
BlendMode = "Normal",
EnableFading = false
},
Tag = { "lagrange_points_earth_l2_small" },
GUI = {
Name = "Small L2 Label",
Path = "/Solar System/Planets/Earth/Lagrange points",
Description = "Small label for L2"
}
}
local L2Label = {
Identifier = "L2Label",
Parent = L2.Identifier,
Renderable = {
Enabled = false,
Type = "RenderableLabels",
Text = "L2",
FontSize = 20,
Size = 7.5,
MinMaxSize = { 1.0, 100.0},
OrientationOption = "Camera View Direction",
BlendMode = "Normal",
EnableFading = false
},
Tag = { "lagrange_points_earth", "lagrange_points_earth_l2" },
GUI = {
Name = "L2 Label",
Path = "/Solar System/Planets/Earth/Lagrange points",
Description = "Main label for L2"
}
}
local L2SunLine = {
Identifier = "L2SunLine",
Parent = transforms.SolarSystemBarycenter.Identifier,
Renderable = {
Type = "RenderableNodeLine",
StartNode = "Sun",
EndNode = "L2Small",
Color = { 0.5, 0.5, 0.5 },
LineWidth = 2
},
Tag = { "lagrange_points_earth_l2_small" },
GUI = {
Name = "Sun to L2 Line",
Path = "/Solar System/Planets/Earth/Lagrange points",
}
}
assetHelper.registerSceneGraphNodesAndExport(asset, {
L2Small,
L2,
L2SunLine,
L2SmallLabel,
L2Label
})
@@ -0,0 +1,59 @@
local assetHelper = asset.require('util/asset_helper')
local transforms = asset.require('scene/solarsystem/sun/transforms')
local circle = asset.require('util/circle').circle
local kernels = asset.require('scene/solarsystem/planets/earth/lagrange_points/lagrange_kernels').kernels
asset.require('spice/base')
local L4 = {
Identifier = "L4",
Parent = transforms.SolarSystemBarycenter.Identifier,
Renderable = {
Enabled = false,
Type = "RenderablePlaneImageLocal",
RenderableType = "Opaque",
Billboard = true,
Size = 800E6,
Texture = circle .. "/circle.png",
BlendMode = "Additive"
},
Transform = {
Translation = {
Type = "SpiceTranslation",
Target = "394", -- L4
Observer = "SUN",
Kernels = kernels .. "/L4_de431.bsp"
}
},
Tag = { "lagrange_points_earth", "lagrange_points_earth_l4" },
GUI = {
Name = "L4",
Path = "/Solar System/Planets/Earth/Lagrange points",
}
}
local L4Label = {
Identifier = "L4Label",
Parent = L4.Identifier,
Renderable = {
Enabled = false,
Type = "RenderableLabels",
Text = "L4",
FontSize = 20,
Size = 8.5,
MinMaxSize = { 1.0, 100.0 },
OrientationOption = "Camera View Direction",
BlendMode = "Normal",
EnableFading = false
},
Tag = { "lagrange_points_earth", "lagrange_points_earth_l4" },
GUI = {
Name = "L4 Label",
Path = "/Solar System/Planets/Earth/Lagrange points",
Description = "Main label for L4"
}
}
assetHelper.registerSceneGraphNodesAndExport(asset, {
L4,
L4Label
})
@@ -0,0 +1,59 @@
local assetHelper = asset.require('util/asset_helper')
local transforms = asset.require('scene/solarsystem/sun/transforms')
local circle = asset.require('util/circle').circle
local kernels = asset.require('scene/solarsystem/planets/earth/lagrange_points/lagrange_kernels').kernels
asset.require('spice/base')
local L5 = {
Identifier = "L5",
Parent = transforms.SolarSystemBarycenter.Identifier,
Renderable = {
Enabled = false,
Type = "RenderablePlaneImageLocal",
RenderableType = "Opaque",
Billboard = true,
Size = 800E6,
Texture = circle .. "/circle.png",
BlendMode = "Additive"
},
Transform = {
Translation = {
Type = "SpiceTranslation",
Target = "395", -- L5
Observer = "SUN",
Kernels = kernels .. "/L5_de431.bsp"
}
},
Tag = { "lagrange_points_earth", "lagrange_points_earth_l5" },
GUI = {
Name = "L5",
Path = "/Solar System/Planets/Earth/Lagrange points",
}
}
local L5Label = {
Identifier = "L5Label",
Parent = L5.Identifier,
Renderable = {
Enabled = false,
Type = "RenderableLabels",
Text = "L5",
FontSize = 20,
Size = 8.5,
MinMaxSize = { 1.0, 100.0 },
OrientationOption = "Camera View Direction",
BlendMode = "Normal",
EnableFading = false
},
Tag = { "lagrange_points_earth", "lagrange_points_earth_l5" },
GUI = {
Name = "L5 Label",
Path = "/Solar System/Planets/Earth/Lagrange points",
Description = "Main label for L5"
}
}
assetHelper.registerSceneGraphNodesAndExport(asset, {
L5,
L5Label
})
@@ -0,0 +1,8 @@
local kernels = asset.syncedResource({
Name = "Lagrange Kernels",
Type = "HttpSynchronization",
Identifier = "earth_lagrange_kernels",
Version = 1
})
asset.export('kernels', kernels)
@@ -0,0 +1,4 @@
asset.require('scene/solarsystem/planets/earth/lagrange_points/L1')
asset.require('scene/solarsystem/planets/earth/lagrange_points/L2')
asset.require('scene/solarsystem/planets/earth/lagrange_points/L4')
asset.require('scene/solarsystem/planets/earth/lagrange_points/L5')
+8
View File
@@ -0,0 +1,8 @@
local circle = asset.syncedResource({
Name = "Circle",
Type = "HttpSynchronization",
Identifier = "circle_image",
Version = 1
})
asset.export('circle', circle)