Reconstructing the Local Twist of Coronal Magnetic Fields and the ThreeDimensional Shape of the Field Lines from Coronal Loops in EUV and XRay Images
Abstract
Nonlinear forcefree fields are the most general case of forcefree fields, but the hardest to model as well. There are numerous methods of computing such fields by extrapolating vector magnetograms from the photosphere, but very few attempts have so far made quantitative use of coronal morphology. We present a method to make such quantitative use of XRay and EUV images of coronal loops. Each individual loop is fit to a field line of a linear forcefree field, allowing the estimation of the field line’s twist, threedimensional geometry and the field strength along it.
We assess the validity of such a reconstruction since the actual corona is probably not a linear forcefree field and that the superposition of linear forcefree fields is generally not itself a forcefree field. To do so, we perform a series of tests on nonlinear forcefree fields, described in Low & Lou (1990). For model loops we project field lines onto the photosphere. We compare several results of the method with the original field, in particular the threedimensional loop shapes, local twist (coronal ), distribution of twist in the model photosphere and strength of the magnetic field. We find that, (i) for these trial fields, the method reconstructs twist with mean absolute deviation of at most 15% of the range of photospheric twist, (ii) that heights of the loops are reconstructed with mean absolute deviation of at most 5% of the range of trial heights and (iii) that the magnitude of nonpotential contribution to photospheric field is reconstructed with mean absolute deviation of at most 10% of the maximal value.
1 Introduction
Most active region coronal magnetic fields are believed to be in a forcefree state,
(1) 
where is a scalar of proportionality (e.g., Nakagawa et al., 1971). It turns out that is closely related to the local twist of magnetic field lines. For example, in a cylindrical uniformlytwisted flux tube, field lines twist about the axis by an angle over axial distance (Aschwanden, 2006).
If varies in space, a solution of Eq. (1) is called a nonlinear forcefree field, as it solves a nonlinear system of equations for different components of and the scalar . Demoulin et al. (1997) described basic problems arising when trying to solve these equations. In particular, the existence and uniqueness of a solution is not entirely clear. Another difficulty is the fact that the only source of boundary conditions available at the moment are vector magnetograms measuring the field within the nonforcefree photospheric layer.
A particular case of a forcefree field, called a linear forcefree field, or a constantfield, occurs when . In this case, using , Eq. (1) is transformed to a Helmholtz equation for . This is much easier to solve and the conditions for existence and uniqueness of solution are known. Nor does the solution require vector magnetogram data, but only a lineofsight magnetogram and a value of the constant . This boundary condition is affected less by the fact that the photosphere is probably not forcefree. There are many methods of solving for linear forcefree fields (e.g., Nakagawa & Raadu, 1972; Chiu & Hilton, 1977; Altschuler & Newkirk, 1969; Lothian & Browning, 1995; Alissandrakis, 1981). In particular, in this paper we will use the Green’s function method, described in Chiu & Hilton (1977), as it does not place any restrictions on and it generates a field over an entire halfspace, without boundaries.
While they are simpler to generate, linear forcefree fields have proven insufficient to model complex geometries of the solar corona. Observations of curvature of Hstructures, visual studies of twist in coronal loops, and estimations of local twist at the photospheric level via vector magnetograms reveal active regions with spatially varying twist, and even varying sign of twist (for example, Burnette et al., 2004; Nakagawa & Raadu, 1972). In light of this any constantapproximation would appear to be, strictly speaking, incorrect. Over the past decade there have been many attempts to perform extrapolations of nonlinear forcefree magnetic field into the corona and to assess the quality of the extrapolation by comparing lines of the resulting field to coronal loops (e.g., Schrijver et al., 2008; DeRosa et al., 2009, and references therein).
In the current paper we apply a completely different approach. We use the visible shapes of coronal loops to infer the twist of the magnetic field. Instead of measuring twist in the photosphere, where Eq. (1) is not appropriate, we perform measurements in the region of interest, in the low forcefree solar corona. The method thus relies solely on EUV or XRay images of coronal loops and on lineofsight magnetograms.
The basic idea is to try to approximate every visible coronal loop with a field line from a linear forcefree field, and allow to be different for every loop. Even for nonlinear forcefree fields, must be constant along each field line
Our method is similar to the ones proposed by Green et al (2002) and Lim et al (2007), however, with several important advantages. First, it does not require the full length of a coronal loop to be visible for a successful reconstruction. Second, it does not require either of the footpoints to be visible. Third, it allows the user to draw a smooth curve (a Bézier spline) interactively on top of the loop, rather than selecting a few points along the loop. This maximizes the amount of information taken from the coronal image. The fit itself is similar to the one used by van Ballegooijen (2004); but while van Ballegooijen (2004) fits loops with lines of a particular nonlinear forcefree field model, we fit loops with lines of many different linear forcefree fields, choosing the best .
Consider an imaginary example of two dipoles far apart compared to their sizes. Suppose that they constitute a nonlinear equilibrium, having different twist, possibly of opposite signs. Suppose, however, that within each dipole the twist is more or less constant. In such a scenario there would probably be some transition region between the dipoles where changed significantly. Provided the dipoles are far apart we may claim that in the vicinity of the footpoints of one of them the current of the other would not significantly perturb the field, and in the close vicinity of each of them the field would be nearly a constant field.
To support this reasoning we note that the dipolar term of a magnetic field drops as and thus the effect of a distant dipole is in general not very large compared to the nearby dipole. Indeed, this is why studying a magnetic field of an isolated region of the corona is at all meaningful.
We therefore argue that a nonlinear forcefree field could be considered to be linear in the regions of slowly changing (in some sense of the term). Thus the geometry of a field in isolated regions of slowlychanging might be approximated by the geometry of a constantfield.
What is the limit of applicability of such an assumption? It is quite clear that it could work well for an isolated uniformlytwisted active region. Is it possible to pick a field line in an active region, and to suppose that the field’s geometry is not significantly different from that of a linear field in a close vicinity of this field line? We herein conduct several experiments on both synthetic and real data which provide evidence that at least in certain cases of interest such an assumption is reasonable.
The paper is organized in the following manner. In Section 2 we explicitly define the function to be minimized in order to obtain a best fit, a “distance” between two curves, . In Section 3 we describe the minimization process, varying and the lineofsight coordinate , and report that it indeed works in the obvious case, where the loop is a field line from an actual linear forcefree field. In Section 4 we describe the typical features of the function and attempt to explain their appearance. In Section 5 we present the results of applying this procedure to several analytic nonlinear forcefree fields, described by Low & Lou (1990). We also present an additional step proven necessary for the best fit procedure. This step amounts to minimizing in a very specific region of parameter space. We demonstrate that this step significantly improves the results for strongly twisted fields. In Section 6 we demonstrate the same method applied to real data: lineofsight magnetograms from SOHO/MDI and coronal images from Hinode/XRT. In Section 7 we discuss the results and their possible use in studying coronal magnetic fields.
2 The distance between two lines
In order to compare two curves, we seek a function quantifying the discrepancy between the curves. The ideal function would yield similar results to those obtained by visual comparison. It would be large when a human observer would consider the two lines to be far apart or unlike one another and small when a human observer would consider them to be similar and close to one another.
We use for this purpose a function first introduced by Green et al (2002) and later used by Lim et al (2007). We apply it, however, to a different set of objects. While Green et al (2002) and Lim et al (2007) compare a few points along the loop to a set of field lines traced from the photosphere, at the presumed location of the loop’s footpoints, we compare a smooth curve, chosen to visually match the loop, to a set of field lines traced from different locations along the lineofsight at some point along the curve. The same method was used by van Ballegooijen (2004). Therefore, unlike method of Lim et al (2007), our method does not require knowledge of the footpoints. In fact, it will work with even a small portion of a loop.
The discrepancy function is defined between two smooth curves in a plane, and . For every point on it is possible to define a minimal distance between that point and in the classical sense: the smallest of the distances between the point and every point along . It could also be defined as the length of the shortest perpendicular from the point to the curve , given sufficient smoothness. We will refer to this distance as . The discrepancy between the two curves is the average of over curve ,
(2) 
A numerical scheme to compute this integral is quite simple. Sample line into segments with equal lengths . Provided the segments are small compared to the local radius of curvature, for every point on ,
(3) 
The discrepancy integral can then be approximated by the sum
(4) 
representing the mean distance between points of one curve and the whole second curve; it has the units of length.
The trivial properties of the discrepancy function are, first, that it is nonnegative and second, it is noncommmutative, meaning is different in general from , as illustrated in Fig. 1.
3 hfit
For a visible coronal loop it is possible to construct a smooth twodimensional curve in the plane of the sky visually approximating the loop, or some portion of the loop. The loop is really a threedimensional structure and for every point on , the third coordinate, i.e. along the line of sight (LOS), is unknown. If the loop is at disk center, then the LOS coordinate is the height above the photosphere. For simplicity in notation, we will thereafter refer to this coordinate as “height”, denoted , even when it is not vertical.
The main idea of what we call an hfit is to choose a point on the loop and prescribe a certain height. Then, if the magnetic model is known, trace a field line from the threedimensional location and compare its plane of the sky projection to the original loop by calculating . Finally, we vary to find the minimum of .
To illustrate this method we construct a synthetic magnetogram and generate a magnetic field (the potential field of a magnetic quadrupole in halfspace ). As a model of the ‘loop’ we take an actual field line, projected onto the – plane. We then take the midpoint of the projected loop, , and trace field lines at different heights (see Fig. 2). Fig. 3 shows the function with one minimum at the actual height, to within one step of the search.
Suppose now that the coronal magnetic field is not known, but belongs to a known family of magnetic fields, described by certain parameters. It is then possible to do fitting not only in height, but also in the space of these magnetic field parameters. For example, if there is a reason to believe that the actual field is constant, but with unknown , then the discrepancy is a function of both and , and the minimization must be done over space.
To illustrate such a minimization we perform the following experiment. From the quadrupolar magnetogram of Fig. 2 we extrapolated a constantfield into the corona (). We produced several such fields with different values of . For each of these fields we selected several magnetic field lines at random, which we projected onto – plane. We then treated these projections as synthetic loops and performed an fit. Provided the method works, the bestmatch should have onetoone correspondence with the real for each field line.
The constantfields were generated using Green’s function (Chiu & Hilton, 1977) for a field in a halfspace. This has the advantage that it places no limitations on , whereas Fourier methods using periodic images separated by , require (Nakagawa et al., 1971). In Section 5 we demonstrate that our method can reconstruct values of up to , where the height of a point (not necessarily the highest one) along the loop could be much less than the linear size of the computational domain . For the method we propose, to perform fit within the full region of interest, including , values larger than the maximal allowed by the Fourier method are needed.
The results of the fit show that there is indeed a strong correlation between bestmatch and the real . However, in some cases (46 points out of 689, about of all field lines) the fit seems to be off by more than one step of . We attribute these errors of the fit to several factors. One factor is the gridded search algorithm whereby we calculate for each point on a grid with fixed steps in both and h (it is clear that a better algorithm could be implemented, however, in this paper we concentrate on the theoretical possibility of the method, rather than on programming tasks). A second is that the fit is poorly constrained when a field line’s shape is hidden by the projection. Finally, there are numerical errors associated with numerical integration of a field line from a field represented only on discrete grid points.
4 Shape of in the parameter space
Fig. 4 shows the function for one of the loops from the experiment described above. This function has valleys (dark) in the shapes of hyperbolae, located at or between the hyperbolae , After examining parameter spaces of many field lines we have concluded that there is one and only one “branch” of local minima in each , except for ; there are usually two or more “branches” in .
The foregoing behavior can be explained by the Green’s function in the far field. Far from the photospheric flux concentration at the field is dominated by the monopole moment, . For a field restricted to half space, Green’s function is given in Chiu & Hilton (1977) and later in Lothian & Browning (1995). It depends on and , where and . If one changes both and in such a manner that , that is, remaining on the same hyperbola in parameter space, the and terms remain constant.
This observation about the parameter space suggests a useful heuristic restriction to the search. Tracing field lines from for increasing values of (provided ) causes the angle between the field line and at to increase or decrease monotonically. The cosine of this angle,
will be a local maximum near the local minima of , but not exactly at the same place. Evaluating the magnetic field at one point is, of course, much faster, than tracing a whole field line. We found that without loss of any information about local minima of , we may restrict the search to only those , for which .
It is clear why the local minima of are coaligned with maxima in . Since is a smooth curve, there will be a vicinity of , where is, to first order, a straight line. The same is true for field lines of a forcefree field: the field lines are smooth curves, so the field line traced from in a close vicinity of this point is also to the first order a straight line. Suppose , i.e., is parallel to . Then in the neighborhood of the two curves would be exactly the same, and would be close to zero, if averaged only in that vicinity. Farther from the two may differ significantly resulting in nonzero over the whole length of the loop.
If the lineofsight angle is such that the loop’s projection is nearly a straight line, then there will be many field lines, with different , that are high enough and long enough to appear nearly straight along all the length of the projection. In this case the fit may give poor results. The upshot is that even though one does not need the whole loop to perform the h fit, the projection of the visible portion should not be “too straight”. We develop a more quantitative measure for this criterion below.
5 h fit: applied to Low & Lou field
We next test the h fit on a set of nonlinear forcefree fields from Low & Lou (1990). Each of these can be viewed as the field of a singular point source placed below the photosphere and inclined. The field is specified by parameters (related to characteristic range of field’s ), (depth of the source under the photosphere, we used for all fields), (orientation of the source, we used for all fields) and (for explicit derivation and definitions, see the Appendix).
The experiments were conducted as follows. We generated several Low & Lou fields with different parameters. For each field, we traced a few hundred field lines, projected them on the – plane and used them as synthetic loops. Then for each such loop we conducted an h fit (by gridded search), with values of being within the range of Low & Lou’s field photospheric .
We found that for a “dipolar” field (in the sense of it having two distinct polarities, see Fig. 5) with , , the values resulting from constant fits do indeed correlate with the real values of the field lines, as shown in Fig. 6 (left plot).
For this dipolar field the plots for most loops had one distinct valley of local minima (horizontal or nearly horizontal), and hints of other valleys at larger or . Another notable feature of the low valley is that it tends to cross the line rather than approach it asymptotically. The parameter space for one of these loops is shown in Fig. 7 (left plot). Notable in that plot is the global minimum was always in the lowest nearlyhorizontal valley. The “true location” (from the original Low & Lou field line) was also within that valley; however, it is sometimes offset with respect to the global minimum. In general, of the global minima are correlated with of the original Low & Lou field lines, as shown in Fig. 6 (left plot). Finally, Fig. 7 (right plot) shows that the constant field line of the global minimum seems to approximate the original Low & Lou field line quite well, although a tendency to underestimate is evident, and still clearer in the histogram of Fig. 6 (right plot).
For notational convenience, we hereafter refer to lines of Low & Lou fields as real field lines and to their bestfits of constant field as found field lines. We will also use to denote the parameters of the real field line (recall: is a height in the midpoint of the line’s projection into the photosphere). Similarly, we will use notation to refer to the parameters of the found field line.
Bestfits are potentially useful in reconstructing the photospheric distribution of . We constructed a photospheric map of by assigning the coronal value to the footpoints of the reconstructed field lines. A full map requires a smoothing, averaging or interpolation, to assign to photopsheric points around the footpoints of observed loops. To illustrate this possibility we did a robust reconstruction with bicubic spline interpolation (see, for example, Press et al., 1986), shown in Fig. 8. The fit that we did is simple and robust, nevertheless it is able to reconstruct the general shape of the actual distribution of in the Low and Lou field.
Another measure of the quality of the fit is its reconstruction of magnetic field , for example, at . We utilize the form , where is the full forcefree field, is the potential field with the same normal component at the boundary, and is a “current contribution” — a nonpotential forcefree field with . Note that is the same for and (reconstructed), since it is uniquely defined by the volume and by the Dirichlet boundary conditions. For “weakly nonpotential” field ; this is true of some of our cases. Rather than comparing to , we compare their “current contribution” terms, normalized by the potential field: to . The histogram for pix is shown in Fig. 9 (left). To make it, we evaluated , and along the found field lines. It seems that for most of points the two fields were nearly identical, suggesting the accuracy of the reconstruction.
From both Fig. 6 and Fig. 9 it seems that the reconstruction does a better job for smaller and for weaker , than for larger and for stronger . This and the reasoning from the previous section suggest that h fit might not work for strongly twisted, or maybe strongly nonlinear, fields. We tried to determine the range of for which the fit would yield reliable results. For that, we generated several more Low & Lou fields, this time quadrupolar (in the sense of it having three polarities, like the field of a point quadrupole): we kept and gradually increased over the following values: ; in addition we computed a field for , . We generated both signed and unsigned Low & Lou fields; both have identical photospheric , but the first one has and , while the second one has only (see Appendix). This was done in order to relate the errors of the fit with the “nonlinearity”, that is, with how much changes over a fixed length.
Typical parameter spaces for those fields are shown in Fig. 10 and Fig. 11. We found that for weakly twisted fields (that is, , and marginally , for which is at most , and respectively within the computational box close to the photosphere) a typical parameter space has one valley of local minima, with the same characteristics as the parameter space for , described earlier. It does not seem to approach or asymptotically like a hyperbola would, but rather it crosses axis. The global minimum always lies on this valley. The point also lies on this valley. It seems that the more horizontal this valley is, the more offset could be the “real” and “found” points along the valley, so the more different could be and ; and always appear to be very close.
For more strongly twisted fields () the parameter space within the range of and of the real field reveals more valleys, although the largerscale behaviour seems to follow the analytic Green’s function behavior shown in Fig. 4. That is, seems to have valleys of local minima that look like hyperbolae and are located at or in between the hyperbolae . Except for , there is one and only one valley in between every two hyperbolae , . Within there are usually two or more valleys, and one of them is usually “nonhyperbolic” in the sense described above. In these more strongly twisted cases we observed that the global minimum could be in one of the “higher” valleys. It seems that the field line corresponding to of the global minimum is much longer than the “loop” (line of Low & Lou field) and morphologically is quite different. Its smaller results from a small portion of the long line coinciding with the “loop”. This happens especially often for loops that are “too straight” in some sense. This is qualitatively described in Section 4 and quantitatively described further in the text.
After inspecting a great number of these parameter space plots we have noticed that still tends to correlate with the location of the “nonhyperbolic” valley. To prove this point, we conducted the following experiment. First we excluded loops that were “too straight”. Second, we chose as the best fit for each of the loops a local minimum on the nonhyperbolic valley, rather than the global miminum. The results of this twostep procedure are shown in Fig. 13. The explicit description of the procedure is below.
As a definition of “too straight” we adopted the ratio of sides of a box circumscribing the loop. The box is aligned with the leastsquare line fit to the loop, its length being the length of the loop along this line and its width being twice the maximal deviation. Based on visual examination we chose the minimum widthtolength ratio to be for the “loop” to be eligible for the analysis.
As for selection of the “nonhyperbolic” valley, we developed and followed an algorithm based on the shape of the parameter space. We have found that for Low & Lou fields this algorithm yields good results. First of all, for a given parameter space plot we identified several onedimensional local minima for each column . Then we manually select some of those local minima that belong to only one of the valleys and find a local minimum of within this valley.
For the selection of the valley, we followed these steps:

