Generically convert magnitude and phase to real and imaginary part using
    the formula :math:`mag \cdot exp(1j / 1000 * pha)`

    Thus it is suitable for resistivities, multiply conductivity phases with -1

def generic_magpha_to_reim(mag, pha):
    """
    Generically convert magnitude and phase to real and imaginary part using
    the formula :math:`mag \cdot exp(1j / 1000 * pha)`

    Thus it is suitable for resistivities, multiply conductivity phases with -1
    """
    complex_nr = to_complex(mag, pha)
    real_part = np.real(complex_nr)
    imag_part = np.imag(complex_nr)
    return real_part, imag_part