visualizing space weather: acquiring and rendering data of...

39
Department of Science and Technology Institutionen för teknik och naturvetenskap Linköping University Linköpings universitet g n i p ö k r r o N 4 7 1 0 6 n e d e w S , g n i p ö k r r o N 4 7 1 0 6 - E S LiU-ITN-TEK-A14/052 SE Visualizing Space Weather: Acquiring and Rendering Data of Earth's Magnetosphere Hans-Christian Helltegen 2014-12-18

Upload: others

Post on 25-Jul-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

Department of Science and Technology Institutionen för teknik och naturvetenskap Linköping University Linköpings universitet

gnipökrroN 47 106 nedewS ,gnipökrroN 47 106-ES

LiU-ITN-TEK-A14/052 SE

Visualizing Space Weather:Acquiring and Rendering Data of

Earth's MagnetosphereHans-Christian Helltegen

2014-12-18

Page 2: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

LiU-ITN-TEK-A14/052 SE

Visualizing Space Weather:Acquiring and Rendering Data of

Earth's MagnetosphereExamensarbete utfört i Datateknik

vid Tekniska högskolan vidLinköpings universitet

Hans-Christian Helltegen

Handledare Alexander BockExaminator Anders Ynnerman

Norrköping 2014-12-18

Page 3: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

Upphovsrätt

Detta dokument hålls tillgängligt på Internet – eller dess framtida ersättare –under en längre tid från publiceringsdatum under förutsättning att inga extra-ordinära omständigheter uppstår.

Tillgång till dokumentet innebär tillstånd för var och en att läsa, ladda ner,skriva ut enstaka kopior för enskilt bruk och att använda det oförändrat förickekommersiell forskning och för undervisning. Överföring av upphovsrättenvid en senare tidpunkt kan inte upphäva detta tillstånd. All annan användning avdokumentet kräver upphovsmannens medgivande. För att garantera äktheten,säkerheten och tillgängligheten finns det lösningar av teknisk och administrativart.

Upphovsmannens ideella rätt innefattar rätt att bli nämnd som upphovsman iden omfattning som god sed kräver vid användning av dokumentet på ovanbeskrivna sätt samt skydd mot att dokumentet ändras eller presenteras i sådanform eller i sådant sammanhang som är kränkande för upphovsmannens litteräraeller konstnärliga anseende eller egenart.

För ytterligare information om Linköping University Electronic Press seförlagets hemsida http://www.ep.liu.se/

Copyright

The publishers will keep this document online on the Internet - or its possiblereplacement - for a considerable time from the date of publication barringexceptional circumstances.

The online availability of the document implies a permanent permission foranyone to read, to download, to print out single copies for your own use and touse it unchanged for any non-commercial research and educational purpose.Subsequent transfers of copyright cannot revoke this permission. All other usesof the document are conditional on the consent of the copyright owner. Thepublisher has taken technical and administrative measures to assure authenticity,security and accessibility.

According to intellectual property law the author has the right to bementioned when his/her work is accessed as described above and to be protectedagainst infringement.

For additional information about the Linköping University Electronic Pressand its procedures for publication and for assurance of document integrity,please refer to its WWW home page: http://www.ep.liu.se/

© Hans-Christian Helltegen

Page 4: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

Visualizing Space Weather: Acquiringand Rendering Data of Earth’sMagnetosphere

Master’s Thesis in Media Technology and Engineering

HANS-CHRISTIAN HELLTEGEN

Department of Science and Technology

Media and Information Technology

Linkoping University

Norrkoping, Sweden 2014

Page 5: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

Abstract

This thesis aims to describe the work and results of an intership at NASA’s GoddardSpace Flight Center and part of the OpenSpace project. The project is a collabora-tion between Linkoping University in Norrkoping, the American Museum of NaturalHistory in New York and the Community Coordinated Modeling Center at NASA out-side Washington D.C. The work done during this intership has been to research andimplement visualizations for Earth’s magnetosphere based on data from scientific spaceweather models. An interface was developed to access and read the data sets into theOpenSpace software, where the data is be rendered using volume ray-casting and field-line tracing. The fieldlines are a major part of this thesis and every step of the wayfrom the seed points to the rendering are presented and discussed. All of these featuresand functionality have been implemented in the OpenSpace software which will continueto grow towards its goal of being able to interactively visualize space in a multi-screenenvironment in real time.

Page 6: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

Acknowledgements

First off I would like to thank my supervisor Alexander Bock and my examinator pro-fessor Anders Ynnerman for entrusting me with this project, I really appreciate it andthis have been a great experience! Also thank you Alex for your help with my thesis,your detailed feedback and notes have made the writing so much easier. Thank youMasha for doing everything in your power to help two lost Swedes find a place to live.Your generosity and kindness welcomed us in the best possible way to the US. Thanks toeveryone at the CCMC for making me feel part of the gang and always being there to an-swer questions and give feedback. Without your expertise none of this would have beenpossible. Thank you Michael for putting up with my terrible jokes and trying to do theimpossible task of education me about space. Bob, thank you for keeping us up-to-datewith the general project and also making sure we’re heading the right direction.

Thank you Jeimy for being an awesome roommate and giving me the latino experience.Thank you Aleksi and Andres for showing me D.C. and introducing me to so many funpeople. You guys made my trip so much better and really helped me discover one of thebest cities I’ve ever been in. Thanks Marina for confirming every single stereotype I hadabout Russians and taking me to all kinds of cool places. Thanks to all the other D.C.people who made my stay great! I am definitely returning one day and hope to see youall again.

Jonas, thank you for being my partner in science. Having someone to exchange ideasand arrive in the US with was great. Finally thanks to my family and friends for all theencouragement, putting up with me being away and tolerating when I have been bad atkeeping in touch.

