# Preprocess the Photospheric Vector Magnetograms for NLFFF Extrapolation using a Potential Field Model and an Optimization Method

## Abstract

Numerical reconstruction/extrapolation of coronal nonlinear force-free magnetic field (NLFFF) usually takes the photospheric vector magnetogram as input at the bottom boundary. Magnetic field observed at the photosphere, however, contains force which is in conflict with the fundamental assumption of the force-free model and measurement noise which is unfavorable for practical computation. Preprocessing of the raw magnetogram has been proposed by \citeauthoryearWiegelmann, Inhester, and Sakurai2006 to remove the force and noise for providing better input for NLFFF modeling. In this paper we develop a new code of magnetogram preprocessing which is consistent with our extrapolation method CESE–MHD–NLFFF (\citeauthoryearJiang, Feng, and Xiang2012; \citeauthoryearJiang and Feng2012\natexlaba). Basing on a magnetic-splitting rule that a magnetic field can be split into a potential field part and a non-potential part, we split the magnetogram and deal with the two parts separately. Preprocessing of the magnetogram’s potential part is based on a numerical potential field model, and the non-potential part is preprocessed using the similar optimization method of \citeauthoryearWiegelmann, Inhester, and Sakurai2006. The code is applied to the SDO/HMI data and results show that the method can remove efficiently the force and noise and improve the quality of extrapolation.

## 1 Introduction

Magnetic field extrapolation is an important tool to study the three-dimensional (3D) solar coronal magnetic field, which is difficult to measure directly \citepSakurai1989, Aly1989, Amari1997, McClymont1997, Wiegelmann2008, DeRosa2009. The models being used most popularly for field extrapolation are the potential field model, the linear force-free field model, and the nonlinear force-free field (NLFFF) model. These models are all based on the same assumption that the Lorentz force is self-balancing in the corona, but adopt different simplifications of the current distribution. Among these models, the NLFFF model is the most precise one for characterizing magnetic field in the low corona, where there is significant and localized electric current, especially in active regions.

Regarding the NLFFF extrapolation, it is routine to use the vector
magnetograms observed on the photosphere as input, at least in most of
the available extrapolation codes \citep[e.g.,][]Wheatland2000,
Wiegelmann2004, Amari2006, Valori2007, Jiang2012apj,
Jiang2012apj1,Inoue2011^{1}

This complication leads to the desire to use measurements of the vector field in the force-free upper chromosphere instead. However, the vector field is not as easily measured in the chromosphere as in the photosphere. Even the chromospheric field is measured, it is still problematic for extrapolation since the surface in which any particular magnetically-sensitive line will form varies in time and space, and in particular the height will be different along different lines of sight. So one cannot assume that the vector field is given on a plane or sphere at the bottom of the extrapolation volume as in the case of the photospheric magnetograms. The practical use of the chromospheric magnetograms as boundary conditions for extrapolations is still to be explored.

As an alternative way to alleviate the problem, one can consider to modify the photospheric magnetograms to simulate the force-free chromospheric magnetograms, which is first suggested by \citetWiegelmann2006b. Since the interface between the photosphere and the bottom of the force-free domain is rather thin (say, about 400 km), especially if compared with the spatial scale of the coronal field (about tens of megameters), the basic field structures of the chromosphere should be very similar to those of the photosphere, except that (i) there must be some smoothness of the structures due to the fast expansion of field from the high- to low- regions and (ii) the very fine magnetic elements are just closed within this interface and thus show no signal in the force-free domain. Thanks to these reasons, modifications that need to be made on the photospheric field to mimic the force-free chromospheric field ought to be not significant and can hopefully be made within/around the error margins of the measurement.

The procedure of modifying a raw photospheric magnetogram to a
force-free chromospheric one is usually called ‘preprocessing’
\citepWiegelmann2006,Fuhrmann2007,Metcalf2008,Fuhrmann2011,Yamamoto2012. To
guide the preprocessing, there are constraints that must be fulfilled
by the target magnetogram. On the boundary surface of an ideally
force-free field in a volume , the field satisfies the
following necessary conditions^{2}

(1) |

where . These expressions are derived from the volume integrals of the total magnetic force and torque \citepAly1989, Sakurai1989, Tadesse2011PhD

