import numpy as np


def uz2u10(Uz, z, mode, z0=0.001, power=0.1):
    if mode == "log":
        kappa = 0.4  # von Karman constant
        Uf = Uz * kappa / np.log(z / z0)
        U10 = Uf * (1 / kappa) * np.log(10 / z0)
    elif mode == "power":
        U10 = Uz * (10 / z) ** power
    else:
        raise ValueError("Mode must be 'log' or 'power'")
    return U10