pfsspy: A Python package for potential field source surface modelling
David Stansby, Anthony R. Yeates, Samuel T. Badman
Abstract
Magnetic fields play a crucial role in the dynamics and evolution of our Sun and other stars. \nA common method used to model the magnetic fields in solar and stellar atmospheres is the \npotential field source surface (PFSS) model (Altschuler & Newkirk, 1969; Schatten, Wilcox, \n& Ness, 1969). The PFSS equations assume that there is zero electrical current in the domain \nof interest, leading to the equations // \n \n∇ · B = 0; ∇ × B = 0 (1) // \n \nThese are solved in a spherical shell between the surface of the star and a configurable outer \nradius called the ‘source surface’. Boundary conditions are given by the user specified radial \ncomponent of B on the inner boundary and the imposed condition of a purely radial field on \nthe source surface, which mimics the effect of the escaping stellar wind. \nHistorically, either custom implementations or the pfsspack1 \nIDL library have been used to \nperform PFSS extrapolations. As Python has become a major programming language within \nthe solar physics and wider astronomy community (Bobra et al., 2020), there is a need to \nprovide well documented and tested functionality to perform PFSS extrapolations within the \nPython ecosystem, a niche that pfsspy fills.