(2) |

where is magnetic stress tensor,

(3) |

and . Generally the surface integration has to be carried out over a closed volume, but in preprocessing magnetograms for extrapolation of a computational cube, the surface integrals of Equation (1) is usually restricted within the bottom magnetogram since the contribution from other (side and top) boundaries is small and negligible, and in the following will represent only the area of magnetograms. With this assumption, Equation (1) is the component form of the surface integrals in Equation (1). So the first task of preprocessing is to drive the raw magnetogram to fulfill the constraints of Equation (1) and thus to be closer to an ideally force-free magnetogram. This task is also dubbed as ‘removing force’ in the forced magnetogram. The second task of preprocessing is to smooth the raw data to mimic the field expansion. Smoothing is also very necessary for the practical computation based on numerical difference with limited resolution, which cannot resolve sufficiently small structures in the raw data. Besides, smoothing can remove measurement noise and increase signal-to-noise ratio.

Several preprocessing codes \citepWiegelmann2006b, Fuhrmann2007, Metcalf2008 have been developed and they share the basic approach proposed by \citetWiegelmann2006b. A functional is designed by adding up the deviations from the constraints of Equation (1), the terms that control deviation from the raw data and the smoothness with different weights, e.g.,

(4) |

where is the weighting factor, , , , and measures the roughness of the data. Then the target magnetogram is searched by minimizing the functional using an optimization method. Different algorithms of smoothing and optimization have been utilized and the results are more or less different, as shown in a comparison study by \citetFuhrmann2011. Also the differences can result from different choices of the weighting factors.

Under this framework of preprocessing, there are two problems not well addressed, namely, to what extent the force is needed to be removed and to what extent the smoothing can be performed? We care about these problems from both numerical and physical considerations. Ideally we prefer the map to satisfy the force-free constraints precisely, but this condition need not be satisfied strictly considering that numerical discretization error is unavoidable in the extrapolation with finite resolution. The smoothing also ought not to be done arbitrarily if we want to mimic the expansion of the field from the photosphere to some specific height above. Over-smoothing of the data may smear the basic structures while a too-limited smoothing cannot filter the small-scale noise sufficiently. A careful choice of the weighting factors is required to deal with these problems.

This paper is devoted to handling these problems in the preprocessing. We use the values of force-freeness and smoothness calculated from numerical potential-field solution at some height above the photosphere as a reference to guide the preprocessing. Based on a simple rule that any magnetic field can be split into two parts: a potential field and a non-potential field, we develop a new preprocessing code using this splitting of the magnetic field, which is consistent with our extrapolation code CESE–MHD–NLFFF \citepJiang2012apj,Jiang2012apj1. We show below how the raw magnetogram can be driven to force-free and smooth with the same level as that of the numerical potential field at a height of roughly 400 km above the photosphere, i.e., the bottom of the force-free domain. The remainder of the paper is organized as follows. In Section 2 we give the basic method and formulas, and we show how to choose the weighting factors in Section 3. We then apply the method to preprocess two sampled magnetograms taken by SDO/HMI and analyze the results in Section 4. Finally discussion and conclusions are given in Section 5.

## 2 Method

Generally the coronal magnetic field can be split into two parts: a potential field matching the normal component of the bottom magnetogram, and a non-potential part with the normal field vanishing at the bottom. Particularly, of the vector magnetogram, the magnetic field can be written as

(5) |

where are the components of the potential part and the components of the non-potential part . Note that and .

Supposing is a force-free magnetogram and since its potential part already fulfills the force-free conditions of Equation (1), we can derive special force-free conditions for its non-potential part , which are expressed as

(6) |

where we denote . The derivation is straightforward, for example

(7) |

and we have

(8) |

All other expressions in Equation (2) can be derived easily in the similar way.

Let denote the observed photospheric field, i.e., the raw magnetogram, and its splitting form is

(9) |

with and denoting the potential and non-potential parts, respectively. Here is computed based on using the potential field model and then is also obtained. The computation of a potential field needs only the normal component of the field on the bottom and is now a trivial task, which can be carried out conveniently by using the Green’s function method \citepMetcalf2008 or other much faster scheme \citepJiang2012SoPh.