Hans-Christian, Linkoping November 2014

Page 7: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

Contents

1 Introduction 11.1 Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Purpose and Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . 11.3 Thesis Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2 Background 32.1 OpenSpace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.2 Space Weather . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.3 CCMC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.4 Kameleon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.5 BATS-R-US . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.6 CDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.7 Fieldlines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.8 Lorentz Force . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3 Method & Implementation 103.1 The Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103.2 Volume Rendering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103.3 Kameleon Wrapper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.4 Fieldline Tracing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123.5 Runge-Kutta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.6 Magnetic Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.7 Seed Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.8 Geometry Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163.9 Lorentz Force . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173.10 Billboards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

4 Results 194.1 Volume Rendering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194.2 Fieldline Tracing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204.3 Fieldline Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

i

Page 8: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

CONTENTS

4.4 Billboards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234.5 Lorentz Force Trajectories . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

5 Discussion 275.1 Kameleon Wrapper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275.2 Fieldline Tracing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285.3 Billboards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285.4 Seed Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295.5 Lorentz Force Trajectories . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

6 Conclusion 30

Bibliography 31

ii

Page 9: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

1Introduction

In this chapter I briefly outline some basic information for the thesis. I explain thecontext behind the thesis, i.e. how it came to be, the purpose and requirements of

the work, and finally the structure of the thesis.

1.1 Context

This thesis is the result of an internship with the Community Coordinated ModelingCenter (CCMC) at NASA’s Goddard Space Flight Center in USA for doing my master’sthesis as a part of the collaborative project OpenSpace. The thesis is written from acomputer science perspective due to my background being engineering in media technol-ogy and computer science. The OpenSpace project began in 2012 and I am part of thethird round of students sent.

1.2 Purpose and Requirements

The purpose of this thesis and work is to implement visualization schemes for the mag-netosphere while developing the core OpenSpace software. These visualization needsto:

• Run in real time. The visualizations are going to be used for exploration, sointeractive speeds are a required.

• Be scientifically correct. NASA researchers are going to use it for their research.

• Be aesthetically pleasing. OpenSpace will be used for space shows at museums sothe visual quality needs to be good.

The resulting application also needs to be able to run cross-platform, i.e. on Linux, Mac,and Windows, in stereoscopic 3D and on multi-channel displays, such as planetariums.

1

Page 10: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

1.3. THESIS STRUCTURE CHAPTER 1. INTRODUCTION

1.3 Thesis Structure

In chapter 2, I explain the OpenSpace project, Space Weather, and the CCMC withtheir tools in depth. Then in chapter 3 of my thesis work, an overview of appropriatevisualization techniques and the implementation of the selected visualization techniquesare explained. In chapter 4 I showcase results from my implemented techniques anddiscuss how the work progressed. After that the results, techniques, and remarks arediscussed in chapter 5. Finally in chapter 6 I give my thoughts on the work as a wholeand give some closing words.

2

Page 11: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

2Background

This chapter gives some background to the thesis by explaining the OpenSpaceproject and its collaborators. Necessary terms which are used later in the thesis

are explain in this chapter.

2.1 OpenSpace

OpenSpace is a collaborative project between Linkoping University (LiU), the Commu-nity Coordinated Modeling Center (CCMC) at NASA, and the Hayden Planetarium atthe American Museum of Natural History (AMNH). The project aims to develop anopen source software that will be able to visualize space in real time for both publicoutreach and scientific use. The visualizations will be generated from NASA data andneeds to be scientifically correct whilst also being visually pleasing. This thesis is apart of the third round of students sent from LiU in Sweden to NASA’s Goddard SpaceFlight Center in Maryland, USA, to do their master’s theses as a part of the OpenSpaceproject. The two previous students sent were Martin Tornros who did a case study onvisualizing space weather [1] and Victor Sand who looked into dynamic visualization ofspace weather using time series [2]. Screenshots of their work can be seen in figures 2.1and 2.2. This iteration of OpenSpace aims to start developing the code which will be thefoundation of the software while exploring new ways of visualizing space weather data.

2.2 Space Weather

Space weather is a phenomenon involving how the sun and its solar wind affect Earth,other planets and spacecraft. The strategic plan from the National Space WeatherProgram [3] defines space weather as:

“”Space weather” refers to conditions on the sun and in the solar wind,magnetosphere, ionosphere, and thermosphere that can influence the perfor-

3

Page 12: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

2.2. SPACE WEATHER CHAPTER 2. BACKGROUND

Figure 2.1: Visualization of a coronal mass ejection event (in orange) and solar wind (inblue) from Martin Tornros’s thesis [1].

mance and reliability of space-borne and ground-based technological systemsand can endanger human life or health. Adverse conditions in the spaceenvironment can cause disruption of satellite operations, communications,navigation, and electric power distribution grids, leading to a variety of so-cioeconomic losses.”

There are many aspects of space weather that are interesting from a visualizing stand-point. Previous theses in the project were mainly concerned with the solar wind, flares,and coronal mass ejections (CME). This thesis, however, is focussed on visualizingEarth’s magnetic field and the magnetosphere. The magnetosphere and it’s significancein terms of space weather is explained by the National Research Council [4] as:

“Earth is immersed in the escaping ionized outer atmosphere of the Sun.This ”solar wind,” flowing against Earth’s magnetic field, shapes the near-Earth space environment. The magnetic bubble of the ”magnetosphere,”carvedout by Earth’s field, shields our upper atmosphere with its ionized region, theionosphere, from the direct effects of the solar wind.”

4

Page 13: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

2.3. CCMC CHAPTER 2. BACKGROUND

Figure 2.2: Picture from Victor Sand’s demo of his thesis work [2] at the Hayden Plane-tarium in New York.

2.3 CCMC

