  Knowledge regarding the coronal magnetic field is important for the
understanding of many phenomena, like flares and coronal mass ejections.
Because of the low plasma beta in the solar corona the coronal magnetic field
is often assumed to be force-free and we use photospheric vector magnetograph
data to extrapolate the magnetic field into the corona with the help of a
non-linear force-free optimization code. Unfortunately the measurements of the
photospheric magnetic field contain inconsistencies and noise. In particular
the transversal components (say Bx and By) of current vector magnetographs have
their uncertainties. Furthermore the magnetic field in the photosphere is not
necessary force-free and often not consistent with the assumption of a
force-free field above. We develop a preprocessing procedure to drive the
observed non force-free data towards suitable boundary conditions for a
force-free extrapolation. As a result we get a data set which is as close as
possible to the measured data and consistent with the force-free assumption.
