Heliophysics and Programming Converge at PyHC Summer School

Against a background image showing the Sun in blues, reds, oranges, and purples, the words "Python in Heliophysics Summer School" are written in white.
The PyHC Summer School welcomes early career scientists, students, post-doctoral researchers, and senior scientists to learn the foundations of Python-powered research and about how to join the growing community. Credit: PyHC

A celebration of open-source software kicked off at the Python in Heliophysics Community (PyHC) Summer School in Boulder, Colorado, this week. Anyone can tune in virtually through May 24 to watch live-streamed demos and presentations from this NASA-funded project showcasing how the Python programming language is at the forefront of innovation in heliophysics research and data analysis.

Python is a free and open-source programming language designed to be intuitive and easy to read with interactive applications that enable collaboration. It can also integrate older programming languages and run in many environments, including remote servers hosted in the cloud. PyHC is a community of scientists, open-source developers, and research software engineers who are passionate about Python.

“It’s kind of the intersection of science and software programming,” says Julie Barnum, principal investigator for PyHC and project manager at University of Colorado’s Laboratory for Atmospheric and Space Physics (LASP). “Most of the people involved in our community are scientists, or work really close with scientists, and started developing these packages because they saw a need for it.”

PyHC offers a suite of diverse, standardized Python software packages with functions ranging from data access and downloads to analysis, visualization, and plotting. Seven core packages provide a wide range of capabilities, while dozens of additional software libraries can carry out more targeted, specific calculations. 

Two charts, each with an image of the Sun. The image on the left is a golden, 2D Sun against a black background. The image on the right shows the same image, but from the side, slightly at angle, and appearing 3D.
The left panel shows an image of the Sun captured in a wavelength of extreme ultraviolet light at 171 angstroms by the Atmospheric Imaging Assembly (AIA) instrument on NASA’s Solar Dynamics Observatory (SDO) spacecraft. The right panel shows the same image reprojected from a different vantage point using the reprojection capabilities available with SunPy open-source software. Credit: AIA data courtesy of NASA/SDO and the AIA, EVE, and HMI science teams. Image created using version 5.0.0 of the SunPy open source software package (DOI: 10.5281/zenodo.8037332)

Heliophysics research explores the nature of the relationship between the Sun, planets, asteroids, comets, and space environment as a dynamic system. PyHC formed in 2018 from a NASA grant that intended to bring together people from different areas of heliophysics who were already working with Python to support scientific discovery. 

“We’ve long recognized that the community was doing great work and wanted to help create an organization which would coordinate and advertise this work to our broader community of heliophysics researchers,” explains Brian Thomas, project scientist at NASA’s Heliophysics Digital Resource Library (HDRL). “Python is one of the primary languages to analyze data in heliophysics now.” 

The community has expanded to include volunteers from various institutions including NASA, universities, and international agencies. Volunteers support PyHC outreach events, virtual and in-person meetings, and scientific conferences. 

The PyHC Summer School is welcoming early career scientists, students, post-doctoral researchers, and senior scientists to LASP this week to learn the foundations of Python-powered research and about how to join the growing community. Sessions throughout the week streaming live on YouTube are highlighting PyHC’s seven core packages. Students on site can take part in interactive coding exercises and a challenge game, while software enthusiasts at home can download any of the free packages and follow along with the tutorials they choose. Presentations on machine learning and searching for data in heliophysics are also scheduled.

This is the second PyHC Summer School event. The inaugural gathering took place in Madrid, Spain, in 2022 in partnership with the European Space Astronomy Centre

Collaboration is a key aspect of the PyHC community. PyHC supports NASA’s open science initiative by creating standards in open-source software development so anyone can find, access, and contribute to projects. 

“Open science is important because it makes data accessible and usable by all,” Barnum says. “It brings a lot of different people to the table and I think, especially when it comes to research, if you can get more voices and different backgrounds involved, you just have better research in the end.” 

PyHC Core Packages

Heliophysics Application Programmer’s Interface (HAPI) client
Access and retrieve heliophysics data captured as a time series from various sources. 

Kamodo
An official NASA open-source Python package built upon the functionalization of datasets providing data analysis via function composition, automatic unit conversions, and publication-quality graphics, all using intuitive and simplistic syntax. 