Generally, does not fulfill the force-free conditions of Equation (2). If without smoothing, we only need to let and reduce the non-potential part to satisfying Equation (2). For the purpose of smoothing, is obtained by taking the data at a plane just one pixel above the photosphere from the 3D potential field extrapolated from the observed . This is suitable for the SDO/HMI data which has a pixel size of about 360 km (i.e., 0.5 arcsec), an approximate height above which the coronal field becomes force-free according to \citetMetcalf1995. For magnetograms with other sizes of pixel, we need to take the potential field data at a given physical height (where the force-free assumption becomes valid, e.g., 400 km) and not necessarily one pixel above the photosphere. obtained in this way can be regarded as the potential part of the chromospheric field, also a preprocessed counterpart of . Of course, if the measurements of chromospheric longitudinal fields are available \citep[e.g.,][]Yamamoto2012, we recommend using those data directly to construct the potential part , which is certainly preferred over that based on the photospheric .

The second task, to reduce to , is carried out using an optimization method similarly to \citetWiegelmann2006b. We intend to minimize the total magnetic force and torque which are quantified by

(10) |

where for convenience of presentation we denote

(11) | |||||

(12) |

Here the summation is over all the pixels of the magnetogram, and these summations are the numerical counterparts of the integrals in Equation (2).

The observation term (to restrict the deviation from the observed data) and smoothing functional (to control the smoothness) are also considered by \citetWiegelmann2006b

(13) |

where is a usual five-point 2D-Laplace operator, i.e., for the pixel

(14) |

This simply states that the smaller gives the smoother data.

Additionally, the above functionals (where ) are normalized by which are given by

(15) |

where

(16) |

We use a steepest descent method \citepPress1992 to minimize a weighted average of the above functionals

(17) |

where is the weighting factor. Generally, the weighting factors for the magnetic force and torque are simply given by since there is no obvious reason to give bias on any of these two quantities. The determination of and will be described in the next section, and different combinations of them are tested for two HMI magnetograms to search the optimal choice in Section 4.

Since is an explicit functional of the arguments , its gradient can be expressed at each pixel as

(18) | |||

(19) |

The procedure of the steepest descent is performed as follows. We start from an initial guess , e.g., the observed data , and march the solution in each iteration along the steepest descent direction (i.e., opposite to the gradient direction) by

(20) |

It is important to choose a proper step size at each step to maximize the local descent. This can be determined by a bisection line-search algorithm to solve the one-dimensional optimization problem at every iteration

(21) |

The iteration is terminated if the maximum residual of the field , defined by

(22) |

is smaller than gauss (G) for 10 successive steps.

## 3 Choice of the Weighting Factor

A careful choice of optimal weighting factors is critical for a good performance of preprocessing. Using the qualities of force-freeness and smoothness of the numerical potential part as a reference, we guide the optimization of according to the follow constraints:

i) The residual force and torque in the target magnetogram should be reduced to the same order of those in ;

ii) The smoothness of the target magnetogram should reach the same level as that of (Since , it means that the smoothness of and should match that of . This is reasonable since there is no preference for any component of the vector);

iii) With the constraints i) and ii) fulfilled, the deviation between the target magnetogram and the observed data should be minimized.

In the constraints the residual magnetic force and torque of the data are quantified by two parameters, and , defined as usual

(23) | |||||

(24) |

and the smoothness of component () is measured by

(25) |

Beside the above constraints the total iteration steps needed by computation is also considered if the magnetogram’s resolution is very high, since the computing time of the preprocessing may be rather long.

Data | ||||||
---|---|---|---|---|---|---|

AR 11283 | ||||||

Raw | -7.88E-02 | 2.84E-01 | 2.38E-01 | 8.38E-03 | 1.28E-02 | 2.49E-03 |

Preprocessed | -8.98E-02 | 1.02E-02 | 1.50E-02 | 1.55E-04 | 2.25E-04 | 1.92E-04 |

Numerical potential | -8.98E-02 | 9.14E-03 | 1.40E-02 | 2.10E-04 | 1.78E-04 | 1.92E-04 |

AR 11429 | ||||||

Raw map | -1.36E-02 | 1.82E-01 | 1.55E-01 | 3.76E-03 | 3.43E-03 | 1.21E-03 |

