Computation of Winding-Based Magnetic Helicity and Magnetic Winding Density for SHARP Magnetograms in Spherical Coordinates

Magnetic helicity has been used widely in the analysis and modelling of solar active regions. However, it is difficult to evaluate and interpret helicity in spherical geometry since coronal magnetic fields are rooted in the photosphere and helicity is susceptible to gauge choices. Recent work extended a geometrical definition of helicity from Cartesian to spherical domains, by interpreting helicity as the average, flux-weighted pairwise winding of magnetic-field lines. In this paper, by adopting the winding-based definition of helicity, we compute helicity and winding in spherical coordinates for SHARP (Spaceweather HMI Active Region Patches) magnetograms. This is compared with results obtained in Cartesian coordinates to quantitatively investigate the effect of spherical geometry. We find that the Cartesian approximations remain mostly valid, but for active regions with large spatial extents or strong field strengths (usually leading to flares and coronal mass ejections) there are significant deviations due to surface curvature that must be accounted for.

For a given magnetic field B in a connected volume V , the usual definition (e.g.Moffatt and Dormy, 2019) of helicity is: (1) It involves the non-unique choice of vector potential A such that ∇ × A = B. Indeed, any gauge transformation A → A + ∇χ for a scalar function χ recovers the same field, while helicity is changed by a boundary integral if there are non-zero normal field components on the boundary of V (or "open domains").This applies to coronal magnetic fields that typically penetrate the photosphere, and Prior and Yeates (2014) showed that helicity can indeed take arbitrary values.For helicity to be compared for different coronal active regions (ARs), it is therefore crucial to have alternative definitions immune to such ambiguities.A popular choice is relative helicity (Berger and Field, 1984;Finn and Antonsen, 1985) converting vector potential choices to choices of reference magnetic fields (commonly chosen to be the potential field).More geometrical in nature is the winding-based definition proposed in Prior andYeates (2014, 2021), defining helicity as the flux-weighted winding of field lines in Cartesian tubular domains.This formalism has recently been generalised by Xiao, Prior, and Yeates (2023) to spherical domains in which ARs are best described.Over a full sphere, it is equivalent to the relative helicity.
Although ARs responsible for some of the most powerful solar activities span a large proportion of the solar disc, the intrinsic curvature of the photosphere has been only partially accounted for in most studies involving helicity and/or winding (e.g.Liu and Schuck, 2012;Vemareddy, 2019;MacTaggart and Prior, 2021).Magnetic-field components in spherical coordinates are used on Cartesian projections of photospheric patches, mostly in the cylindrical equal-area projection to match vector magnetogram data provided by Space-Weather Active Region Patches (SHARP) from the Helioseismic and Magnetic Imager (HMI) onboard Solar Dynamical Observatory (SDO) (Hoeksema et al., 2014).
Nevertheless, several studies have started including the full spherical geometry (see Moraitis et al., 2018 and references therein).Given the little consensus on which definitions, assumptions, and approximations should be adopted, the geometrical formalism proposed in Xiao, Prior, and Yeates (2023) seems a promising candidate -it provides closed-form expressions for helicity and winding directly in terms of the observed magnetic field in spherical coordinates.This facilitates a numerical investigation into the role of spherical geometry in helicity and winding computations compared to those obtained from Cartesian approximations.Our results will confirm quantitatively that curvature effects indeed become more significant as AR size increases, as qualitatively predicted in Gary and Hagyard (1990), further demonstrating the needs of spherical methods for future global modelling of solar magnetic fields.
The layout of this paper is as follows.In Section 2 we introduce the definitions of winding and winding-based helicity in both Cartesian and spherical domains.Section 3 reviews properties of the CEA projection used by SHARP magnetograms and by Cartesian approximations.Then, in Section 4, we compute winding-based helicity and winding in both geometries and analyse the absolute and relative errors that would have been incurred by not accounting for the full spherical geometry.We summarise our findings in Section 5.

