def stratification(height, value_mean, height_top, value_top):
    """
    Calculates the stratification of the temperature or relative humidity
    :param height: height at which the stratification value is wanted. in m.
    :param value_mean: mean value
    :param height_top: height at the top of the boundary. in m
    :param value_top: value at the top of the boundary
    :return: value at desired height.
    """
    return value_mean - 2 * height * (value_mean - value_top)/height_top