Compute correction factors for 2D rhizotron geometries, following
    Weigand and Kemna, 2017, Biogeosciences

    https://doi.org/10.5194/bg-14-921-2017

    Parameters
    ----------
    data : :py:class:`pandas.DataFrame`
        measured data
    true_conductivity : float
        Conductivity in S/m
    elem_file : string
        path to CRTomo FE mesh file (elem.dat)
    elec_file : string
        path to CRTomo FE electrode file (elec.dat)

    Returns
    -------
    correction_factors : Nx5 :py:class.`numpy.ndarray`
        measurement configurations and correction factors
        (a,b,m,n,correction_factor)

def compute_correction_factors(data, true_conductivity, elem_file, elec_file):
    """Compute correction factors for 2D rhizotron geometries, following
    Weigand and Kemna, 2017, Biogeosciences

    https://doi.org/10.5194/bg-14-921-2017

    Parameters
    ----------
    data : :py:class:`pandas.DataFrame`
        measured data
    true_conductivity : float
        Conductivity in S/m
    elem_file : string
        path to CRTomo FE mesh file (elem.dat)
    elec_file : string
        path to CRTomo FE electrode file (elec.dat)

    Returns
    -------
    correction_factors : Nx5 :py:class.`numpy.ndarray`
        measurement configurations and correction factors
        (a,b,m,n,correction_factor)
    """
    settings = {
        'rho': 100,
        'pha': 0,
        'elem': 'elem.dat',
        'elec': 'elec.dat',
        '2D': True,
        'sink_node': 100,

    }
    K = geometric_factors.compute_K_numerical(data, settings=settings)

    data = geometric_factors.apply_K(data, K)
    data = fixK.fix_sign_with_K(data)

    frequency = 100

    data_onef = data.query('frequency == {}'.format(frequency))
    rho_measured = data_onef['r'] * data_onef['k']

    rho_true = 1 / true_conductivity * 1e4
    correction_factors = rho_true / rho_measured

    collection = np.hstack((
        data_onef[['a', 'b', 'm', 'n']].values,
        np.abs(correction_factors)[:, np.newaxis]
    ))

    return collection