Magnetic Winding and Winding Helicity Density
As aforementioned, helicity in open domains would be affected by the choice of vector potentials if it were defined by Equation (1).In this paper, we instead adopt the winding-based, geometrical definition of helicity that is independent of such choices.We first introduce the concept of intrinsic winding in Cartesian geometry (Prior and Yeates, 2014).On a certain z-level, the mutual entanglement of a pair of field lines through points x and x in the zdirection can be measured by the (pairwise) winding rate, defined by with components and similarly for B z (x ) and B χ (x ) with x ↔ x (same below).This is illustrated in Figure 1(a) and note that it is the B χ component that is responsible for the rotation of one field line against another (as also in the spherical case).
In the spherical case, Xiao, Prior, and Yeates (2023) constructed the analogous winding rate in the r-direction for field lines through x and x at the same r-level: Here, ξ(x, x ) = arccos(x • x /r 2 ) is the spherical distance between x and x , and relevant field components are given as where êr (x) = x/r and |x × x | = r 2 sin ξ .This is illustrated in Figure 1(b).
one recovers the Cartesian result (2) from the leading term by recognising rξ ≈ |x − x | for small ξ .Deviations are expected on a more global scale, especially for patches with large spatial extents.Also, the fact that spheres are closed surfaces leads to near-zero winding for points near opposing poles (ξ π ).
Note that the winding rates, ( 2) or ( 4), only depend on pointwise field information.By integrating them over all pairs of points on each ζ -level S ζ , where ζ is either z (Cartesian) or r (spherical), and then over all ζ , Prior andYeates (2014, 2021), Xiao, Prior, and Yeates (2023) defined (magnetic) winding as and (magnetic) winding helicity as When S ζ is either an infinite plane or a sphere, H W corresponds to the usual definition (1) with the winding gauge A W , which satisfies While the use of A W was first proposed in Cartesian geometry (Prior andYeates, 2014, 2021), it was later recognised as a special case from the poloidal -toroidal decomposition (Berger and Hornig, 2018;Yi and Choe, 2022).In this case, L W and H W are topological invariants based only on the magnetic field and the domain (Prior and Yeates, 2021).
In this study, we will instead consider finite S ζ patches corresponding to individual SHARPs, rather than full planes or spheres.Moreover, we will compute only the photospheric contributions from SHARP magnetograms to the integrals ( 7) and ( 8).Specifically, when we refer to winding or helicity, we mean their densities over finite patches S ζ 0 of the photosphere ζ = ζ 0 : and The inner integrals L W (x; ζ 0 ) and H W (x; ζ 0 ) are spatial distributions which serve as finergrained measures, later used in Section 4.1.Since our objective is to investigate the effect of curvature on helicity and winding, we outline two reasons for choosing finite surface densities instead of full volume integrals: i) Magnetograms are available only as finite patches on the photosphere ζ = ζ 0 , and it is standard to perform computations of helicity and winding on finite domains (e.g.Pariat et al., 2006;Liu and Schuck, 2012;MacTaggart et al., 2021).We did not want to prejudice the results by assuming particular boundary conditions or field extrapolations.
The winding-based definition of helicity allows meaningful and consistent comparisons between two geometries for finite domain and it leaves the curvature factor as the main difference, although it may not correspond exactly to the usual relative helicity.ii) Winding helicity (or winding) density has a very similar form as that for helicity (or winding) flux through the photosphere, except that the latter also involves plasma velocities (e.g.Pariat, Démoulin, and Berger, 2005;Liu and Schuck, 2013;MacTaggart and Prior, 2021).More uncertainties, however, would be introduced from computing the latter from velocity inversions (e.g.Schuck, 2008;Yang, Zhang, and Büchner, 2009), which we would like to avoid.We use the comparisons made here between the Cartesian and spherical helicity (or winding) calculations as an indicator of the effect of ignoring spherical geometry in helicity (or winding) flux calculations.

