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)