The CCMC is a part of the Heliophysics Science Division at NASA’s Goddard SpaceFlight Center. From their website:

“The Community Coordinated Modeling Center (CCMC) is a multi-agencypartnership. The CCMC provides, to the international research community,access to modern space science simulations. In addition, the CCMC supportsthe transition to space weather operations of modern space research models.”

Their contribution is supplying space weather data, software for accessing the data, andlending their expertise about space weather visualizing and science.

2.4 Kameleon

A big part of what the CCMC does is providing access to scientific models for spaceweather research and forecasting. These models are not developed by the CCMC, theyare instead converted to output the data in the standardized format CDF (CommonData Format). For this conversion, and also for accessing and interpolating the data,

5

Page 14: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

2.5. BATS-R-US CHAPTER 2. BACKGROUND

CCMC has developed a software suite called Kameleon. This software suite gives theirusers tools to read the output of all the space weather models that Kameleon supports.

2.5 BATS-R-US

The model used for this thesis is the BATS-R-US, which is an acronym for Block-Adaptive-Tree-Solarwind-Roe-Upwind-Scheme. The model was developed by the Centerfor Space Environment Modeling (CSEM) at the University of Michigan [5] and is amodel of Earth’s magnetosphere. The output of the model contains several magneto-spheric variables such as atomic mass density ρ, magnetic field b, and electrical currentfield j, amongst others. BATS-R-US is defined as an adaptive rectangular grid in theGeocentric Solar Magnetospheric (GSM) coordinate system. As explained by C.T. Rus-sell in his article Geophysical coordinate transformations [6]: GSM has its X-axis fromthe Earth to the Sun. The Y-axis is defined to be perpendicular to the Earth’s magneticdipole so that the X-Z plane contains the dipole axis. The positive Z-axis is chosen tobe in the same sense as the northern magnetic pole.

2.6 CDF

CDF (Common Data Format) is, as previously mentioned, a data format developed bythe Space Physics Data Facility at NASA’s Goddard Space Flight Center [7] and is theformat used by Kameleon to store model output. In the CDF file data is stored aseither variables or attributes (essentially metadata). Variables are scalars, vectors, orn-dimensional arrays while attributes are entries describing either the global CDF file ora single variable specifically. Part of the CDF distribution package are utility programs,called the CDF toolkit. One of these programs is called CDFedit which allows users todisplay the contents of a CDF file through a text interface as shown in figure 2.3.

6

Page 15: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

2.7. FIELDLINES CHAPTER 2. BACKGROUND

Figure 2.3: CDFedit showing the variable attributes contained in a BATS-R-US outputfile.

2.7 Fieldlines

Much of this thesis will be centered around visualizing magnetic fields around Earth.These fields are 3-dimensional vector fields which means that each voxel in the data willhave a direction and a magnitude. Vector fields are difficult to visulize but a commmonlyused method is fieldlines. Fieldlines, as the name implies, are lines which represent anunderlaying vector field. These lines can be placed sparsely to visualize the flow ofa vector field, which is very hard to comprehend otherwise. An example of fieldlinesvisualizing a magnetic field is shown in 2.4. The method used for creating fieldlines iscalled fieldline tracing and is discussed in detail in chapter 3.4.

Fieldlines are important because it allows scientists to see advanced structures withina vector field. In the case of astrophysicists at NASA, they need fieldlines to be able tosee features in the magnetic fields surrounding stars and planets. A concrete example ofthis is a structure called a magnetic flux tube which are found on the surface of the Sunand around Earth, amongst other places. On the Sun they connect sunspots or regionsof high magnetic flux that causes plasma (heated gas consisting of separated chargedparticles) to flow within the flux tube. When a magnetic flux tube on the Sun’s surfaceis filled with plasma they are called coronal loops, an example of coronal loops is seenin figure 2.5. Around Earth the magnetic flux tubes are always present but are mostlyquiet, however they can get filled with plasma by a flux transfer event following theopening of a magnetic portal. This is something which can happen during geo-magneticstorms that also causes phenomena such as the northern lights. These portals open inthe interface region where different types of fieldlines meet as seen in figure 2.6.

7

Page 16: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

2.7. FIELDLINES CHAPTER 2. BACKGROUND

Figure 2.4: Iron filings showing the magnetic field around a permanent magnet and field-lines in red visualizing the same magnetic field.

Figure 2.5: Coronal loops on the surface of the Sun. Coronal loops are created by plasmaflowing within a magnetic flux tube that connect sunspots or areas of high magnetic flux.Earth placed for scale. Image courtesy of NASA.

8

Page 17: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

2.8. LORENTZ FORCE CHAPTER 2. BACKGROUND

Figure 2.6: Image showing classified fieldlines near Earth. In the so called X-point (or”electron diffusion region”) between the blue Magnetosphere lines and the red Solar Windlines where the green North and yellow South connected lines meet, a magnetic portal mayopen. When a magnetic portal opens a flux transfer event occurs and a magnetic flux tube isfilled with plasma, connecting Earth’s magnetosphere with the Sun’s magnetic field. Imagecourtesy of NASA.

2.8 Lorentz Force

When visualizing the magnetosphere by tracing fieldlines it is as if imaginary particlesare introduced that follow the magnetic field. Tracing the trajectories of real particles(i.e. protons and electrons) and how they move in Earth’s magnetosphere requires adifferent method that takes more into consideration than just the flow of the magneticfield. For this there is an equation called Lorentz force [8], shown in equation 2.1, whichcalculates a force F on a particle with the electric charge q and velocity v in the electricfield E and magnetic field B.

F = q(E+ v ×B) (2.1)

The traced trajetories of these particles allow scientists and other users to see howcharged particles emitted by the Sun behave in Earth’s magnetosphere and can lead toa greater understanding of the interaction between Earth and the Sun.