A graph that shows four horizontal bars. The bottom one has thick bands of green, yellow, red, and blue. The second from the bottom is primarily green, yellow, and red. The second from the top has a thick green band, thin yellow and red bands, and a thick blue band. The top one is white with a dark red line cutting horizontally through the middle, and bright green splotches. The graph is labeled with information about the levels from a magnetometer.
A visualization produced by PySPEDAS open-source software shows waves observed by the search-coil magnetometer (SCM) onboard the Magnetospheric Multiscale (MMS) mission. Credit: Grimes EW, et al. (2022) The Space Physics Environment Data Analysis System in Python. Frontiers in Astronomy and Space Sciences. 9:1020815. DOI: 10.3389/fspas.2022.1020815

PlasmaPy
An open-source, community-developed Python package for plasma research and education. 

Python Satellite Data Analysis Toolkit (pysat)
Management and analysis tool for satellite and radar data that provides a simple and flexible interface for downloading, loading, cleaning, managing, processing, and analyzing data.

Space Physics Environment Data Analysis Software (PySPEDAS)
Tools for loading, analysis, and plotting of data from various heliophysics missions and ground magnetometers.

SpacePy
A space science library that includes file Input/Output, time, and coordinate conversions as well as common analysis techniques.

SunPy
Python package for solar physics that enables users to search and download from various data sources, analyze time series and image data from different observatories in a consistent interface, and transform data between coordinate systems when combining data from multiple spacecraft. 

To see the PyHC Summer School schedule and tutorials, visit pyhc.org/summer-school-24.

Watch the PyHC Summer School live stream and recorded sessions here

By Rose Brunning
Communications Lead
NASA Heliophysics Digital Resource Library (HDRL)

Earth’s Magnetosphere and Plasmasheet

The Earth, surrounded by lines shooting out in many directions. They are labeled Interplanetary Magnetic Field Lines, which flow toward Earth. A bend in on of those lines is a Bow Shock. Lines looping out from Earth are labeled magnetosheath, magnetopause, magnetotail. Shaded areas billowing out from Earth are the Plasmasphere, Radiation Belts, and Plasma Sheet.
Our magnetosphere is part of a dynamic, interconnected system that responds to solar, planetary, and interstellar conditions – and it all starts deep inside Earth. Credit: NASA/Aaron Kaase

A magnetosphere is that area of space, around a planet, that is controlled by the planet’s magnetic field. The shape of the Earth’s magnetosphere is the direct result of being blasted by solar wind. The solar wind compresses its sunward side to a distance of only 6 to 10 times the radius of the Earth.

A supersonic shock wave is created sunward of Earth called the bow shock. Most of the solar wind particles are heated and slowed at the bow shock and detour around the Earth in the magnetosheath. The solar wind drags out the night-side magnetosphere to possibly 1000 times Earth’s radius; its exact length is not known. This extension of the magnetosphere is known as the magnetotail. The outer boundary of Earth’s confined geomagnetic field is called the magnetopause. The Earth’s magnetosphere is a highly dynamic structure that responds dramatically to solar variations.

Also residing within the magnetosphere are areas of trapped charged particles; the inner and outer Van Allen Radiation Belts, the plasmasphere, and the plasmasheet.

Layers of the Sun

The Sun, with layers labeled: Core, radiative zone, Convection zone, chromosphere, and corona. Features, including a solar prominent, subsurface flows, sunspots, flare, and a corona hole are labeled.
The Sun is a dynamic star, constantly changing and sending energy out into space. By studying our Sun, scientists can better understand the workings of distant stars. Credits: NASA

The Sun and its atmosphere consist of several zones or layers. From the inside out, the solar interior consists of:

  • The Core – the central region where nuclear reactions consume hydrogen to form helium. These reactions release the energy that ultimately leaves the surface as visible light.
  • The Radiative Zone – extends outward from the outer edge of the core to base of the convection zone, characterized by the method of energy transport – radiation.
  • The Convection Zone – the outermost layer of the solar interior extending from a depth of about 200,000 km to the visible surface where its motion is seen as granules and supergranules.

The solar atmosphere is made up of:

  • The Photosphere – the visible surface of the Sun.
  • The Chromosphere – an irregular layer above the photosphere where the temperature rises from 6000°C to about 20,000°C.
  • A Transition Region – a thin and very irregular layer of the Sun’s atmosphere that separates the hot corona from the much cooler chromosphere.
  • The Corona – the Sun’s outer atmosphere.

Beyond the corona is the solar wind, which is actually an outward flow of coronal gas. The Sun’s magnetic fields rise through the convection zone and erupt through the photosphere into the chromosphere and corona. The eruptions lead to solar activity, which includes such phenomena as sunspots, flares, prominences, and coronal mass ejections.