Consider only the valleys for which .

Is there one “nonhyperbolic” valley in this region? If yes, select the local minima within it. If definitely no, proceed to the next step. If not sure, discard this loop from consideration. If there are several local minima along this valley, select the one that has the lowest . Example in Fig. 12, top left.

If the “nonhyperbolic valley” merges with a “hyperboliclike” loop, select the local minima in the “nonhyperbolic” part. If unclear, discard this loop from the consideration. Example in Fig. 12, top right.

Does this “nonhyperbolic” valley seem to change directions, possibly crossing more than once? If yes, select local minima on the lowest (smallest ) section of it. If definitely no, proceed to the next step. If not sure, discard this loop from consideration. Example in Fig. 12, middle left.

Are there two “nonhyperbolic” valleys on either side of , and neither of them crosses line? If yes, select local minima on the one that extends to a bigger range of . If definitely no, proceed to the next step. If not sure, discard this loop from consideration. (We found that such parameter space plots often happens for a “too straight” loop, and threshold of seems to eliminate the majority of them. For the latter ones, seems to be on the higherextending valley.) Example in Fig. 12, middle right.

If there is no such special valley, among the “hyperbolic” valleys in there is a “lowestorder” one, that is, the one that has smallest for . Is there enough of this loop presented? (I.e., that did not fall below the threshold on , as described in Section 4, or that did not fall below any other threshold that was used, such as difference in length being too big, or the length of the field line being significantly smaller than the length of the loop, or the amount of selfcrossovers of a field line being two large – we use the second and third thresholds, but not the first one.) If yes, select the lowest in h local minima on this valley. If definitely no or not sure, discard this loop from consideration. Example in Fig. 12, bottom left.