9

Page 18: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

3Method & Implementation

This part of the thesis will be used for explaining the method, implementation, andapproach taken for the thesis work. The work will be explained in chronological

order so the reader can see how the work progressed and the thought process behind it.

3.1 The Data

David Sibeck 112707 13d ful 1 t00002110 n0028227.out.cdf is the data set used for thisthesis. The data set is a single time step outputted by the BATS-R-US model forthe global magnetosphere. The domain of the model run is x = [−255, 33]Re

1, y =[−48, 48]Re, and z = [−48, 48]Re and consists of 20323440 blocks with variable val-ues. The rectangular blocks are arranged in varying degrees of spatial levels with thesmaller blocks located closer to Earth. The range of the spatial level for a block is∆ = [0.00625, 4.00000]Re.

3.2 Volume Rendering

The first thesis work done was implementing support for basic volume rendering usingOpenGL and GLSL. Volume rendering is the practice of creating 2D images from 3Dvolumetric data sets and is commonly used in scientific visualization. The volume ren-dering technique chosen in this case was volume ray casting. Volume ray casting is animage-based volume rendering technique which means that it iterates over pixels in theresulting image rather than over objects in the scene. This makes it very easy to usein conjunction with shaders on the GPU (which are also run per pixel) and this boostsperformance massively compared to if it would have been run on the CPU. The raycasting algorithm by itself is straightforward. For every pixel in the resulting image:

11 Re = 6371 km (Earths mean radius)

10

Page 19: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

3.3. KAMELEON WRAPPER CHAPTER 3. METHOD & IMPLEMENTATION

1. Cast a ray from the camera into the volume

2. Sample the volumetric data set along the ray

3. Composite the sampled values for the resulting pixel color

The concept behind volume ray casting can also be seen illustrated in figure 3.1. The raycaster was, as previously mentioned, implemented with OpenGL and GLSL as the classRenderableVolumeGL in OpenSpace. The functionality was implemented in a genericway which would allow any volumetric data set to be rendered and visualized.

Figure 3.1: The volume ray casting concept. Rays are sent from the camera, throughthe image plane and then into the volume. Each ray is then sampled, the sampled valuescomposited, and the resulting value is used as the pixels color. Illustration from [2].

3.3 Kameleon Wrapper

With the volume rendering capability implemented in OpenSpace, data was now neededfor visualization. This meant it was time to start using Kameleon and the CDF-file men-tioned previously. To keep modularity high, an interface and wrapper class, Kameleon-Wrapper, was implemented. The interface provided by Kameleon gives the user func-tionality to get a single attribute or a interpolated variable value at any point within thebounds of the CDF-file. This is great for handling the data and for doing calculationsbut not the optimal interface for rendering since it is a time-consuming operation.

11

Page 20: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

3.4. FIELDLINE TRACING CHAPTER 3. METHOD & IMPLEMENTATION

This meant that the first functionality implemented in the Kameleon wrapper was theability to generate a uniformly sampled volumetric data set for a given scalar variable anddesired data dimensions. To achieve a uniform sampling a simple step size is calculatedfor each axis as seen in equation 3.1, where xmax and xmin are the actual min andactual max variable attributes for the x variable in the CDF file and OutDimx is thedesired x-resolution of the resulting data set. The sampled data set could then easily beused directly by the RenderableVolumeGL class implemented earlier.

Stepx =(xmax − xmin)

OutDimx

(3.1)

Figure 3.2: Diagram showing the simplified interaction between the RenderableVolumeGLand KameleonWrapper classes, and how Kameleon is used by the KameleonWrapper. Theinterpolate function is called from KameleonWrapper for every voxel in the resulting dataset.

One thing to consider when working with scientific model runs through Kameleon isthat there are many different coordinate systems depending on which model and settingsare used for the run. For example, the ENLIL model is defined in spherical coordinates{r, θ, ϕ} while the BATS-R-US model is in the cartesian coordinate system GSM asexplained in 2.5. These coordinate systems need to be transformed to the standardright-handed coordinate system often used in computer graphics before being used inOpenSpace.

3.4 Fieldline Tracing

After the Kameleon wrapper was implemented and volumetric scalar variables being ableto be visualized, it was time to tackle the harder task of visualizing volumetric vectorvalues, also knows as vector fields. One common way of visualizing vector fields is bytracing and drawing fieldlines (as explained in chapter 2.7), which consists of placing an

12

Page 21: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

3.4. FIELDLINE TRACING CHAPTER 3. METHOD & IMPLEMENTATION

imaginary particle in the field and tracing it’s path following the vector field. This is doneby starting at a given point (called a seed point), sampling the vector field, calculatinga direction, stepping along the calculated direction and then saving the new point itarrives at. This is then repeated until a stop condition is met. The stop conditions inthis case is if the fieldline goes out of the bounds mentioned in section 3.1, inside Earthor if a maximum number of steps have been taken. An illustration of a fieldline tracingis seen in figure 3.3.

Figure 3.3: Illustration showing a fieldline tracing of a vector field. Each black arrow is acell in a vector field with a direction and magnitude. The red point is the seed point whichresults in the red-dotted fieldline.

To do the stepping, a numerical method for calculating the direction is needed. Thefirst method used for this was Euler method [9] seen in equation 3.2 where pn is thecurrent point, h is the step size, ~f(pn) is the vector field direction at the current pointand pn+1 is the new point. The Euler method is a very basic first order method fornumerical integration, it was only used during early testing due to it being quick toimplement but inaccurate. A first order method means that only one step is taken perpoint, which means that the local error (error per step) is proportional to the square ofthe step size. This means that the local error will increase very quickly as seen in figure3.4.