This infographic labels the parts of the Sun (from most inward to outward): Solar Core, Radiative Zone, Convection Zone, Photosphere, Chromosphere, Transition Zone, and Corona.It explains that the Sun's outermost layer is hotter than the layers immediately below that. This is a major unsolved puzzle in heliophysics.
At the heart of our solar system is the Sun. Even though the temperature of these layers is known, heliophysicists are still researching why the Sun’s corona, or atmosphere, is hotter than the layers immediately below it. Credits: NASA

Jack Eddy Fellowship: 5 New Researchers Selected

Five researchers supported by NASA’s Living With a Star Program will join the 2023-2024 class of NASA’s Jack Eddy Postdoctoral Fellowship.

The early career PhDs, selected by the University Corporation for Atmospheric Research (UCAR)’s Cooperative Program for the Advancement of Earth System Science (CPAESS), will research interdisciplinary projects contributing to the field of heliophysics at a host institution for the next two years.

The Jack Eddy Postdoctoral Fellowship was founded in 2009 in honor of pioneering solar researcher John A. “Jack” Eddy. The program matches the fellows with experienced scientists at the host institutions to train the next generation of Sun-Earth researchers.

Five pictures of people in front of an image of the Sun. Below them, text reads "NASA Jack Eddy Fellows 2023"
NASA Jack Eddy Fellows will research interdisciplinary heliophysics topics at host institutions. From left to right, they are Robert Jarolim, Devojyoti Kansabanik, Mei-Yun Lin, Charlotte Waterfall, and Peijin Zhang. Credits: UCAR | CPAESS

2023 NASA Jack Eddy Postdoctoral Fellowship Awardees

Peijin Zhang
Host: Dr. Bin Chen of New Jersey Institute of Technology, Newark, NJ
PhD Institution: University of Science and Technology of China (USTC)
Proposal: Radio Imaging Spectroscopy for CMEs and CME-driven Shocks

Charlotte Waterfall
Host: Dr. Georgia deNolfo of NASA’s Goddard Space Flight Center
PhD Institution: University of Manchester
Proposal: Bad News Travels Fast: Energetic Particle Transport in the Heliosphere

Robert Jarolim
Host: Dr. Matthias Rempel at National Center for Atmospheric Research | High Altitude Observatory
PhD Institution: University of Graz
Proposal: Physics-informed Neural Networks for the Simulation of Solar Magnetic Fields

Devojyoti Kansabanik
Host: Dr. Angelos Vourlidas at The Johns Hopkins University Applied Physics Laboratory
PhD Institution: National Centre for Radio Astrophysics, Tata Institute of Fundamental Research
Proposal: Remote Sensing of CME-entrained Magnetic Fields

Mei-Yun Lin
Host: Dr. Andrew R. Poppe at the University of California, Berkeley
PhD Institution: University of Illinois, Urbana-Champaign
Proposal: From Ionosphere or Moon? A Comprehensive Study of Metallic Ions in the Magnetosphere

By Abbey Interrante
NASA’s Goddard Space Flight Center, Greenbelt, Md. 

NASA Spacecraft Reveal How Earth’s Tilt Causes Seasons in Space Weather

As Earth spins around the Sun, our planet’s slight tilt creates seasons. Now, research from two NASA space missions has found how the same tilt also influences seasonal differences in space weather – conditions in space produced by the Sun’s activity.

Space weather events produce the beautiful glow of the northern and southern lights, but, if intense enough, they can also endanger spacecraft and astronauts, disrupt radio communications, and even cause large electrical blackouts. Since space weather is created by particles and energy sent from the Sun, it varies with the Sun’s 11-year cycle of activity – the solar cycle. But space weather also varies on shorter timescales, such as seasonally and daily.

The new results, published in the journal Nature Communications, found that the seasonal differences are caused by a phenomenon known as the Kelvin-Helmholtz instability. This instability forms curling waves at the boundary between two regions – such as different layers of the atmosphere or between air and water – flowing at different speeds. These waves sometimes occur in Earth’s atmosphere, resulting in unique cloud formations that look like a series of crashing ocean waves. In space, these waves are composed of charged particles that are energized and pushed toward Earth, resulting in enhanced space weather effects.