SHARP Magnetograms in Cylindrical Equal-Area (CEA) Projection
SHARP magnetograms for coronal magnetic fields are available in two projected coordinates: CCD image coordinates (hmi.sharp_720s) and recentered cylindrical equal-area (CEA) projection coordinates (hmi.sharp_cea_720s), as illustrated in Figure 2 for SHARP 4920.The commonly used standard CEA projection maps a point with spherical coordinates (λ, φ) to CEA coordinates (x * , y * ) as follows (Calabretta and Greisen, 2002): where λ = π/2 − θ is the latitude.The CEA projection allows magnetic flux to be computed conveniently from magnetograms, since areas are preserved in the projection, i.e. equalarea.It is, however, not angle-preserving, and that could lead to potentially significant errors in helicity and winding computations, which are based on angular measures.While distortions are inevitable due to the curvature, they can be largely reduced by choosing the projection centre appropriately at or close to the region of interest, as in CEA-projected SHARP magnetograms (hereafter "SHARP magnetograms").The recentered projection is given by ( 20) and ( 21) in the Appendix, with a self-contained derivation from the standard version ( 12) and ( 13) (Calabretta and Greisen, 2002;Sun, 2022).
From Bobra et al. (2014) and Hoeksema et al. (2014), magnetic-field components in SHARP magnetograms are provided in the local spherical basis (ê r , êθ , êφ ), whereas the numerical grid is CEA-projected, both converted from CCD coordinates.Here, êr is normal to the photosphere, êθ (or êφ ) points southward (or westward) in the direction of solar rotation.In most observational studies that we are aware of, helicity and winding for SHARP and ARs are computed using Cartesian Equations ( 2) and (3), approximating both (i) the CEA grid and (ii) the spherical field components as Cartesian.In particular, (ê θ , êφ ) is treated as (ê y * , −ê x * ), where the inherent CEA basis vectors êx * and êy * point along lines of constant  x * or y * .Take SHARP 4920 in Figure 2 as an example; we computed such misalignment between the two bases according to Equation (9) in Sun (2022), shown in Figure 3.One can see significant discrepancies that are greater than 10 • towards patch corners.It remains challenging to quantify the errors involved in this Cartesian approach, even if (ii) partially accounts for the surface curvature.After Xiao, Prior, and Yeates (2023) proposed the fully spherical expressions for helicity and winding reviewed in Section 2, it is thus natural to examine the extent to which Cartesian approximations fail to be accurate for SHARP magnetograms.

Results
In this section, we compute and compare densities of winding-based helicity H W (ζ 0 ) and winding L W (ζ 0 ) for a selection of SHARP magnetograms from Solar Cycle 24, in both Cartesian and spherical coordinates.Key information is summarised in Table 1.Note that, to implement the spherical approach, the numerical grid of a given SHARP magnetogram needs to first be converted to spherical coordinates using the relevant recentered CEA projection ( 20) and ( 21).
The YY.MM.DD format is used for dates and HH.MM for times.We adopt the CGS system of units, so magnetic field strengths are in units of Gauss (G), flux in maxwell (Mx), helicity density in G 2 • cm 3 = Mx 2 /cm from Equation (11), and winding density in cm 3 from Equation (10).SHARP sizes are measured in either CEA-projected degrees x * (longitudes) and y * (latitudes) or photospheric areas in units of millionths of a solar hemisphere (mH).
From Bobra et al. (2014), each CEA pixel has a constant x * -dimension of x * = 0.03 • in heliographic degrees, so the x * -coordinate of the nth pixel is given by x * n = n x * where n is an integer and n = 0 corresponds to the patch/projection centre.In contrast, y * are measured in constant steps of sines, which implies the nth pixel's y * -dimension, denoted by y * (y * n ), is a non-linear function of its y * -coordinate y * n : sin where y * (y * 0 ) = 0.03 • .This recursively gives y * n = y * n±1 + y * (y n±1 ) with + (or −) for n > 0 (or n < 0).Moreover, each CEA pixel has an area of 1.3 × 10 15 cm 2 , used in comparisons between Cartesian and spherical results.