pn+1 = pn + h · ~f(pn) (3.2)

13

Page 22: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

3.5. RUNGE-KUTTA CHAPTER 3. METHOD & IMPLEMENTATION

Figure 3.4: Image of an Euler method approximation (in red) of a curve (in blue). Forevery point An the slope of the curve is used together with a step size to create the nextpoint, An+1. With the Euler method the error always increase for every point, a smallerstep size only affects how fast it increases.

3.5 Runge-Kutta

Although the Euler method did produce some interesting results, a better and moreaccurate method for calculation the direction by numerical integration was needed. Themethod chosen for this was the 4th order Runge-Kutta method [9][10] as shown in equa-tion 3.3. This method works by calculating four increments k1, k2, k3, k4 and thencombining them as a weighted average with the step size h and added to the currentpoint pn to get the next point pn+1. The four increments are the directions sampledfrom the vector field data at the points pn, pn+

h2k1, pn+

h2k2, and pn+hk3 respectively.

pn+1 = pn + h6(k1 + 2k2 + 2k3 + k4)

k1 = ~f(pn)

k2 = ~f(pn + h2k1)

k3 = ~f(pn + h2k2)

k4 = ~f(pn + hk3)

(3.3)

The method was implemented in the fieldline tracer function in theKameleonWrapperclass. Comparisons between the Euler method and the Runge-Kutta 4th order is seen infigures 4.3 and 4.4, and discussed in section 5.2.

14

Page 23: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

3.6. MAGNETIC FIELDS CHAPTER 3. METHOD & IMPLEMENTATION

3.6 Magnetic Fields

The data from the BATS-R-US model describes Earth’s magnetosphere i.e. the magneticfield around Earth that protects us from the Sun. When visualizing magnetic fields, thereare certain characteristics and traits that can be useful to highlight and consider. It isknown that all magnetic fields are related to the two poles (the north and south pole inthis case) and that there are two major types of fieldlines: open and closed. An openfieldline means that one end of the fieldline is attached to a pole and the other end isn’tconnected to anything while a closed fieldline is connected to both poles. By keepingtrack of the end-points while tracing the fieldlines they can easily be classified as eitheropen or closed. Another classification for magnetospheric fieldlines, which was suggestedby Dr. Lutz Rastaetter at CCMC, is to classify each fieldline into one of four categories:

• Open south. Only connected to the south pole

• Open north. Only connected to the north pole

• Closed. Connected to both poles

• Solar wind. Not connected to any pole

The classified fieldline is then mapped to a color corresponding to the type. This isthe main classification which will be used during this thesis.

3.7 Seed Points

Although the numerical tracing method is important to obtain good results, the mostimportant part when tracing fieldlines are the seed points. The difference between field-lines traced with arbitrary placed and expertly placed seed points can be significant.Often times the fieldlines traced with arbitrary placed seed points can completely misscertain interesting features while the more expertly placed seed points can give the useran entirely different view and understanding of the underlaying vector field. Placing seedpoints in a calculated and expertly way, however, can be very difficult and have been aproblem within scientific visualization for a long time.

Calculating where to put seed points optimally requires knowledge about the data andalso the desired features to be visualized. In the case of this thesis and its work, it isknown that the data is about the magnetic field around Earth and that there are certaininteresting features such as magnetic flux tubes in the so called X-points mentionedin section 2.7 and seen in figure 2.6. Dr. Asher Pembroke at the CCMC at NASA’sGoddard Space Flight Center used this knowledge to create an algorithm for optimallyplacing seed points to be able to visualize these interesting and otherwise hard to seefeatures.

15

Page 24: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

3.8. GEOMETRY LINES CHAPTER 3. METHOD & IMPLEMENTATION

Pembroke’s seed point placing algorithm is an iterative approach which uses the resultsof previous fieldline traces to determine where to place the seed points for the nextiteration. First a small number of initial traces are chosen such that at least threedifferent types of fieldlines are present (out of the 4 types mentioned in 3.6). Then, thesetraces are sampled with the local resolution in the model and the sampled positions andplaced into a 3D Delaunay triangulation [11]. For each of the resulting tetrahedra, itis then identified which of those have 1) more than two topology types among the 4vertices and 2) are larger than the local resolution times a factor. The centroid of thosetetrahedra are then used as the seed points for the next iteration of fieldline traces. Theresult of this algorithm is seed points which traces fieldlines that goes through the X-points and shows the magnetic flux tube structure. Visualizations using this Pembroke’salgorithm is seen in figure 4.8.

3.8 Geometry Lines

With the lines traced and classified, the only thing remaining is to draw them to thescreen as geometry. To render the lines, the data needs to be formatted in a way so thatOpenGL can draw them as one GL LINE STRIP per fieldline. The easy but inefficientway of doing it is storing each fieldline as a seperate vertex arrays and drawing them oneat a time using glDrawArrays. This will, however, result in one glDrawArrays call perfieldline per frame which is not optimal. A more optimal approach is storing all verticesfor all fieldlines in one array, have another array for the starting indicies, a third arrayfor the number of indicies per line, and then using glMultiDrawArrays. This will draw allof the fieldlines with only one OpenGL call per frame which is faster and more efficient.An example of the data structure can be seen in figure 3.5.

Figure 3.5: Illustration showing the data structures needed for OpenGL’s glMultiDrawAr-rays call. The colors red, green, and blue represent three fieldlines and the data associatedwith them. ”Line start” specifies where in the line point array each fieldline start and ”Linecount” is the number of verticies per fieldline. Each element in the line points array containthe vertex position {x, y, z} and color {r, g, b, a}.

16

Page 25: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

3.9. LORENTZ FORCE CHAPTER 3. METHOD & IMPLEMENTATION

3.9 Lorentz Force

