Inferences of the magnetic field in the solar atmosphere by means of spectropolarimetric inversions (i.e., Stokes inversion codes) yield magnetic fields that are non-solenoidal ($ B 0$). Because of this, results obtained by such methods are sometimes put into question. We aim to develop and implement a new technique that, in conjunction with Stokes inversion codes, can retrieve magnetic fields that are simultaneously consistent with observed polarization signals and with the null divergence condition. The method used in this work strictly imposes $ B =0$ by determining the vertical component of the magnetic field ($B_ z $) from the horizontal ones ($B_ x B_ y $). We implement this technique, which we refer to as solenoidal inversion, into the FIRTEZ Stokes inversion code and apply it to spectropolarimetric observations of a sunspot observed with the Hinode/SP instrument. We show that the solenoidal inversion retrieves a vertical component of the magnetic field that is consistent in 80<!PCT!> of the analyzed three-dimensional $(x,y,z )$ domain, with the vertical component of the magnetic field inferred from the non-solenoidal inversion. We demonstrate that the solenoidal inversion is capable of a better overall fitting to the observed Stokes vector than the non-solenoidal inversion. In fact, the solenoidal magnetic field fits Stokes $V$ worse, but this is compensated by a better fit to Stokes $I$. We find a direct correlation between the worsening in the fit to the circular polarization profiles by the solenoidal inversion and the deviations in the inferred $B_ z $ with respect to the non-solenoidal inversion. Finally, we also show that the spatial distribution of the electric currents given by $ B $ does not change significantly after imposing the null divergence condition. In spite of being physically preferable, solenoidal magnetic fields are topologically very similar in 80<!PCT!> of the analyzed three-dimensional domain to the non-solenoidal fields obtained from spectropolarimetric inversions. These results support the idea that common Stokes inversion techniques fail to reproduce $ B =0$ mainly as a consequence of the uncertainties in the determination of the individual components of the magnetic field. In the remaining 20<!PCT!> of the analyzed domain, where the $B_ z $ inferred by the solenoidal and non-solenoidal inversions disagree, it remains to be proven that the solenoidal inversion is to be preferred because even though the overall fit to the Stokes parameters improves, the fit to Stokes $V$ worsens. It is in these regions where the application of the Stokes inversion constrained by the null divergence condition can yield new insights about the topology of the magnetic field in the solar photosphere.
Read full abstract