![]() |
| The wave dispersion solver for cold plasma dispersion. Credit: Earth and Space Science (2026). DOI: 10.1029/2025ea004479 |
New open-source Python-based software boosts space-weather modeling
A New Tool Democratizes Radiation Belt Science
For decades, the mathematical codes needed to model how electromagnetic waves scatter killer electrons in Earth's radiation belts were locked inside a handful of specialized research groups. An open-source Python package called PIRAN aims to change that—at a moment when the stakes for getting space weather right have never been higher.
• April 20, 2026
Bottom Line Up Front
The Problem in Near-Earth Space
Earth’s Van Allen radiation belts are two concentric doughnuts of energetic charged particles trapped by the planet’s magnetic field, stretching from roughly 640 kilometers to more than 58,000 kilometers above the surface. Discovered in 1958 by instruments aboard Explorer 1—America’s first satellite—they were one of the earliest revelations of the space age. Nearly seven decades later, these belts remain, in the words of Northumbria University’s Professor Clare Watt, “frustratingly unpredictable.”
The unpredictability matters enormously. High-energy electrons spiraling along magnetic field lines can penetrate spacecraft shielding and deposit charge in dielectric materials, triggering discharges that damage or destroy onboard electronics through a process called deep dielectric charging. Solar panels degrade under cumulative particle bombardment. Navigation systems falter when radiation belt disturbances propagate into the ionosphere. The European Space Agency’s Juha-Pekka Luntama warned delegates at a 2025 space sustainability conference that damage from a single severe space weather event could cost Europe tens of billions of euros, with some global projections exceeding €2 trillion. Lloyd’s of London has estimated that a single significant solar storm could impose economic losses of $17 billion, with cumulative five-year costs as high as $2.4 trillion.
Yet despite these stakes, the computational tools needed to model exactly how electromagnetic waves interact with radiation belt particles have historically been the province of a small number of specialized groups, each working with proprietary or semi-proprietary code. PIRAN represents a deliberate effort to break that bottleneck.
What PIRAN Does—and Why It Was Hard to Do
At the heart of radiation belt physics lies the concept of resonant wave-particle interactions. Electromagnetic waves—particularly whistler-mode chorus emissions, plasmaspheric hiss, and electromagnetic ion cyclotron (EMIC) waves—can exchange energy with charged particles when the wave frequency matches a harmonic of the particle’s gyration around magnetic field lines. These interactions can accelerate electrons to relativistic speeds or scatter them into the atmosphere, where they are lost.
The standard theoretical framework for describing these interactions is quasilinear diffusion theory, formalized in the 1960s. Under this framework, the cumulative effect of myriad resonant encounters is captured by diffusion coefficients—mathematical quantities that describe how rapidly particles are scattered in pitch angle (the angle between a particle’s velocity and the magnetic field) and in energy. Calculating these coefficients accurately requires solving electromagnetic wave dispersion relations in cold plasma, integrating over particle bounce trajectories between magnetic mirror points, and summing contributions from multiple resonance harmonics. A 2026 review in Reviews of Modern Plasma Physics by Tao describes the challenge as one of the two central problems in radiation belt modeling.
The most influential prior code in this domain has been PADIE (Pitch Angle and Energy Diffusion of Ions and Electrons), developed at the British Antarctic Survey by Dr. Sarah Glauert and Professor Richard Horne and published in 2005. PADIE uses the full electromagnetic dispersion relation and has been applied successfully at Earth, Jupiter, and Saturn. It forms a critical input to the BAS Radiation Belt Model, one of the world’s leading global simulation tools. But PADIE, like the VERB code developed at UCLA, the diffusion coefficient machinery within LANL’s DREAM code, and several other packages, has never been released as a fully open-source, community-extensible tool.
PIRAN fills this gap. Written entirely in Python and released under the GNU General Public License version 3, it calculates both local and bounce-averaged relativistic diffusion coefficients using the two principal formalisms in the current literature—those of Glauert and Horne (2005) and Cunningham (2023). Its design philosophy, as described in the Earth and Space Science paper, emphasizes transparency, extensibility, and reproducibility. The code is hosted on GitHub with detailed user documentation, a full commit history, and a changelog.
“These calculations are essential for understanding how charged particles behave in Earth’s radiation belts, yet until now they required specialist, hard-to-access software. By making these capabilities openly available in Python, PIRAN removes a major barrier for researchers and enables wider, more collaborative development of future space weather models.” —Dr. Oliver Allanson, University of Birmingham
The initial release (PIRAN 1.1.0) supports electron diffusion coefficients for whistler-mode waves in a fully ionized proton-electron cold plasma. The team validated their outputs against classic trusted codes, confirming agreement. Future releases are expected to incorporate additional wave modes, more complex plasma compositions, and resonance-broadening effects described in Allanson et al. (2022) and Yu et al. (2025).
Inside the Codebase
The PIRAN source code is hosted on GitHub under the RB-ENVIRONMENT organization (github.com/RB-ENVIRONMENT/PIRAN) and is written entirely in Python, requiring version 3.10 or later. As of Release 1.1.0 (March 5, 2026), the repository contains 654 commits—reflecting substantial iterative development and testing—and is licensed under the GNU General Public License version 3. Full API documentation is published via Sphinx at rb-environment.github.io/PIRAN.
The package is organized into nine core modules, each handling a distinct element of the diffusion coefficient pipeline. The cpdr
module solves the cold plasma dispersion relation, computing the
relationship between wave frequency and wave vector for a given plasma
environment; it includes a ResonantRoot class for identifying resonance conditions between waves and particles at specific harmonics. The diffusion
module contains the central physics engine, providing functions to
compute pitch-angle, energy, and mixed pitch-angle–energy diffusion
coefficients for a single resonance, as well as a top-level get_diffusion_coefficients()
function that sums over all contributing harmonics. Supporting this are
functions for calculating the wave power spectral density, the
normalized wave intensity, and the singular term that appears in the
resonance integral. The stix module implements the Stix
parameters—the classical S, D, P, R, and L coefficients that describe
electromagnetic wave propagation in a cold magnetized plasma—which feed
directly into the dispersion solver.
Three modules define the physical environment: plasmapoint
characterizes the local plasma composition (including a convenience
property for the lower hybrid frequency, added in version 1.0.1); magpoint specifies the magnetic field geometry at a given location along a field line; and gauss defines the Gaussian wave frequency spectrum, with a factory method from_gyrofrequency_params()
that allows users to specify spectral parameters in terms of the
electron gyrofrequency ratio, matching common conventions in the
literature. The wavefilter module enforces physical validity constraints on wave properties—its WhistlerFilter
class, for instance, ensures that the wave frequency remains above the
lower hybrid frequency and that the resonance cone angle is real-valued.
The normalisation module implements the normalization
factors for both the Glauert & Horne (2005) and Cunningham (2023)
formalisms, allowing users to switch between the two approaches.
A separate src/scripts/ directory contains the
bounce-averaged diffusion coefficient driver script, which integrates
local diffusion coefficients along a particle’s bounce trajectory
between magnetic mirror points. The version 1.1.0 changelog documents
several important refinements: wave frequency spectrum parameters are
now held fixed with respect to magnetic latitude during bounce averaging
(defined in terms of equatorial gyrofrequency in the input file), and
number density is similarly fixed with respect to latitude—corrections
that ensure physical consistency when integrating along the field line. A
numerical fix caps the integration upper limit at 0.9999 times the
mirror point latitude to avoid ambiguity in how the integrable
singularity at the mirror point is handled.
The development workflow reflects modern scientific software engineering practices: the repository uses pre-commit hooks with ruff and black for automated code formatting and linting, a pyproject.toml build configuration, and continuous integration via GitHub Actions. Users install the package with pip install .[dev]
into a standard Python virtual environment or Conda environment. The
architecture is deliberately modular—designed so that extending PIRAN to
new wave modes (such as EMIC waves or Z-mode), different plasma
compositions (multi-ion species), or entirely new physics (nonlinear
resonance broadening) requires incremental additions to existing modules
rather than wholesale restructuring.
A Convergence of Urgency
PIRAN’s release arrives at a moment when multiple developments have converged to make radiation belt science more consequential than at any point in history.
The Gannon Superstorm
Between May 10 and 12, 2024, Earth experienced its most powerful geomagnetic storm since the Halloween storms of 2003. Named the Gannon storm in memory of space weather physicist Jennifer Gannon, who died eight days before the event, the G5-class disturbance was triggered by a barrage of coronal mass ejections from Active Region 13664. What made the Gannon storm historically unique was not merely its intensity but the context in which it struck: for the first time, a major geomagnetic storm hit a low Earth orbit (LEO) environment populated by more than 10,000 active satellites.
The consequences were immediate. Atmospheric heating caused the thermosphere to expand, dramatically increasing aerodynamic drag on LEO spacecraft. Thousands of satellites—predominantly Starlink spacecraft performing autonomous orbit maintenance—maneuvered en masse to compensate for sudden altitude loss. NASA’s ICESat-2 entered safe mode. The Colorado Inner Radiation Belt Experiment (CIRBE) CubeSat deorbited prematurely five months later. ESA’s Sentinel-2 satellites experienced power spikes in their attitude control systems. The combination of unpredictable drag perturbations and thousands of simultaneous maneuvers overwhelmed existing conjunction assessment infrastructure, making collision avoidance effectively impossible during the storm and its aftermath.
Research from Nagoya University published in Earth, Planets and Space showed that the Gannon storm compressed Earth’s plasmasphere to approximately one-fifth its normal size, and recovery took more than four days. The plasmasphere’s electron density distribution directly controls radiation belt dynamics—lower density conditions favor the buildup of killer electrons, precisely the particles that threaten satellite hardware.
A forecast performance assessment by Parker and Linares, published in the Journal of Spacecraft and Rockets, found that even one-day-ahead predictions of the storm’s geomagnetic intensity were poor, underscoring the limitations of current forecasting capability. These limitations trace directly back to inadequacies in the physics-based models that require accurate diffusion coefficients of exactly the kind PIRAN computes.
The UK’s £4 Million Radiation Belt Investigation
Just days before PIRAN’s publication, Northumbria University announced a £4 million award from the Science and Technology Facilities Council for a five-year project to investigate why radiation belts behave so erratically. Led by Professor Clare Watt and including Dr. Allanson among the investigators, the project will combine spacecraft data from international missions with advanced computer modeling to address two central questions: what determines how much solar wind energy reaches the radiation belts, and whether the system is inherently chaotic—meaning small changes in initial conditions can produce radically different outcomes.
The distinction matters profoundly for forecasting. If current predictive failures stem from incomplete physics, better models can close the gap. If parts of the system are fundamentally chaotic, forecasters must develop probabilistic approaches rather than deterministic ones. Either conclusion would transform how space weather prediction operates. Northumbria already contributes to the UK’s £20 million SWIMMR (Space Weather Instrumentation, Measurement, Modelling and Risk) programme, which supports the Met Office in developing operational space weather forecasting.
AI Enters the Arena
In August 2025, IBM and NASA released Surya, an open-source AI foundation model trained on nine years of high-resolution imagery from NASA’s Solar Dynamics Observatory. Surya represents the first heliophysics AI foundation model trained on high-resolution solar data and achieved a 16 percent improvement in solar flare classification accuracy over existing benchmarks in initial testing. It can visually predict flare locations up to two hours in advance—a capability that existing physics-based models lack entirely.
Surya complements rather than replaces tools like PIRAN. The AI model excels at pattern recognition in solar imagery—detecting the precursors of flares and coronal mass ejections at their source. But once those eruptions arrive at Earth, predicting their effect on the radiation belts still requires the kind of wave-particle interaction physics that PIRAN encodes. The end-to-end space weather prediction pipeline thus demands both: AI for upstream event detection and physics-based diffusion models for downstream magnetospheric response. NASA’s Heliophysics Division Director Joseph Westlake emphasized this integrated vision, noting that society is built on technologies highly susceptible to space weather and that applying AI to heliophysics data is a vital step in increasing defensive capability.
What Remains Unsolved
PIRAN’s release is a significant infrastructure advance, but the fundamental scientific challenges in radiation belt modeling remain formidable. A 2024 study led by Allanson and published in Frontiers in Astronomy and Space Sciences demonstrated that standard quasilinear diffusion theory—the framework PIRAN implements—may not apply as broadly as long assumed. The team of 16 scientists from institutions across the UK, US, and Finland found evidence that nonlinear wave-particle interactions may dominate under conditions commonly encountered in the outer radiation belt.
This is not a flaw in PIRAN but rather a statement about the frontiers of the field. The code is explicitly designed to be extended; its architecture anticipates future modules for nonlinear physics, additional wave modes, and multi-species plasma compositions. Work by Osmane et al. (2023) has shown that Alfvénic fluctuations can accelerate electrons on timescales faster than diffusion theory predicts, and Hu et al. (2026) have demonstrated that loss cone geometry—influenced by the choice of geomagnetic field model—significantly affects electron lifetime calculations, a factor often oversimplified in operational models.
The Tao (2026) review in Reviews of Modern Plasma Physics identifies a second fundamental challenge: even when diffusion coefficients are accurately computed, numerically solving the multi-dimensional Fokker-Planck diffusion equation presents its own difficulties, including stability issues with standard finite-difference methods. The field is converging on a recognition that the path from improved diffusion coefficients to improved space weather forecasts requires simultaneous advances in numerical methods, data assimilation techniques, and observational coverage.
Why It Matters Now
The urgency of these advances is driven by a simple arithmetic. When the Halloween storms struck in 2003, approximately 700 active satellites orbited Earth. When the Gannon storm arrived in May 2024, that number exceeded 10,000. By 2030, industry projections suggest the total could surpass 100,000, driven by proliferated LEO constellations from SpaceX, Amazon, and others. Each additional satellite is a potential casualty of radiation belt enhancement and a potential source of collision risk in the aftermath of a geomagnetic storm.
Luntama of ESA noted at the 2025 MSSA conference that the satellite industry has spent two decades in a period of relatively mild space weather, during which a trend toward lower-cost components and less shielding redundancy has taken hold. The generation of satellite engineers who dealt directly with severe space weather effects has largely retired. Solar Cycle 25, which peaked around 2024–2025, has already demonstrated that the Sun has not retired from producing extreme events.
PIRAN, the Northumbria £4 million project, and Surya are all responses to the same strategic realization: the existing tools for understanding and predicting radiation belt behavior are inadequate for the orbital environment humanity is building. Each addresses a different piece of the problem. PIRAN provides the fundamental physics engine. The Northumbria project will test whether the system’s remaining unpredictability is epistemic (solvable with better physics) or ontological (requiring probabilistic methods). Surya tackles upstream detection. Together, they form the outlines of a next-generation space weather enterprise—one that is open, collaborative, and commensurate with the scale of infrastructure it must protect.
Whether that enterprise matures before the next Gannon-class event—or something worse—arrives, is not a question science can answer. It is a question of institutional will, sustained funding, and the willingness of a historically fragmented research community to share its tools. On that score, PIRAN’s release under GPLv3, and the decision to write it in the most widely used scientific programming language on Earth, represent exactly the kind of philosophical shift the field requires.

No comments:
Post a Comment