Hard to classify cases: discard from consideration. Example in Fig. 12, bottom right.
As shown in Fig. 13, for signed field with , the global minima selection does not work very well. The abovementioned algorithm of selection of only “nonhyperbolic” minima works much better; it significantly improves the correlation of and for large (and big ranges of ). We also tested this algorithm for when the loops belong to linear forcefree fields and verified that it yields the correct results at least within the range , which is far beyond the range of all Low & Lou fields studied in this paper.
The results for all Low & Lou fields are summarized in Table 1. The individual results are shown in Figs. 14  17. This includes scatter plots of versus , versus , the comparison of and and photospheric distributions of and . The magnetic fields are compared in the same manner as described in Fig. 9: and are evaluated at the photospheric level for each of the reconstructed field lines, and a twodimensional histogram is computed. The photospheric distributions of are plotted in the same color table and with the same contours as and are obtained in the same manner as described in Fig. 8: is collected from all reconstructed field lines; the resulting set of points is used for twodimensional spline interpolation.
We draw several conclusions based on the results of this analysis, First, at least for some range of , field lines of Low & Lou fields could indeed be approximated with the field lines of constant fields of similar and . The reconstructed photospheric distribution of seems to recover the general shape of the original field. Amazingly, it is also able to recover the area of the strongest gradients of . Second, the height of the loops is reconstructed very well for the fields with a small range of and less well for the fields with a greater range of (see correlation coefficients and errors in Table 1; note that for unsigned fields the range of is about half the range in signed fields). Third, this method is also capable of reconstructing the magnetic field, at least near the photosphere.
We summarize all the results on two plots in Fig. 18. For each Low & Lou field, we looped through and measured the mean and standard deviation of , and plotted versus . We did the same for . It seems that the method systematically underestimates by a small amount and it sometimes overestimates by a small amount. The leastsquares line fit of the mean values, including standard deviation, gives an estimate and .
sign of  , pix  range,  fit results  fit results  fit results  
LAD slope  LAD mean abs. dev.  LAD slope  LAD mean abs. dev.  LAD slope  LAD mean abs. dev.  
1  0.02  6.0  0.196  1.63  6.65  0.805  0.99  0.55  0.967  1.03  3.21  0.934  
2  0.05  8.0  0.080  0.17  10.15  0.160  1.01  0.73  0.968  1.06  7.29  0.563  
2  0.1885  8.0  0.302  0.60  7.55  0.585  1.01  0.92  0.966  0.59  6.99  0.647  
2  0.3  8.0  0.484  0.86  6.49  0.743  0.99  1.13  0.954  0.64  5.79  0.812  
2  0.6  7.0  0.871  1.03  5.63  0.805  0.93  1.59  0.944  0.75  4.01  0.937  
2  1.0  7.0  1.486  1.19  5.22  0.799  0.87  1.86  0.926  0.82  3.21  0.943  
2  1.5  5.0  1.564  1.09  6.36  0.696  0.90  2.22  0.825  0.78  6.74  0.896  
2  2.0  5.0  1.985  1.19  5.45  0.789  0.87  2.11  0.870  0.79  9.02  0.809  
3  0.4  5.0  0.315  0.45  7.50  0.567  1.06  0.60  0.965  1.32  3.37  0.775  
2  0.05  8.0  0.159  0.72  15.00  0.601  1.00  0.85  0.964  0.94  6.60  0.593  
2  0.1885  8.0  0.598  1.36  9.14  0.879  0.96  1.80  0.921  0.67  6.84  0.708  
2  0.3  8.0  0.949  1.41  8.78  0.889  0.89  2.70  0.855  0.68  7.38  0.749  
2  0.6  7.0  1.642  1.40  10.02  0.875  0.53  4.83  0.715  0.73  6.58  0.885  
2  1.0  7.0  2.647  1.30  12.14  0.660  0.35  5.41  0.621  0.81  5.56  0.895  
2  1.5  5.0  2.647  1.42  10.16  0.770  0.47  3.48  0.756  0.88  6.49  0.818  
2  2.0  5.0  3.268  1.49  8.36  0.795  0.56  3.89  0.689  0.64  3.50  0.821  
3  0.4  5.0  0.529  0.95  11.38  0.704  0.98  1.25  0.889  0.22  6.23  0.386 
6 hFit Applied To Solar Data
As a further test of the applicability of the method, we applied the algorithm described above to real solar data. We chose the unnumbered active region close to disk center on 2007 February 10. This region, denoted SOL20070210T11:22:L290C101 according to the Solar Object Locator
To get the twodimensional shape from XRT image we manually drew smooth curves (3point cubic spline) over each of the loops. We then visually coaligned XRT and MDI images and obtained of the loops in MDI coordinates. No derotation was needed since MDI and XRT data were within one minute of each other. Since the region of interest was small enough, and close to disk center, we worked in a tangent plane approximation where the photospheric plane, , was taken to be the plane of the sky.
To perform the fitting we extracted a region measuring from the fulldisk MDI magnetogram ( pixels). In order to save computation time, we downsized the magnetogram by a factor of two in each dimension. Then we generated constant fields confined to half space (using Green’s function from Chiu & Hilton (1977)) in a computational box. We generated 41 different fields with .
The results are summarized in Table 2 and Fig. 19. Visually it seems that the fit did a good job for all but three loops. The parameter space plots, such as the one shown in Fig. 20, all looked like those for Low & Lou fields. For all of them we applied the proposed algorithm of selecting local minima on “nonhyperbolic” valley.
Disregarding the three “unsuccessful” fits, it seems that was of the order of in the outer region of the sigmoid, and higher in the middle, exceeding . Using the solar radius and recalling a typical bias of (see Fig. 18), we estimate to be in the outer regions and over in the core. These value fall in the range typical of active region fields, such as those reported in Burnette et al. (2004): . The magnetic field strength along all the nonpotential field lines was always within 50% of the strength of the potential field, evaluated along the same path; it was within 25% in at least half the cases.
Assuming a typical separation distance (see Fig. 19) the values of was of the order of outside of the sigmoid and exceeded inside of the sigmoid. This is within the range of reconstructed in the trial Low & Lou fields (see Fig. 18).
Loop #  ,  , arcsec 

