RenderableTimeVaryingFitsSphere
Inherits Renderable
This Renderable reads a data sequence from specifically FITS files and makes textures from them and wraps them onto a sphere. A sequence is a data source consisting of multiple data files that each correspond to a specific time and is therefore time varying like the name of the renderable suggests.
LoadingType can be specified in two ways;
StaticLoading: In this case, all data will be loaded on startup, from the location specified in theTextureSourceparameter. Other required parameters areLayerNamesandLayerMinMaxCapValuesthat require at least one entry each.LayerNamesassigns a name to an index that corresponds to a layer in the FITS data to use. For each entry inLayerNames, there should also be a matching entry in theLayerMinMaxCapValuesthat specifies the min and max range for the data.DynamicDownloading: This case downloads the data during runtime. In addition toLayerNamesandLayerMinMaxCapValues, a few more parameters are required in this case:InfoURLtogether withDataIDwill construct a URL that is used for a HTTP request that returns meta data.DataURLandDataID, together with this meta data, will be used in constructing another HTTP request that returns the list with data files. TheDataIDspecify which data source to use.
In addition, but not required, the FitsLayer parameter can be specified to use a specific data layer for the sphere texture. The index should match one of the layers in LayerNames and LayerMinMaxCapValues. CacheData and showAtAllTimes are two other optional parameters.
Members
Name |
Documentation |
Type |
Description |
Optional |
|---|---|---|---|---|
|
Controls the blending function used to calculate the colors of the sphere with respect to the opacity. |
|
Value of type ‘String’ |
Yes |
|
This is set to false by default and will delete all the downloaded content when OpenSpace is shut down, if using dynamic downloading. Set to true to save all the downloaded files. |
|
Value of type ‘Boolean’ |
Yes |
|
Color map / Transfer function to use if |
|
Value of type ‘File’ |
Yes |
|
A data ID that corresponds to what dataset to use if using dynamic downloading. |
|
Value of type ‘Integer’ |
Yes |
|
A URL that returns a JSON formated page with a list of each available file. |
|
Value of type ‘String’ |
Yes |
|
If disabled, no depth values are taken into account for this sphere, meaning that depth values are neither written or tested against during the rendering. This can be useful for spheres that represent a background image. |
|
Value of type ‘Boolean’ |
Yes |
|
Enables/Disables the fade in and out effects. |
|
Value of type ‘Boolean’ |
Yes |
|
The distance from the center of the Milky Way at which the sphere should start to fade in, given as a percentage of the size of the object. A value of zero means that no fading in will happen. |
|
Value of type ‘Double’ |
Yes |
|
A threshold for when the sphere should start fading out, given as a percentage of how much of the sphere that is visible before the fading should start. A value of zero means that no fading out will happen. |
|
In range: ( 0,1 ) |
Yes |
|
The index, a whole positive number, of the layer in the FITS file to use as texture. If not specified, the first layer in the data will be used regardless. When specified, that data layer will be the option used. |
|
Value of type ‘Integer’ |
Yes |
|
A URL that returns a JSON formated page with metadata needed for the dataURL. |
|
Value of type ‘String’ |
Yes |
|
A range per layer to be used to cap where the color range will lie. Values outside of range will be overexposed, i.e. data values below the min or above the max, will all be set to the min and max color value in range. |
|
Yes |
|
|
This value specifies which name of the fits layer to use as texture. |
|
Yes |
|
|
Choose type of loading: StaticLoading: Download and load files on startup. DynamicDownloading: Download and load files during run time. |
|
In list { StaticLoading, DynamicDownloading } |
Yes |
|
If true, mirror the texture along the x-axis. |
|
Value of type ‘Boolean’ |
Yes |
|
This is a max value of the amount of files to queue up so that not to big of a data set is downloaded. |
|
Value of type ‘Integer’ |
Yes |
|
Specifies whether the texture is applied to the inside of the sphere, the outside of the sphere, or both. |
|
In list { Outside, Inside, Both } |
Yes |
|
The number of segments that the sphere is split into. |
|
Greater or equal to: 4 |
Yes |
|
Set if first/last file should render when time is outside of the sequence interval. This can be used regardless of LoadingType. If this value is not specified, the field lines are shown at all times. |
|
Value of type ‘Boolean’ |
Yes |
|
The radius of the sphere in meters. |
|
Greater than: 0 |
Yes |
|
A directory on disk from which to load the texture files for the sphere. |
|
Value of type ‘File’ |
Yes |
|
Used to toggle color map on or off for the sphere. Mainly used to transform grayscale textures from data into color images. |
|
Value of type ‘Boolean’ |
Yes |
Inherited members from Renderable
Name |
Documentation |
Type |
Description |
Optional |
|---|---|---|---|---|
|
Decides if the object should be dimmed (i.e. faded out) when the camera is in the sunny part of an atmosphere. |
|
Value of type ‘Boolean’ |
Yes |
|
Determines whether this object will be visible or not. |
|
Value of type ‘Boolean’ |
Yes |
|
This value determines the opacity of this renderable. A value of 0 means completely transparent. |
|
In range: ( 0,1 ) |
Yes |
|
A value that specifies if the renderable should be rendered in the Background, Opaque, Pre-/PostDeferredTransparency, Overlay, or Sticker rendering step. |
|
In list { Background, Opaque, PreDeferredTransparent, Overlay, PostDeferredTransparent, Sticker } |
Yes |
|
A single tag or a list of tags that this renderable will respond to when setting properties. |
|
Value of type ‘Table’, or Value of type ‘String’ |
Yes |
|
The type of the renderable. |
|
Value of type ‘String’ |
Yes |
Asset Examples
1local transforms = asset.require("scene/solarsystem/heliosphere/transforms_heliosphere")
2
3
4
5local transferFunctions = asset.resource({
6 Type = "HttpSynchronization",
7 Name = "Today's Sun Transfer Functions",
8 Identifier = "todayssun_transferfunctions",
9 Version = 1
10})
11
12
13local blueBlackRed = transferFunctions .. "blue-black-red.txt"
14
15local infoURL = "https://iswaa-webservice1.ccmc.gsfc.nasa.gov/IswaSystemWebApp/DataInfoServlet?id="
16local dataURL = "https://iswaa-webservice1.ccmc.gsfc.nasa.gov/IswaSystemWebApp/FilesInRangeServlet?dataID="
17
18local sunRadius = 695700000
19-- This small 0.2% increase is an arbitrary number but necessary to make sure it is not
20-- within the Sun sphere
21local extendedRadius = sunRadius * 1.002
22local fiveSunRadius = sunRadius * 5
23local outerBoundary = sunRadius * 21.5
24-- Slightly bigger radii to prevent z fighting rendering artifact compared to GONG-Z
25local extendedRadiusAdapt = extendedRadius * 1.00002
26local fiveSunRadiusAdapt = fiveSunRadius * 1.00002
27local outerBoundaryAdapt = outerBoundary * 1.00002
28
29local WSA_54_Magnetic_Field_GONGZ_5_Rs = {
30 Identifier = "WSA_54_Magnetic_Field_GONGZ_5_Rs",
31 Parent = transforms.WSAOffset60.Identifier,
32 Renderable = {
33 Type = "RenderableTimeVaryingFitsSphere",
34 Size = fiveSunRadius,
35 Orientation = "Both",
36 LoadingType = "DynamicDownloading",
37 InfoURL = infoURL,
38 DataURL = dataURL,
39 DataID = 2148,
40 FitsLayer = 0,
41 LayerNames = {
42 ['0'] = "Coronal Magnetic Field at 5 Solar Radii (nT)"
43 },
44 LayerMinMaxCapValues = {
45 ['0'] = { -5000.0, 5000.0 }
46 },
47 ColorMap = blueBlackRed,
48 UseColorMap = false,
49 ShowPastFirstAndLastFile = false,
50 Segments = 132
51 },
52 GUI = {
53 Name = "Magnetic Field at 5Rs (GONG-Z)",
54 Path = "/Solar System/Heliosphere/WSA Coronal Model",
55 Description = [[Texture sequence of simulation model WSA 5.4, showing the coronal
56 magnetic field on a sphere at 5 solar radii. Output: FITS files using GONG-Z Maps
57 (RADOUT = 5.0).]],
58 Focusable = false
59 }
60}
61
62local WSA_54_Magnetic_Field_ADAPT_5_Rs = {
63 Identifier = "WSA_54_Magnetic_Field_ADAPT_5_Rs",
64 Parent = transforms.HeliocentricEarthEquatorial180.Identifier,
65 Renderable = {
66 Type = "RenderableTimeVaryingFitsSphere",
67 Size = fiveSunRadiusAdapt,
68 Orientation = "Both",
69 LoadingType = "DynamicDownloading",
70 InfoURL = infoURL,
71 DataURL = dataURL,
72 DataID = 2149,
73 FitsLayer = 0,
74 LayerNames = {
75 ['0'] = "Coronal Magnetic Field at 5 Solar Radii (nT)"
76 },
77 LayerMinMaxCapValues = {
78 ['0'] = { -5000.0, 5000.0 }
79 },
80 ColorMap = blueBlackRed,
81 UseColorMap = false,
82 ShowPastFirstAndLastFile = false,
83 Segments = 132
84 },
85 GUI = {
86 Name = "Magnetic Field at 5Rs (GONG ADAPT)",
87 Path = "/Solar System/Heliosphere/WSA Coronal Model",
88 Description = [[Texture sequence of simulation model WSA 5.4, showing the coronal
89 magnetic field on a sphere at 5 solar radii. Output: FITS file using
90 ADAPT GONG realization 000 to 011 Maps (RADOUT = 5.0).]],
91 Focusable = false
92 }
93}
94
95local WSA_54_Magnetograms_GONGZ = {
96 Identifier = "WSA_54_Magnetograms_GONGZ",
97 Parent = transforms.WSAOffset60.Identifier,
98 Renderable = {
99 Type = "RenderableTimeVaryingFitsSphere",
100 Size = extendedRadius,
101 LoadingType = "DynamicDownloading",
102 InfoURL = infoURL,
103 DataURL = dataURL,
104 DataID = 2148,
105 FitsLayer = 4,
106 LayerNames = {
107 ['1'] = "Flux tube expansion factor evaluated at the source surface",
108 ['4'] = "Observed Photospheric Field (Gauss)",
109 ['5'] = "Distance from open field footpoint to nearest coronal boundary (deg)",
110 ['6'] = [[Open (1,2,3) and closed (0) regions on the photosphere [1=in-to-out
111 tracing; 2=out-to-in tracing; 3=both] (no units)]],
112 ['7'] = "Distance to current sheet at outer boundary (degrees)"
113 },
114 LayerMinMaxCapValues = {
115 ['1'] = { 0.0, 50.0 },
116 ['4'] = { -50.0, 50.0 },
117 ['5'] = { 0.0, 30.0 },
118 ['6'] = { 0.0, 4.0 },
119 ['7'] = { 0.0, 90.0 }
120 },
121 ColorMap = blueBlackRed,
122 UseColorMap = false,
123 ShowPastFirstAndLastFile = false,
124 Segments = 132
125 },
126 GUI = {
127 Name = "Solar Surface (GONG-Z)",
128 Path = "/Solar System/Heliosphere/WSA Coronal Model",
129 Description = [[Texture sequence of simulation model WSA 5.4, showing data on the
130 solar surface with multiple options in the list under Texture Layer Options. Output:
131 FITS files using GONG-Z Maps (RADOUT = 5.0).]],
132 Focusable = false
133 }
134}
135
136local WSA_54_Magnetograms_ADAPT = {
137 Identifier = "WSA_54_Magnetograms_ADAPT",
138 Parent = transforms.HeliocentricEarthEquatorial180.Identifier,
139 Renderable = {
140 Type = "RenderableTimeVaryingFitsSphere",
141 Size = extendedRadiusAdapt,
142 LoadingType = "DynamicDownloading",
143 InfoURL = infoURL,
144 DataURL = dataURL,
145 DataID = 2149,
146 FitsLayer = 4,
147 LayerNames = {
148 ['1'] = "Flux tube expansion factor evaluated at the source surface",
149 ['4'] = "Observed Photospheric Field (Gauss)",
150 ['5'] = "Distance from open field footpoint to nearest coronal boundary (deg)",
151 ['6'] = [[Open (1,2,3) and closed (0) regions on the photosphere [1=in-to-out
152 tracing; 2=out-to-in tracing; 3=both] (no units)]],
153 ['7'] = "Distance to current sheet at outer boundary (degrees)"
154 },
155 LayerMinMaxCapValues = {
156 ['1'] = { 0.0, 50.0 },
157 ['4'] = { -50.0, 50.0 },
158 ['5'] = { 0.0, 30.0 },
159 ['6'] = { 0.0, 4.0 },
160 ['7'] = { 0.0, 90.0 }
161 },
162 ColorMap = blueBlackRed,
163 UseColorMap = false,
164 ShowPastFirstAndLastFile = false,
165 Segments = 132
166 },
167 GUI = {
168 Name = "Solar Surface (GONG ADAPT)",
169 Path = "/Solar System/Heliosphere/WSA Coronal Model",
170 Description = [[Texture sequence of simulation model WSA 5.4, showing data on the
171 solar surface with multiple options in the list under Texture Layer Options. Output:
172 FITS file using ADAPT GONG realization 000 to 011 Maps (RADOUT = 5.0).]],
173 Focusable = false
174 }
175}
176
177local WSA_Velocity_Adapt_Outer_Boundary = {
178 Identifier = "WSA_54_velocity_ADAPT_Outer_Boundary",
179 Parent = transforms.HeliocentricEarthEquatorial180.Identifier,
180 Renderable = {
181 Type = "RenderableTimeVaryingFitsSphere",
182 Size = outerBoundaryAdapt,
183 LoadingType = "DynamicDownloading",
184 Orientation = "Both",
185 InfoURL = infoURL,
186 DataURL = dataURL,
187 DataID = 2218,
188 FitsLayer = 1,
189 LayerNames = {
190 ['0'] = "Coronal Magnetic Field at 21.5 Solar Radii (nT)",
191 ['1'] = "Solar Wind Speed at 21.5 Solar Radii (km/s)"
192 },
193 LayerMinMaxCapValues = {
194 ['0'] = { -200.0, 200.0 },
195 ['1'] = { 200.0, 850.0 }
196 },
197 ColorMap = blueBlackRed,
198 ShowPastFirstAndLastFile = false,
199 Segments = 132
200 },
201 GUI = {
202 Name = "Velocity at Outer Boundary (GONG-ADAPT)",
203 Path = "/Solar System/Heliosphere/WSA Coronal Model",
204 Description = [[Texture sequence of simulation model WSA 5.4, showing data on a sphere
205 at the outer boundary of the simulation model, either solar wind speed or coronal
206 magnetic field. Output: FITS file using ADAPT GONG realization 000-011 Maps
207 (RADOUT = 21.5).]],
208 Focusable = false
209 }
210}
211
212local WSA_Velocity_Gongz_Outer_Boundary = {
213 Identifier = "WSA_54_velocity_GONGZ_Outer_Boundary",
214 Parent = transforms.WSAOffset60.Identifier,
215 Renderable = {
216 Type = "RenderableTimeVaryingFitsSphere",
217 Size = outerBoundary,
218 Orientation = "Both",
219 LoadingType = "DynamicDownloading",
220 InfoURL = infoURL,
221 DataURL = dataURL,
222 DataID = 2217,
223 FitsLayer = 1,
224 LayerNames = {
225 ['0'] = "Coronal Magnetic Field at 21.5 Solar Radii (nT)",
226 ['1'] = "Solar Wind Speed at 21.5 Solar Radii (km/s)"
227 },
228 LayerMinMaxCapValues = {
229 ['0'] = { -200.0, 200.0 },
230 ['1'] = { 200.0, 850.0 }
231 },
232 ColorMap = blueBlackRed,
233 ShowPastFirstAndLastFile = false,
234 Segments = 132
235 },
236 GUI = {
237 Name = "Velocity at Outer Boundary (GONG-Z)",
238 Path = "/Solar System/Heliosphere/WSA Coronal Model",
239 Description = [[Texture sequence of simulation model WSA 5.4, showing data on a sphere
240 at the outer boundary of the simulation model, either solar wind speed or coronal
241 magnetic field. Output: FITS file using GONG-Z Maps (RADOUT = 21.5).]],
242 Focusable = false
243 }
244}
245
246
247asset.onInitialize(function()
248 openspace.addSceneGraphNode(WSA_54_Magnetic_Field_GONGZ_5_Rs)
249 openspace.addSceneGraphNode(WSA_54_Magnetic_Field_ADAPT_5_Rs)
250 openspace.addSceneGraphNode(WSA_54_Magnetograms_GONGZ)
251 openspace.addSceneGraphNode(WSA_54_Magnetograms_ADAPT)
252 openspace.addSceneGraphNode(WSA_Velocity_Adapt_Outer_Boundary)
253 openspace.addSceneGraphNode(WSA_Velocity_Gongz_Outer_Boundary)
254end)
255
256asset.onDeinitialize(function()
257 openspace.removeSceneGraphNode(WSA_Velocity_Gongz_Outer_Boundary)
258 openspace.removeSceneGraphNode(WSA_Velocity_Adapt_Outer_Boundary)
259 openspace.removeSceneGraphNode(WSA_54_Magnetograms_ADAPT)
260 openspace.removeSceneGraphNode(WSA_54_Magnetograms_GONGZ)
261 openspace.removeSceneGraphNode(WSA_54_Magnetic_Field_ADAPT_5_Rs)
262 openspace.removeSceneGraphNode(WSA_54_Magnetic_Field_GONGZ_5_Rs)
263end)
264
265asset.export(WSA_54_Magnetic_Field_GONGZ_5_Rs)
266asset.export(WSA_54_Magnetic_Field_ADAPT_5_Rs)
267asset.export(WSA_54_Magnetograms_GONGZ)
268asset.export(WSA_54_Magnetograms_ADAPT)
269asset.export(WSA_Velocity_Adapt_Outer_Boundary)
270asset.export(WSA_Velocity_Gongz_Outer_Boundary)
271
272
273
274asset.meta = {
275 Name = "WSA 5.4. Streaming Surface Data Dynamically",
276 Version = "1.0",
277 Description = [[Downloading data from the WSA 5.4 simulation model, showing the dynamic
278 Sun at any point. It includes .fits files for solar surface data. GONG-Z is the
279 zero-corrected synoptic surface magnetic maps from the Global Oscillation Network
280 Group, while GONG-ADAPT is a model based on GONG, where ADAPT stands for Air Force
281 Data Assimilative Photospheric Flux Transport.]],
282 Author = "CCMC",
283 URL = "http://openspaceproject.com",
284 License = "MIT license"
285}