def temp_separation_tc(H_c, fc, T_air, t0, r_ah, r_s, r_x, r_air, cp=1004.16):
    """Compute canopy temperature

    Parameters
    ----------
    H_c : ee.Image
    fc : ee.Image
    T_air : ee.Image
        Air temperature (Kelvin).
    t0 :
    r_ah : ee.Image
    r_s : ee.Image
        Soil aerodynamic resistance to heat transport (s m-1).
    r_x : ee.Image
        Bulk canopy aerodynamic resistance to heat transport (s m-1).
    r_air : ee.Image
    cp :

    Returns
    -------
    T_c : ee.Image
        Canopy temperature (Kelvin).

    """
    T_c_lin = fc.expression(
        '((T_air / r_ah) +  (t0 / r_s / (1 - fc)) +  (H_c * r_x / r_air / cp * ((1 / r_ah) + (1 / r_s) + (1 / r_x)))) / ((1 / r_ah) + (1 / r_s) + (fc / r_s / (1 - fc)))'
        , {'cp': cp, 'fc': fc, 'H_c': H_c, 'r_ah': r_ah, 'r_air': r_air,
        'r_s': r_s, 'r_x': r_x, 't0': t0, 'T_air': T_air})
    Td = fc.expression(
        '(T_c_lin * (1 + (r_s / r_ah))) - (H_c * r_x / r_air / cp * (1 + (r_s / r_x) + (r_s / r_ah))) - (T_air * r_s / r_ah)'
        , {'cp': cp, 'H_c': H_c, 'r_ah': r_ah, 'r_air': r_air, 'r_s': r_s,
        'r_x': r_x, 'T_air': T_air, 'T_c_lin': T_c_lin})
    delta_T_c = fc.expression(
        '((t0 ** 4) - (fc * (T_c_lin ** 4)) - ((1 - fc) * (Td ** 4))) / ((4 * (1 - fc) * (Td ** 3) * (1 + (r_s / r_ah))) + (4 * fc * (T_c_lin ** 3)))'
        , {'fc': fc, 'r_ah': r_ah, 'r_s': r_s, 't0': t0, 'Td': Td,
        'T_c_lin': T_c_lin})
    T_c = fc.expression('T_c_lin + delta_T_c', {'T_c_lin': T_c_lin,
        'delta_T_c': delta_T_c}).where(fc.lt(0.1), t0).where(fc.gt(0.9), t0)
    T_c = T_c.where(T_c.lte(T_air.subtract(10.0)), T_air.subtract(10.0))
    T_c = T_c.where(T_c.gte(T_air.add(50.0)), T_air.add(50.0))
    return T_c