With the Kameleon wrapper, fieldline tracing, Runge-Kutta, and geometry line renderingimplemented, OpenSpace could visualize any vector variable in the CDF file as fieldlines.The variables, however, does not by themselves show how a charged particle wouldbehave if it got close to earth. For this we use the Lorentz Force equation discussed in2.8 with the initial v0 set to the solar wind velocity sampled at the seed point in theCDF-file.

The equation is solved using the Runge-Kutta-Nystrom method [12] with some sim-plifications. The increments k1, k2, k3, k4 are normalized so that only the directionis taken into consideration, i.e. the magnitude is not considered. This means that thenumerical value of q and m in F = ma doesn’t have to be considered (since they areconstant), only the sign of q which decides if it’s a proton or an electron. The trajecto-ries of these particles will loop around the magnetic fieldlines in a circular motion whiledrifting in the same direction. The functionality for tracing Lorentz force trajectorieswas implemented in the KameleonWrapper class.

3.10 Billboards

Although drawing field-lines and Lorentz force trajectories as GL LINE STRIP is effi-cient and correct, it does leave something to be desired when it comes to visual quality.The main issue is that lines in OpenGL are drawn with a certain width which is definedin screen pixels. This means that the depth and perception of a line is lost and thewidth of a line changes with the resolution of the viewport. A better representationfor the lines is to construct triangle geometry around the line which will instead have awidth which is relative to the rest of the scene and not the viewport. This can be doneduring run-time on the GPU by using a geometry shader which will take a segment of aGL LINE STRIP as input and output a number of triangles.

Instead of drawing a high number of triangles around each line to represent a cylinderit is possible to use a method called billboarding. Billboarding means that for each linea textured quad is drawn and aligned towards the camera. This creates the illusion ofbeing 3-dimensional while simply being a 2D image which is significantly more efficientthan generating and rendering true 3D geometry using many triangles. A problem withusing billboards in this particular case is that there will be overlap and gaps betweentwo adjacent billboards as is illustrated in figure 3.6a. To avoid this problem a chamferneeds to be calculated using information from the adjecent lines. For this there is theGL LINE STRIP ADJACENCY primitive which sends information about current andadjacent vertices to the geometry shader as opposed to using GL LINE STRIP that onlysends vertices for the current line segment.

17

Page 26: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

3.10. BILLBOARDS CHAPTER 3. METHOD & IMPLEMENTATION

(a) Billboards without adjancency informa-tion. (b) Chamfered billboards.

Figure 3.6: Illustrations showing billboards generated using a geometry shader with orig-inal line and vertices in red and generated geometry in black. Figure 3.6a doesn’t use anyinformation from the adjacenct vertices which causes the resulting billboards to overlap andhave gaps. Figure 3.6b illustrates how the billboards look after calculating a chamfer usingthe adjacent vertices p0, p3 to calculate the normals Np1

and Np1using equation 3.4.

Figure 3.6b illustrates how the chamfered billboards are drawn using adjacency infor-mation. The points p1, p2 are part of the current line segment and the points p0, p3are the two adjacent vertices. In equation 3.4 two vectors u and v are calculated asp2 − p1 and p3 − p1 respectively and are used together with the camera view directionVC to calculate the normals Np1 and Np1 for the chamfered new vertices while keepingthe resulting quad aligned towards the camera.

u = p2 − p1

v = p3 − p1

Np1 = VC × u

Np2 = VC × v

(3.4)

For texturing the billboard it is possible to simply use a interpolated normal in thefragment shader and use it to calculate a color instead of using an actual texture. Thisis done in the geometry shader by passing a normal perpendicular to and pointing awayfrom the original line for each new vertex. These normals will then be interpolated toa fragment normal in the fragment shader and the length of the interpolated normalwill correspond to how close the fragment is to the original line. This means that thelength of the fragment normal can be used to adjust the final fragment color giving thebillboard a smooth gradient and adding to the illusion of it being a 3-dimensional tube.

18

Page 27: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

4Results

In this part of the thesis the results of the thesis work is displayed. The figures willshowcase results of the work explained in chapter 3. All figures in this chapter are

screen shots taken of an interactive 3D scene rendered by OpenSpace in real time.

4.1 Volume Rendering

Figure 4.1: The scalar variable ρ (atomic mass density) from a BATS-R-US model outputfile visualized with the volume ray caster. The box for within the ray casting is done hadto be scaled in x since the x-axis is roughly three times the size as the y- and z-axis, asmentioned in section 3.1.

19

Page 28: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

4.2. FIELDLINE TRACING CHAPTER 4. RESULTS

4.2 Fieldline Tracing

Figure 4.2: Magnetic field-lines traced with 4th order Runge-Kutta scheme visualized withgeometry as described in section 3.8. A sphere textured as Earth is placed at the correctposition and scale relative to the field-lines.

20

Page 29: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

4.2. FIELDLINE TRACING CHAPTER 4. RESULTS

Figure 4.3: Comparison between 4th order Runge-Kutta (RK4) and Euler method. Thegreen line is traced with Euler method with a step size h = 10∆ (∆ is the local resolution ofthe last sampled block in the model) and the blue line is traced with RK4 and the same stepsize h. The red line is an oversampled reference traced with RK4 and h = ∆. In the modelrun used for this visualization ∆ = [0.00625, 4.00000]Re which is the range of the spatiallevel mentioned in 3.1.

Figure 4.4: Close up of a field-line traced with Euler (green) and one traced with RK4(red), both with the same step size h = ∆. Even at such a small step size the Euler methodmisses the vortex which is part of a magnetic flux tube.

21

Page 30: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

4.3. FIELDLINE CLASSIFICATION CHAPTER 4. RESULTS

4.3 Fieldline Classification