0  0.012  12.9 
1  0.016  0.0 
2  0.014  23.8 
3  0.026  9.5 
4  0.008  35.4 
5  0.024  33.9 
6  0.020  14.3 
7  0.014  12.7 
8  0.010  31.5 
9  0.010  24.5 
10  0.012  27.4 
11  0.010  3.3 
7 Discussion
In this work we have proposed a semiautomated method that, from a given twodimensional EUV or XRay image of coronal loops and a lineofsight magnetogram, reconstructs local twist and a threedimensional shape of each loop. It tacitly assumes that coronal loops follow magnetic field lines. Our fitting matches the plane of sky projection of each loop to the projection of lines of linear forcefree fields, traced from different heights along the lineofsight and that have different twist in them. The method thus constructs a linear forcefree field and one field line in it, that is the best match of an individual loop. The method is similar to the ones proposed by Green et al (2002) and Lim et al (2007), however, it holds several important advantages. First, it does not require a full length of the loop to be visible for a successful reconstruction. Secondly, it does not require any of the footpoints to be visible. Thirdly, it allows the user to draw a smooth curve (e.g., a Bézier spline) interactively on top of the loop, rather than selecting a few points along the loop, thus maximizing the amount of information taken from the coronal image.
We address the question of validity of such a reconstruction, given the fact that the coronal field is probably nonlinear forcefree and that the superposition of linear forcefree fields obtained for each individual loop would not, in general, be a forcefree field. To do so, we perform a series of tests on nonlinear analytic forcefree fields, described in Low & Lou (1990), and as model loops we utilize projections of field lines on the photosphere. We compare several results of the method with the original field: 3D shapes of loops, local twist (coronal ), distribution of twist in the photosphere and the strength of magnetic field.
We also find that the bestfit line may not be a global minimum of , but one in a particular part of parameter space. We developed an algorithm that aids in locating the appropriate region of the parameter space. We followed it manually, but it could be automated. The algorithm seems to improve the results on Low & Lou fields, but it probably does not describe every possible feature of the parameter space resulting from every single arbitrary magnetic field. The algorithm could be improved and expanded, based on further research involving other nonlinear fields and real solar data.
Based on Table 1 we draw the conclusions (i) that on the trial fields the twist is reconstructed with mean absolute deviation of at most 15% of the range of photospheric twist, (ii) that heights of the loops are reconstructed with mean absolute deviation of at most 5% of the range of trial heights, and (iii) that the magnitude of nonpotential contribution to photospheric field is reconstructed with mean absolute deviation of at most 10% of the maximal value.
As shown in Fig. 18, there is a typical understimation of twist when performing this procedure. Based on the experiments with Low & Lou fields we conclude, that typically .
We also demonstrate how this method can be applied to real solar data, by doing the reconstruction based on the data from SOHO/MDI magnetograms and Hinode/XRT XRay images. The resulting field lines visually match the observed loops, have reasonable heights and selfconsistent amount of twist of the magnitude that agrees with existing measurements of twist in active regions (Burnette et al., 2004).
8 Acknowledgements
This work was supported by NASA grants NNX07AI01G and NNX06AB83G.
9 Appendix, on Low & Lou fields.
Low & Lou (1990) constructed a class of nonlinear forcefree magnetic fields beginning with an axisymmetric field. An axisymmetric, divergencefree magnetic field can be written, in all generality, as
(5) 
where is the flux function and the azimuthal component is . The poloidal components of the forcefree condition, , are satisfied only if and are each functions of the flux function alone
(6) 
The azimuthal component of the forcefree condition
(7) 
is known as the GradShafranov equation for flux function .
The GradShafranov equation contains one free function for which Low and Lou took a particular form. We generalize their choice to
(8) 
where and are free constants. The absolute value signs, absent from the original formulation, are introduced here so that is real, and nonnegative, even where the flux function is negative. Equation (7) can then be made homogeneous in by proposing a solution
(9) 
for a stillunknown function . Using this in the GradShafranov equation, and defining , leads to the nonlinear equation
(10) 
for the unknown function .
Eq. (10) has real solutions for any and any ; need not be an integer. Boundary conditions, similar to those of Low & Lou (1990), are and , so the solution is regular along the positive axis. The solution will be regular along the negative axis only when the solution satisfies the additional condition . For a given value of this condition will be satisfied only for certain choices of the eigenvalue . (Integer choices of always have one eigenvalue, , for which is times the Legendre polynomial of order .)
The final magnetic field, defined for , is constructed by rotating the axisymmetric field by angle about the axis and translating it downward a distance . For rotation angles and nonvanishing displacement, , the origin and what had been the negative axis lie in , outside our domain. This means the regularity condition, , is not needed to assure a regular magnetic field. We therefore make no restriction on and consider both and to be free parameters.
The function , required for the final field of eq. (5), is found from the square root of eq. (8). When the solution changes sign there can be
more than one choice of square root for which is a
continuous real function.
(11)  
(12) 
both of which satisfy eq. (8) when is real. Taking the derivative of these functions gives the twist parameters for the two cases
(13)  
(14) 
The unsigned case has a single sense of twist determined by the sign of the constant ; the signed case has both senses provided changes sign.
Footnotes
 This result is obtained by taking the divergence of both sides of Eq. (1) and using and the identity , so that .
 http://www.iac.es/proyecto/iau_divii/IAUDivII/documents/target_naming_convention.html
 There will be distinct choices when changes sign times over .