Preprocessed map | -1.46E-02 | 3.98E-03 | 2.81E-03 | 7.52E-05 | 7.82E-05 | 8.61E-05 |

Numerical potential | -1.46E-02 | 3.19E-03 | 2.96E-03 | 8.38E-05 | 8.53E-05 | 8.61E-05 |

## 4 Preprocessing the SDO/HMI Magnetograms

In this section we apply the preprocessing code to several magnetograms taken by SDO/HMI, and search the optimal values for the weighting factors. The Helioseismic and Magnetic Imager (HMI) on board the Solar Dynamics Observatory (SDO) provides photospheric vector magnetograms with a high resolution both in space and time. It observes the full Sun with a 4k4k CCD whose spatial sampling is 0.5 arcsec per pixel. Raw filtergrams are obtained at six different wavelengths and six polarization states in the Fe i 6173 Å absorption line, and are collected and converted to observable quantities (like Dopplergrams, continuum filtergrams, and line-of-sight and vector magnetograms) on a rapid time cadence. For the vector magnetic data, each set of filtergrams takes 135 s to be completed. To obtain vector magnetograms, Stokes parameters are first derived from filtergrams observed over a 12-min interval and then inverted through the Very Fast Inversion of the Stokes Vector \citepBorrero2011. The 180 azimuthal ambiguity in the transverse field is resolved by an improved version of the “minimum energy” algorithm \citepLeka2009. Regions of interest with strong magnetic field are automatically identified near real time \citepTurmon2010. A detailed description on how the vector magnetograms are produced can be found on the website //http://jsoc.stanford.edu/jsocwiki/VectorPaper.

The raw magnetograms we use here were downloaded from http://jsoc.stanford.edu/jsocwiki/ReleaseNotes2, where the HMI vector magnetic field data series hmi.B_720s_e15w1332 are released for several active regions. There are two special formats, i.e., direct cutouts and remapped images. We use the remapped format which is more suitable for modeling in local Cartesian coordinates, since the images are computed with a Lambert cylindrical equal area projection centered on the tracked region. For our test, we select two active regions, AR 11283 and AR 11429, both of which produced X-class flares and thus were very non-potential. Figure 1 shows the magnetograms for AR 11283 at 05:36 UT on 8 September 2011 and AR 11429 at 00:00 UT on 7 March 2012. The size of the magnetograms are respectively and pixels.

In Figures 2 and 3 we show the preprocessing results with different sets of and . Since for such large magnetograms it is nontrivial to perform plenty of tests with continuous sets of weighting factors to pick the optimal one, we only compute the results for several groups of and as shown in the figures, i.e., and . For each set of weighting factors, the normalized terms and the smoothness and the force-free quality and are plotted. By comparing the results with fixed but different , we can see that the force-free parameters , and are almost entirely determined by . When decreasing , i.e., allowing more freedom of modifying the raw data, and decrease very quickly (their magnitude decreases quicker than that of ), but the residual force parameters and reach a minimum and cannot be reduced any further. This is because the potential part has a non-zero value of and (due to numerical error of finite resolution), which is the minimum of that can be reached for the target magnetograms. The results for both tests show that is small enough which gives and nearly the same as those of , meaning that the force in the non-potential part is decreased near or under the level of numerical error. Even smaller cannot improve the quality of force-freeness, but deviates the target magnetograms farther away from the original data. Thus we set the optimal value of . With a given value of , the values of smoothness are controlled by . Obviously is a good choice which gives the values of and very similar to , meaning that the smoothness of the target magnetograms is consistent with their potential part . We believe the choice of weight for smoothness here is more physics-based than in other methods in which it is given more or less arbitrarily.

The results of preprocessing the two magnetograms with the optimal weighting factors and are summarized in Table 1. Figures 4 and 5 show a comparison of the original and preprocessed magnetograms. Here the color-map is designed to manifest both strong and weak fields. As shown, the map after preprocessing resamples the feature of the original data while small structures tend to be smoothed out. In the bottom of the figures we plot the results for the vertical current which is calculated by taking finite differences of the transverse field

(26) |

