def _compute_phi_ss(C, mag, c1_dists, log_phi_ss, mean_phi_ss):
    """
    Returns the embeded logic tree for single station sigma
    as defined to be used in the Swiss Hazard Model 2014:
    the single station sigma branching levels combines with equal
    weights: the phi_ss reported as function of magnitude
    as proposed by Rodriguez-Marek et al (2013) with the mean
    (mean_phi_ss) single station value;
    the resulted phi_ss is in natural logarithm units
    """
    phi_ss = 0
    if mag < C['Mc1']:
        phi_ss = c1_dists
    elif mag >= C['Mc1'] and mag <= C['Mc2']:
        phi_ss = c1_dists + (C['C2'] - c1_dists) * ((mag - C['Mc1']) / (C[
            'Mc2'] - C['Mc1']))
    elif mag > C['Mc2']:
        phi_ss = C['C2']
    return (phi_ss * 0.5 + mean_phi_ss * 0.5) / log_phi_ss
