### 4.3 Ambiguity removal algorithm

#### 4.3.1 Acute angle method

The magnetic field in the photosphere is usually not force-free and even not current-free, but an often made assumption is that from two possible directions (180° apart) of the observed field , the solution with the smaller angle to the potential field (or another suitable reference field) is the more likely candidate for the true field. Consequently, we get for the horizontal/transverse field components the condition

This condition is easy to implement and fast in application. In Metcalf et al. (2006) several different implementations of the acute angle method are described, which mainly differ by the algorithms used to compute the reference field. The different implementations of the acute angle methods got a fraction of 0.64 – 0.75 pixels correct (see Figure 7, panels marked with NJP, YLP, KLP, BBP, JLP, and LSPM).

#### 4.3.2 Improved acute angle methods

A sophistication of the acute angle method uses linear force-free fields (Wang, 1997; Wang et al., 2001), where the optimal force-free parameter is chosen to maximize the integral

where is the linear force-free reference field. A fraction of 0.87 pixels has been identified correctly (see Figure 7 second row, right panel marked with HSO).

Another approach, dubbed uniform shear method by Moon et al. (2003) uses the acute angle method (with a potential field as reference) only as a first approximation and subsequently uses this result to estimate a uniform shear angle between the observed field and the potential field. Then the acute angle method is applied again to resolve the ambiguity, taking into account the average shear angle between the observed field and the calculated potential field. A fraction of 0.83 pixels has been identified correctly. Consequently both methods significantly improve the potential-field acute angle method (see Figure 7 third row, center panel marked with USM).

The magnetic pressure gradient method (Cuperman et al., 1993) assumes a force-free field and that the magnetic pressure decreases with height. Using the solenoidal and force-free conditions, we can compute the vertical magnetic pressure gradient as:

with any initial choice for the ambiguity of the horizontal magnetic field components . Different solutions of the ambiguity removal method give the same amplitude, but opposite sign for the vertical pressure gradient. If the vertical gradient becomes positive, then the transverse field vector is reversed. For the test this method got a fraction of 0.74 pixels correct, which is comparable with the potential-field acute angle method (see Figure 7 forth row, left panel marked with MS).

#### 4.3.4 Structure minimization method

The structure minimization method (Georgoulis et al., 2004) is a semi-analytic method which aims at eliminating dependencies between pixels. We do not describe the method here, because in the test only for a fraction of 0.22 pixels the ambiguity has been removed correctly, which is worse than a random result (see Figure 7 third row, right panel marked with MPG).

#### 4.3.5 Non-potential magnetic field calculation method

The non-potential magnetic field method developed by Georgoulis (2005) is identical with the acute angle method close to the disk center. Away from the disk center the method is more sophisticated and uses the fact that the magnetic field can be represented as a combination of a potential field and a non-potential part , where the non-potential part is horizontal on the boundary and only contains electric currents. The method aims at computing a fair a priori approximation of the electric current density before the ambiguity removal. With the help of a Fourier method the component and the corresponding approximate field are computed. This field is then used as the reference field for an acute angle method. The quality of the reference field depends on the accuracy of the a priori assumed electric current density . In the original implementation by Georgoulis (2005) was chosen once a priori and not changed afterwards. In an improved implementation (published as part of the comparison paper by Metcalf et al. (2006) and implemented by Georgoulis) becomes updated in an iterative process. The original implementation got 0.70 pixels correct and the improved version 0.90 (see Figure 7 forth row, center and right panels marked with NPFC and NPFC2, respectively). So the original method is on the same level as the potential-field acute angle method, but the current iteration introduced in the updated method gives significantly better results. This method has been used for example to resolve the ambiguity of full-disk vector magnetograms from the SOLIS instrument (Henney et al., 2006) at NSO/Kitt Peak.

#### 4.3.6 Pseudo-current method

The pseudo-current method developed by Gary and Démoulin (1995) uses as the initial step the potential-field acute angle method and subsequently applies this result to compute an approximation for the vertical electric current density. The current density is then approximated by a number of local maxima of with an analytic expression containing free model parameters, which are computed by minimizing a functional of the square of the vertical current density. This optimized current density is then used to compute a correction to the potential field. This new reference field is then used in the acute angle method to resolve the ambiguity. In the test case this method got a fraction of 0.78 of pixels correct, which is only slightly better than the potential-field acute angle method (see Figure 7 fifth row, left panel marked with PCM).

#### 4.3.7 U. Hawai’i iterative method

This method, originally developed in Canfield et al. (1993) and subsequently improved by a group of people at the Institute for Astronomy, U. Hawai’i. As the initial step the acute angle method is applied, which is then improved by a constant- force-free field, where has to be specified by the user (in principle it should also be possible to apply an automatic -fitting method as discussed in Section 4.3.2). Therefore, the result would be similar to the improved acute angle methods, but additional two more steps have been introduced for a further improvement. In a subsequent step the solution is smoothed (minimizing the angle between neighboring pixels) by starting at a location where the field is radial and the ambiguity is obvious, e.g., the umbra of a sunspot. Finally also the magnetic field divergence or vertical electric current density is minimized. This code includes several parameters, which have to be specified by the user. In the test case the code recognized a fraction of 0.97 pixels correctly. So the additional steps beyond the improved acute angle method provide another significant improvement and almost the entire region has been correctly identified (see Figure 7 fifth row, center panel marked with UHIM).

#### 4.3.8 Minimum energy methods

The minimum energy method has been developed by Metcalf (1994). As other sophisticated methods it uses the potential-field acute angle method as the initial step. Subsequently a pseudo energy, which is defined as a combination of the magnetic field divergence and electric current density, is minimized. In the original formulation the energy was defined as , which was slightly modified to

in an updated version. For computing , , and , a linear force-free model is computed, in the same way as described in Section 4.3.7. The method minimizes the functional (29) with the help of a simulated annealing method, which is a robust algorithm to find a global minimum. In a recent update (published in Metcalf et al., 2006) the (global) linear force-free assumption has been relaxed and replaced by local linear force-free assumptions in overlapping parts of the magnetogram. The method was dubbed nonlinear minimum energy method, although it does not use true NLFF fields (would be too slow) for computing the divergence and electric currents. The original linear method got a fraction of 0.98 of pixels correctly and the nonlinear minimum energy method even 1.00. Almost all pixels have been correct, except a few on the boundary (see Figure 7 fifth row, right panel and last row left panel, marked with ME1 and ME2, respectively.) Among the fully automatic methods this approach had the best performance on accuracy. A problem for practical use of the method was that it is very slow, in particular for the nonlinear version. Minimum energy methods are routinely used to resolve the ambiguity in active regions as measured, e.g., with SOT on Hinode or HMI on SDO.