(a) Seedpoints around Earth

(b) Seedpoints in line through earth

Figure 4.5: Two sets of field-lines colored with the classification described in section 3.6.Figure 4.5a shows seedpoints distributed at uniform distances around Earth and the picturetaken from the side. Figure 4.5b shows seedpoints (shown as pink points) placed along aline going through Earth. Notice how some of the lines, especially the blue, turn straightfurther away from Earth. This is because the magnetic force gets very weak and the linesstart to follow the solar wind.

22

Page 31: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

4.4. BILLBOARDS CHAPTER 4. RESULTS

4.4 Billboards

Figure 4.6: Classified fieldlines visualized with billboards as described in section 3.10.With the billboards it is now possible to see some depth and perspective when the fieldlinesgets further away from the camera.

23

Page 32: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

4.4. BILLBOARDS CHAPTER 4. RESULTS

(a) From the front

(b) Inside the magnetosphere

Figure 4.7: Fieldlines traced around Earth and visualized with billboards shown from thefront in figure 4.7a and from inside the magnetosphere in figure 4.7b.

24

Page 33: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

4.4. BILLBOARDS CHAPTER 4. RESULTS

(a) From the front

(b) Inside

(c) From the side

Figure 4.8: Three angles showing classified fieldlines produced by the seed points createdwith the iterative seed point placement method developed by Dr. Asher Pembroke at CCMCas can be read in section 3.7. Note the flux tube consisting of fieldlines of all classificationsthat bundle together in a tube-like structure on the boundary between the different typesof fieldlines as dicussed in section 2.7.

25

Page 34: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

4.5. LORENTZ FORCE TRAJECTORIES CHAPTER 4. RESULTS

4.5 Lorentz Force Trajectories

Figure 4.9: Lorentz force trajectories visualized with billboards near Earth. Trajectoriesof positive particles (protons) are shown in pink and negative particles (electrons) in cyan.

26

Page 35: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

5Discussion

This section will be used to discuss the results seen in chapter 4 and how it couldbe improved by future work on the OpenSpace project.

5.1 Kameleon Wrapper

The KameleonWrapper -class successfully provides an interface for generating volumetricand line data sets from a CDF-file. This decreases coupling between the Kameleon libraryand the rest of the OpenSpace code base which allows them to work together withoutbeing dependant on each other. However, this means that the name KameleonWrapperis misleading since it doesn’t wrap the functionaliy in Kameleon, i.e. providing thesame interface though an abstract layer. Instead it uses the Kameleon functionality toconstruct a new interface which makes more sense for visualization purposes. The classshould be renamed to reflect this.

The KameleonWrapper -class is also starting to become quite big and will only continueto grow as more kinds of data sets and options are implemented. This means that theclass should be split into multiple classes to be better prepared for expanding in thefuture. Also the building of data sets and reading through Kameleon is all made on asingle thread. By examining the Kameleon library code further it could be determinedif either the functionality is already thread-safe or how much work would be needed tomake it thread-safe and then contribute to the Kameleon development in collaborationwith the CCMC. This could potentially speed up the processing time for building thedatasets and accessing the CDF files.

27

Page 36: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

5.2. FIELDLINE TRACING CHAPTER 5. DISCUSSION

5.2 Fieldline Tracing

All figures in sections 4.2 have been traced with the field-line tracer implemented inKameleonWrapper on the magnetic field variables bx, by, bz from a BATS-R-US modelrun. The figures 4.3 and 4.4 the differences in quality between the Euler method andthe 4th order Runge-Kutta for the numerical stepping. In figure 4.3 the green line istraced with Euler method and step size h = 10∆ (∆ is the local resolution of the lastsampled block in the model run), the blue line is sampled with RK4 and the same stepsize h = 10∆, and the red line is a tightly sampled reference traced with RK4 andh = ∆. The possible values for ∆ are the spatial level range mentioned in 3.1. Wesee that the green line traced with Euler might be reasonably close to the red referenceline from a distance but looks very crude up close and might even miss features such asthe vortices a magnetic flux tube consists of. As suspected and evident from the blueline, RK4 produces a very good estimate even at higher step sizes. Figure 4.4 shows aclose up of two lines both traced with the small step size h = ∆, green line traced withEuler and the red line with RK4. Here we see that even at a small step size the Eulermethod can completely miss more advanced and interesting structures such as part ofa flux tube which the red line correctly traces. The significant increase in quality andcorrectness naturally comes with a cost in performance. The Euler method is 4 timesfaster than RK4 since RK4 in essence takes 4 Euler steps for each step. This meansEuler can produce decent results for more simple tracings at much higher speeds, whichmakes it more suitable for real time tracing. Adding support for real time tracing andvisualizations in OpenSpace could be an extension to the work presented in this thesis.

The figures 4.5a and 4.5b show two sets of field-lines rendered with the classificationdescribed in chapter 3.6. Figure 4.5a is traced with seed points placed uniformly in acube around earth and picture taken from the −z side and figure 4.5b is traced withseed points in a line along the x-axis going through earth. The classification gives theuser a clear distinction between the different types of field-lines and even with arbitraryplaced seed points we can see characteristics such as the open field-lines bundling intotwo separate tube-like structures.

5.3 Billboards

Most of the focus during this thesis work has been on getting scientifically accuraterepresentations, being able to visualize interesting features and proper classification offeatures. Some work, however, was done purely for the sake of increasing the visualquality. This work was the implementation of visualizing lines as billboards, as describedin section 3.10. Figures 4.6 and 4.7 show two sets of fieldlines visualized with billboards.The advantage over using billboards instead of GL LINES is that the width of a line isnow relative to the scene, not the viewport which means that some perspective and depthcan be seen. The lines also appear smoother and less aliased than before, all of whichcontributes to higher visual quality. The downsides of using billboards is the natural