Since the numerical differences are very sensitive to noise, random noise in the data exhibits more clearly in the map, particularly in weak field regions, and they are suppressed effectively by the smoothing. Histograms are plotted in Figure 6 to show the distributions of the absolute differences between the raw and preprocessed magnetograms over all the pixels. Apparently different approaches of modifying the data give different distributions, i.e., the distribution for the -component is distinct from those for the and -components. This is because the modification for is determined solely by the potential model, while modifications for are additionally made by the optimization process. The change in the vertical field is less than those for the transverse field. This is consistent with the observation which measures the line-of-sight component much more precisely than the transverse field, and thus we have more freedom to modify the transverse field. Still it should be noted that here the potential-field modeled may not approximate well the real chromospheric , which is preferred to be taken by direct measurements if available.

We finally show in Figure 7 the process of iteration in the optimization method. Only the result for AR 11283 is plotted as an example. As shown, the functional decreased very quickly. By only 200 iteration steps, it almost reaches its minimum, reduced by about two orders of magnitude from its initial value. The sub-functionals and have similar evolution, although with small oscillations, and the sub-functional keeps decreasing but very slowly after 200 steps.

## 5 Conclusions

In this paper we have developed a new code of preprocessing the photospheric vector magnetograms for NLFFF extrapolation. The method is based on a simple rule that any vector magnetograms can be split into a potential field part and a non-potential part and we deal with two parts separately. Preprocessing of the potential part is simply performed by taking the data sliced at a plane about km above the photosphere from the 3D potential-field numerical solution, which is extrapolated from the observed vertical field. Then the non-potential part is modified by an optimization method to fulfill the constraints of total magnetic force-freeness and torque-freeness. As for practical computation based on numerical discretization, a strict satisfaction of force-free constraints is apparently not necessary. Also the extent of the smoothing to be applied to the data need to be carefully determined, if we want to mimic the field expansion from the photosphere to some specific height above. We use the values of force-freeness and smoothness calculated from the preprocessed potential-field part as a reference to guide the preprocessing of the non-potential field part, i.e., we require that the target magnetograms have the same level of force-freeness and smoothness as the reference data. These requirements can restrict well the values of the free parameters, i.e., the weighting factors in the optimization functional. The code is applied to the SDO/HMI data. Preprocessed results show that the method can remove efficiently the force and noise, if we properly choose the weighting factors. For two sampled HMI magnetograms, we find that the optimal weights are and , with which the target magnetgrams can be driven to force-free and smooth with the same level as that of the numerical potential field at the bottom of the force-free domain.

The preprocessing code here is developed as a sub-program for a project of applying our extrapolation code CESE–MHD–NLFFF \citepJiang2012apj1,Jiang2012apj to observed data. We have applied CESE–MHD–NLFFF to SDO/HMI data with both raw and preprocessed magnetograms \citepJiang2013NLFFF. By a careful comparison of the results, we find that the quality of extrapolation is indeed improved using the preprocessed magnetograms, including the force-freeness of the results (e.g., measured by a current-weighted mean angle between the magnetic field and electric current ) and the free energy contents. For example in the extrapolation of AR 11283, the mean angle between and for the entire extrapolation box of pixels is reduced from to and the free energy is increased from erg to erg.

This work is jointly supported by the 973 program under grant 2012CB825601, the Chinese Academy of Sciences (KZZD-EW-01-4), the National Natural Science Foundation of China (41204126, 41274192, 41031066, and 41074122), and the Specialized Research Fund for State Key Laboratories. Data are courtesy of NASA/SDO and the HMI science teams. The authors thank the anonymous referee for invaluable comments.

### Footnotes

- There are also some NLFFF models which use only the line-of-sight component of the photosphere field, along with constraints from other observed information like the EUV loops, filament channel, and X-ray sigmoid structure \citep[e.g.,][]Bobra2008,Su2009,Aschwanden2012ApJ.
- The necessary conditions mean that even fulfilling these conditions, the magnetogram may still contain force; but magnetograms with these conditions fulfilled are certainly better input for NLFFF model than those not.

### References