Spatial Distributions of Errors
We first compute spatial distributions of local helicity H W (x; ζ 0 ) from Equation ( 11) and winding L W (x; ζ 0 ) from Equation (10) in both Cartesian and spherical coordinates.Note that the surface-integrated helicity and winding densities, H W (ζ 0 ) and L W (ζ 0 ), can be recovered from integrating the local quantities over the patch on ζ = ζ 0 .To compare the results, we use both the absolute errors P car − P sph (i.e. the difference between Cartesian approximation and spherical value) and relative errors (P car − P sph )/P sph , where P denotes (local) helicity or winding and subscript denotes the method used.As examples, we choose  4 and key observations are summarised as follows: i) Absolute errors are greatest near regions with large actual values that are typically associated with strong fields.In contrast, relative errors generally do not exhibit such behaviour -most large values are physically insignificant caused by near-zero denominators.ii) Errors in helicity are more localised, likely due to sharp drops in field strengths outside ARs, but errors in winding are more disperse, probably because winding is not fluxweighted.iii) Compared to the actual values, the smaller, quieter SHARP 3926 has maximum absolute errors an order of magnitude (OM) lower, whereas for the larger, more active SHARP 4920 they are of the same OM.This confirms that the patch size and/or total flux are indeed contributing factors to differences between the two methods, as expected from Section 2.

Time Series of Errors
Errors in the Cartesian approximation for one particular snapshot might be caused by observational noise, so it is important to test their robustness for certain periods.Here, we compute time series for both absolute and relative errors (defined in Section 4.1) of the surface-integrated helicity H W (ζ 0 ) from Equation ( 11) and winding densities L W (ζ 0 ) from Equation (10) in both spherical and Cartesian coordinates.For consistency, the same SHARP 3926 and 4920 are used with relevant temporal information in Table 3.
From results plotted in Figure 5, both series exhibit persistent errors of comparable OM to the actual values.Excluding non-physically large values, relative errors for 3926 are moderate -0 -5% for helicity and 0 -20% for winding.They are more significant for 4920around 15% for helicity and 25% for winding.Note that the time series for helicity show smoother variations than those for winding, partly because, unlike helicity, winding is not flux-weighted and tend to be dominated by the more varying field components near the polarity inversion line and on the edge of the large flux patches (Prior and MacTaggart, 2020).

Correlation Analysis Between Errors and Patch Indicators
The case studies in Sections 4.1 and 4.2 coincide with the theoretical prediction in Section 2 that errors arising from the Cartesian approximation of both helicity and winding are greater for larger patches or those with more net magnetic flux.In this subsection, we numerically test such correlations for a larger sample of SHARP from 2014 (solar maximum) and 2017 (towards solar minimum), listed in Table 4. Indicators related to patch sizes include deprojected patch area (keyword AREA) and number of CEA-projected pixels.The unsigned magnetic flux (keyword USFLUX) is used.
Results are shown in scatter plots in Figure 6.While there is an absence of a clear correlation for relative errors, absolute errors are strongly correlated with all these indicators.It demonstrates again the necessity to perform helicity and winding computations in the native spherical coordinates for large SHARP (often containing multiple ARs with localised strong magnetic fields).Moreover, we observe that the best-fits for the size dependence (first two columns) have gradients of approximately 2. This could partly be explained from integrating the second term in Equation ( 6) in Section 2 to obtain errors of leading order O(ξ 2 ) as the first term would be the Cartesian value.

Conclusion & Discussions
Magnetic helicity and winding are of increasing importance in modelling magnetic fields in ARs, and thus predicting extreme solar events such as flares and CMEs.It is necessary to have an unambiguous, accurate, and efficient method for computing both quantities in the native spherical coordinates.The geometrically motivated, winding-based definition of helicity proposed in Xiao, Prior, and Yeates ( 2023) is a promising candidate.It is independent of vector potentials with a simple and closed-form expression based only on the observed magnetic fields, allowing direct and meaningful comparisons for magnetic structures with different boundary conditions.In this work, by performing computations in both Cartesian and spherical coordinates using CEA-projected SHARP magnetograms, we quantitatively investigated the extent to which spherical curvature manifests in helicity and winding of SHARP.We found persistent and sometimes significant errors of both quantities if they were calculated in the approximated, Cartesian/CEA approach instead of the exact, spherical version.Also, we found that absolute errors of both quantities correlate strongly with patch sizes and total unsigned magnetic flux, which confirms the theoretical predictions numerically.Since the spherical approach is computationally as efficient as the Cartesian one, it is apparent that spherical expressions should be preferred in future uses.
As mentioned in Section 2, we expect errors of similar magnitudes in helicity and winding flux computations as they share almost identical forms as helicity and winding densities discussed in this work.Velocity inversions, however, are needed in fluxes, which would potentially involve more uncertainties, as they require more observational data such as Doppler spectrograms in addition to vector magnetograms.A fully spherical formalism for velocity inversions and the incorporation into flux computations are not yet available, which could be a future direction for generalisation.Additionally, since the photosphere is not perfectly spherical or not even clearly defined, modifications could be introduced to the definitions of spherical helicity and winding in Xiao, Prior, and Yeates (2023) for more accuracy.