References
 Alissandrakis, C. E. 1981, A&A, 100, 197
 Altschuler, M. D., & Newkirk, G. 1969, Solar Phys., 9, 131
 Aschwanden, M. 2006, Physics of The Solar Corona, An Introduction with Problems and Solutions (Springer)
 Burnette, A. B., Canfield, R. C., & Pevtsov, A. A. 2004, ApJ, 606, 565
 Chiu, Y. T., & Hilton, H. H. 1977, ApJ, 212, 873
 Demoulin, P., Henoux, J. C., Mandrini, C. H., & Priest, E. R. 1997, Sol. Phys., 174, 73
 DeRosa, M. L., et al. 2009, ApJ, 696, 1780
 Golub, L., et al. 2007, Sol. Phys., 243, 63
 Green, L. M., López Fuentes, M. C., Mandrini, C. H., Démoulin, P., Van DrielGesztelyi, L., & Culhane, J. L. 2002, Solar Phys., 208, 43
 Kano, R., et al. 2008, Sol. Phys., 249, 263
 Kosugi, T., et al. 2007, Sol. Phys., 243, 3
 Lim, E.K., Hyewon, J., Chae, J., & Moon, Y.J. 2007, ApJ, 656, 1167
 Lothian, R. M., & Browning, P. K. 1995, Solar Phys., 161, 289
 Low, B., & Lou, Y. 1990, ApJ, 352, 343
 McKenzie, D. E., & Canfield, R. C. 2008, A&A, 481, L65
 Nakagawa, Y., & Raadu, M. A. 1972, Solar Phys., 25, 127
 Nakagawa, Y., Raadu, M. A., Billings, D. E., & McNamara, D. 1971, Solar Phys., 19, 72
 Press, W. H., Flannery, B. P., Teukolsky, S. A., & Vetterling, W. T. 1986, Numerical Recipes: The art of scientific computing (Cambridge: Cambridge University Press)
 Scherrer, P. H., et al. 1995, Sol. Phys., 162, 129
 Schrijver, C. J., et al. 2008, ApJ, 675, 1637
 van Ballegooijen, A. A. 2004, ApJ, 612, 519