- Aly, J.J.: 1989, Solar Phys. 120, 19.
- Amari, T., Boulmezaoud, T.Z., Aly, J.J.: 2006, Astron. Astrophys. 446, 691.
- Amari, T., Aly, J.J., Luciani, J.F., Boulmezaoud, T.Z., Mikic, Z.: 1997, Solar Phys. 174, 129.
- Aschwanden, M.J., Wuelser, J.P., Nitta, N.V., Lemen, J.R., DeRosa, M.L., Malanushenko, A.: 2012, Astrophys. J. 756, 124.
- Bobra, M.G., van Ballegooijen, A.A., DeLuca, E.E.: 2008, Astrophys. J. 672, 1209.
- Borrero, J., Tomczyk, S., Kubo, M., Socas-Navarro, H., Schou, J., Couvidat, S., Bogart, R.: 2011, Solar Phys. 273, 267.
- DeRosa, M.L., Schrijver, C.J., Barnes, G., Leka, K.D., Lites, B.W., Aschwanden, M.J. et al.: 2009, Astrophys. J. 696, 1780.
- Fuhrmann, M., Seehafer, N., Valori, G.: 2007, Astron. Astrophys. 476, 349.
- Fuhrmann, M., Seehafer, N., Valori, G., Wiegelmann, T.: 2011, Astron. Astrophys. 526, A70.
- Gary, G.A.: 2001, Solar Phys. 203, 71.
- Inoue, S., Kusano, K., Magara, T., Shiota, D., Yamamoto, T.T.: 2011, Astrophys. J. 738, 161.
- Jiang, C., Feng, X., Xiang, C.: 2012, Astrophys. J. 755, 62.
- Jiang, C.W., Feng, X.S.: 2012, Astrophys. J. 749, 135.
- Jiang, C.W., Feng, X.S.: 2012, Solar Phys. 281, 621.
- Jiang, C.W., Feng, X.S.: 2013, Astrophys. J. 769, 144.
- Leka, K., Barnes, G., Crouch, A., Metcalf, T., Gary, G., Jing, J., Liu, Y.: 2009, Solar Phys. 260, 83.
- Liu, S., Su, J.T., Zhang, H.Q., Deng, Y.Y., Gao, Y., Yang, X., Mao, X.J.: 2012, ArXiv e-prints.
- McClymont, A.N., Jiao, L., Mikic, Z.: 1997, Solar Phys. 174, 191.
- Metcalf, T.R., Jiao, L., McClymont, A.N., Canfield, R.C., Uitenbroek, H.: 1995, Astrophys. J. 439, 474.
- Metcalf, T.R., DeRosa, M.L., Schrijver, C.J., Barnes, G., van Ballegooijen, A.A., Wiegelmann, T., Wheatland, M.S., Valori, G., McTtiernan, J.M.: 2008, Solar Phys. 247, 269.
- Press, W.H., Teukolsky, S.A., Vetterling, W.T., Flannery, B.P.: 1992, Numerical recipes in FORTRAN. The Art of Scientific Computing, Cambridge University Press, Cambridge, 414.
- Sakurai, T.: 1989, Space Sci. Rev. 51, 11.
- Su, Y., van Ballegooijen, A., Lites, B.W., Deluca, E.E., Golub, L., Grigis, P.C., Huang, G., Ji, H.: 2009, Astrophys. J. 691, 105.
- Tadesse, T.: 2011, Nonlinear force-free reconstruction of the coronal magnetic field with advanced numerical methods. Ph.D. thesis, Max Planck Institute for Solar System Research.
- Turmon, M., Jones, H.P., Malanushenko, O.V., Pap, J.M.: 2010, Solar Phys. 262, 277.
- Valori, G., Kliem, B., Fuhrmann, M.: 2007, Solar Phys. 245, 263.
- Wheatland, M.S., Sturrock, P.A., Roumeliotis, G.: 2000, Astrophys. J. 540, 1150.
- Wiegelmann, T.: 2004, Solar Phys. 219, 87.
- Wiegelmann, T.: 2008, J. Geophys. Res. 113, 3.
- Wiegelmann, T., Neukirch, T.: 2006, Astron. Astrophys. 457, 1053.
- Wiegelmann, T., Inhester, B., Sakurai, T.: 2006, Solar Phys. 233, 215.
- Yamamoto, T.T., Kusano, K.: 2012, Astrophys. J. 752, 126.