Appendix: Re-Centred Cylindrical Equal-Area (CEA) Projection
Here, we provide a self-contained, first-principle derivation for the re-centred CEA projection, partly adapted from Calabretta and Greisen (2002) and Sun (2022).Recall that the standard version ( 12) and (13) maps P (λ, φ) on the sphere in polar coordinates to (x * , y * ) on the plane in CEA coordinates: Here, (0, 0) is the projection centre and λ = 0 is the reference circle (through and its antipodal point).
Local distortions are quantified by the Jacobian of ( 15) and ( 16), J = cos λ, so regions closer to the circle λ = 0 appear less distorted.Thus, by choosing a new projection centre C(λ C , φ C ) and thus a new reference circle, regions of interest can be mapped by the CEA projection more accurately.
Let R i (θ ) be an anticlockwise rotation of angle θ about the (current) Cartesian axis i ∈ {x, y, z}.

Figure 1
Figure 1 Pairwise winding rates defined on (a) Cartesian planes and (b) spheres.Relevant quantities are defined in Equations (2) -(5).Note that |x − x | and ξ(x, x ) are Cartesian and spherical distances between points x and x , respectively.

Figure 2
Figure 2 SHARP 4920 on 20 December 2014 at 00:24:00 is shown in CCD coordinates in the AIA 171Å EUV channel (upper left, white box) and in the full-disc radial magnetogram (upper right, white box), as well as in the recentered CEA magnetogram (bottom).

Figure 4
Figure 4 Spatial distributions of absolute and relative errors for local helicity H W (x; ζ 0 ) and winding L W (x; ζ 0 ) for (a) SHARP 3926 on 1 April 2014 at 00:00:00, and (b) SHARP 4920 on 20 December 2014 at 00:24:00.For reference, (radial) magnetograms are shown for both SHARP, top left for 3926 and top right for 4920.Contours of constant field strengths are superimposed on all plots, with thresholds ± 450G for 3926 and ± 550G for 4920.

Figure 5
Figure 5 Time series of spherical helicity H W (r 0 ) and winding L W (r 0 ) (both red curves), and corresponding absolute and relative errors (blue and black curves, respectively), for SHARP (a).3926 and (b).4920.Note that the absolute errors are suitably scaled both in (a) by a factor of 100 and in (b) by a factor of −1.

Figure 6
Figure 6 Log-log scatter plots of unsigned absolute and relative errors in helicity and winding against potential indicators for a selection of SHARP from 2014 and 2017 (including SHARP 3926 and 4920 used in Sections 4.1 and 4.2) listed in Table 4. Best-fit lines are shown with respective Pearson correlation coefficients or r-values.Colours are used to indicate the actual signs of errors, red for positive and black for negative.

Figure 7
Figure 7 Standard (left) and recentered (right) CEA maps with projection centres at (0, 0) and (λ C , φ C ), respectively.We use tildes for the rotated spherical coordinates under R.

Table 1
Summary of Cartesian/CEA and spherical approaches of helicity and winding densities computations.

Table 3
Temporal information of SHARP chosen for helicity and winding computations in Figure5.

Table 4
The list of SHARP for correlation analysis in Figure6.On each date at midnight, the SHARP with the smallest number and no blank pixels is chosen.