28

Page 37: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

5.4. SEED POINTS CHAPTER 5. DISCUSSION

trade-off between computation time and visual quality but also that the billboards canlook crude up close. A possible solution for this would be to have a dynamic level of detailwhich would set the size of the billboards relative to the distance to the camera. Anotherway of increasing the visual quality up close is to place two billboards perpendicular toeach other at every line segment. This increases the 3-dimensional illusion when up closebut does next to nothing when further away and requires twice the geometry comparedto using one billboard per line.

5.4 Seed Points

Although arbitrarily placed seed points can give us a good general idea of how themagnetic field around Earth behaves, other more specific features are usually lost. Thesefeatures are often the more interesting parts and visualizing them is a bit trickier. Oneof these interesting features is the magnetic flux tube, explained in section 2.7, which isfound in the boundary region between the different types of field-lines. The magneticflux tube is shown in figures 4.8a, 4.8b, and 4.8c. These fieldlines are traced with theseed points created by the method described in section 3.7 and visualized as billboards.Using these specialized seed points helps us understand features which we weren’t ableto see before. These seed points, however, are created by a standalone experimentalmethod which isn’t integrated with OpenSpace as of writing. The seed points are storedin a separate file after generating and is then read into OpenSpace at start up andtraced. This is not very flexible and if the method will be used further then it should beimplemented natively in OpenSpace or as a submodule.

5.5 Lorentz Force Trajectories

The Lorentz force trajectories shown in figure 4.9 have been traced with the methoddescribed in 3.9 and the functionality for tracing these trajectories is implemented inthe KameleonWrapper. These trajectories show the path of electrons (in cyan) andprotons (in pink) emitted from the Sun as they are being affected by the magnetic andcurrent field in Earth’s magnetosphere. The decision to set the initial particle velocityv0 to the sampled solar wind velocity at the seed point caused some discussion withthe NASA researchers who thought it was an interesting approach. This visualizationcan be used to get a sense of how actual charged particles behave when entering Earth’smagnetosphere.

29

Page 38: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

6Conclusion

The results and discussion presented in this thesis show how fieldlines can be usedto visualize Earth’s magnetic field and its interesting features. These results have

been implemented in the OpenSpace project which will continue to be developed inthe future by new theses works. These future theses will be build upon and be depen-dent on the work presented in this thesis, particularly the KameleonWrapper interfaceto CCMC’s Kameleon framework to read space weather data and construct data sets.The interface provided in KameleonWrapper together with having the Kameleon frame-work in its own sub module enables OpenSpace to grow and be developed side-by-sidewith Kameleon without either being directly dependent on each other. This paper alsohighlights the importance in intelligent seedpoint placement and show how much moreinteresting information and features can be seen when using an algorithm such as theone presented in section 3.7. The results also show the big difference between the twonumerical integration methods Euler and 4th order Runge-Kutta, where Runge-Kuttavastly outperforms Euler albeit being more computationally expensive. The functional-ity to trace and render Lorentz force trajectories for protons and electrons give insightinto how actual particles emitted from the Sun behave whilst being in Earth’s magne-tosphere. This is useful for understanding the interaction between the Sun and Earthbut also in general between a star and its surrounding planets. As the work on this the-sis progressed, NASA scientists at CCMC has continually been part of the process andproviding both feedback and knowledge about space weather and the magnetosphere.Often as the development progressed the results were hard to understand correctly andthe expertise provided by the CCMC was a great help in understanding the data andresults. The Hayden Planetarium at AMNH has also been part of the development andproviding suggestions and feedback from their standpoint in wanting to use OpenSpaceas a tool for visualizing NASA data and space to the public. The continuation of this col-laboration between the three stakeholders provides the project a very broad perspectiveand knowledge which is essential for the future growth of OpenSpace.

30

Page 39: Visualizing Space Weather: Acquiring and Rendering Data of ...liu.diva-portal.org/smash/get/diva2:1375792/FULLTEXT01.pdf · visualizing space weather [1] and Victor Sand who looked

Bibliography

[1] M. Tornros, Interactive visualization of space weather data, Master’s thesis,Linkoping University (jun 2013).

[2] V. Sand, Dynamic visualization of space weather data, Master’s thesis, LinkopingUniversity (feb 2014).

[3] The National Space Weather Program, Strategic plan, FCM-P30-1995.

[4] Space Weather:A Research Perspective, The National Academies Press, 1997.URL http://www.nap.edu/openbook.php?record_id=12272

[5] CSEM and CRASH team, BATS-R-US and CRASH User Manual, University ofMichigan, version 9.10 (oct 2011).

[6] C. T. Russell, Geophysical coordinate transformations, Cosmic Electrodynamics(1971) 184–196.

[7] Space Physics Data Facility, CDF User’s Guide, NASA Goddard Space Flight Cen-ter, version 3.4 (feb 2012).

[8] D. J. Griffiths, Introduction to Electrodynamics (3rd Edition), Benjamin Cum-mings, 1998.

[9] J. C. Butcher, The Numerical Analysis of Ordinary Differential Equations: Runge-Kutta and General Linear Methods, Wiley-Interscience, New York, NY, USA, 1987.

[10] K. I. Joy, Numerical methods for particle tracing in vector fields (mar 2007).URL http://graphics.cs.ucdavis.edu/~joy/ecs277/

[11] P. Maur, Delaunay triangulation in 3d, Tech. Rep. DCSE/TR-2002-02, Universityof West Bohemia in Pilsen (2002).

[12] I. Mandre, Non-relativistic charged particle motion in the electric and magneticfields using the runge-kutta-nystrom method (sep 2007).URL http://www.mare.ee/indrek/ephi/nystrom.pdf

31