The new findings confirm that Kelvin-Helmholtz waves are more commonly produced during the spring and fall equinoxes. During the equinoxes, Earth is not tilted toward or away from the Sun. As a result, the orientation of the Sun’s and Earth’s magnetic fields is ideal for forming Kelvin-Helmholtz waves. When Earth’s magnetic field is tilted at extremes toward or away from the Sun – such as during the summer and winter solstices – few Kelvin-Helmholtz waves are created.

On the left, the Earth orbits the Sun. The Earth is labeled "Winter Solstice", "Spring Equinox", "Summer Solstice", and "Fall Equinox" at different points in the orbit. During the Winter Solstice, the Earth is titled away from the Sun, and toward the Sun during the Summer Solstice.On the right, Earth is surrounding by magnetic fields. The surrounding area is red and orange in the image depicting the equinox, but less busy, and orange and blue in the image depicting the solstice.
The simulation (right) shows the Earth’s magnetic environment during the equinox and the solstice. As the solar wind – a flow of particles from the Sun – hits the Earth’s magnetic environment, it can create breaking waves known as Kelvin-Helmholtz waves. This occurs more often during the equinoxes due to the orientation of the Sun’s and Earth’s magnetic fields (left). Credits: Shiva Kavosi, ERAU

“We have discovered that Kelvin-Helmholtz waves in the space around Earth are seasonal, which explains an important factor in the seasonal variation of space weather,” said the lead author on the new study, Shiva Kavosi, a researcher at Embry–Riddle Aeronautical University in Daytona Beach, Florida. “These waves are ubiquitous and can be found roughly 20 percent of the time around Earth, but after monitoring over an entire solar cycle, we now know there are more chances observing them during certain times of the year.”

To make the discovery, scientists used 11 years of data from NASA’s Time History of Events and Macroscale Interactions during Substorms, or THEMIS, mission, as well as four years of data from the Magnetospheric Multiscale, or MMS, mission. “The unique orbits and long period of observations by THEMIS made this discovery – which was first theorized in the 1970s – possible,” Kavosi said.

By better understanding how Kelvin-Helmholtz waves form due to Earth’s seasonal tilt, researchers can better forecast its effects and plan accordingly to ensure spacecraft and astronaut safety. “Additionally, space weather forecasters can now add this component to their models for better forecasting,” Kavosi said.

By Mara Johnson-Groh
NASA’s Goddard Space Flight Center, Greenbelt, Md.

Artemis I Payload CuSP CubeSat Mission Update

The CubeSat to Study Solar Particles (CuSP) launched as an Artemis I payload on 1:47 AM EST on Nov. 16, 2022. CuSP was deployed from its canister about eight hours after launch. Approximately two hours after deployment, CuSP transmissions were received by an Open Loop Receiver (OLR) operated by NASA’s Jet Propulsion Laboratory’s Radio Science Systems Group. The OLR recorded approximately 60 minutes of transmission from CuSP. Unfortunately, the CuSP team has not re-established contact with the CubeSat after the initial contact.

In the initial OLR contact (which was listening mode only) CuSP was operating mostly as expected. The solar arrays deployed, and they were stable and pointing at the Sun. However, anomalous software resets and temperature readings were reported during the contact.

NASA’s Deep Space Network (DSN) provided the mission team a downlink-only pass eight hours after deployment as well as a contact with CuSP 11 hours after deployment. CuSP radio transmissions were not detected during either of these DSN opportunities. No further radio transmissions have been received from CuSP during subsequent scheduled DSN contacts.

During the initial OLR contact period, CuSP experienced three software reboots. One ended during the start of the data collection period, one occurred in the middle of the data collection, and one occurred at the end. However, the OLR signal indicated that CuSP remained powered on after the last reboot.

An unexplained battery anomaly also occurred at the end of the initial data collection period. Two minutes prior to the end of the data collection period, one of the battery cells suddenly experienced a temperature spike – jumping from 34 degrees Celsius to more than 168 degrees Celsius in under a minute. The temperature of the anomalous cell subsequently increased from approximately 34 degrees Celsius to about 80 degrees Celsius before loss of contact.

The CuSP team is investigating the cause of the sudden battery temperature increase and working to find a solution. The team is also working to regain contact with the spacecraft.

CuSP was designed to be one of the first CubeSats to explore interplanetary space, the region around the Sun and planets of our solar system. This CubeSat’s objective is to study the solar wind particles and magnetic fields that stream from the Sun and the relationship of this solar wind to more energetic particles generated by solar activity.

By Denise Hill
NASA Headquarters, Washington