def get_load_dur_curve_building(building, get_therm=True, with_dhw=False):
    """
    Returns load duration power curve of building object.

    Parameters
    ----------
    building : object
        Building object of pycity (should have apartment with power curves)
    get_therm : bool, optional
        Defines if thermal or electrical load duration curve should be used
        (default: True)
        True - Return thermal power
        False - Return electrical power
    with_dhw : bool, optional
        Defines if domestic hot water (dhw) should be included (only relevant,
        if get_therm == True).
        (default: False)
        True - Return space heating power only
        False - Return space heating and hot water power

    Returns
    -------
    load_dur_curve : np.array
        Duration load curve array (power sorted in descending order)
    """

    if get_therm:  # Thermal power
        power_curve = building.get_space_heating_power_curve()
        if with_dhw:
            power_curve += building.get_dhw_power_curve()
    else:  # Electrical power
        power_curve = building.get_electric_power_curve()

    # Sort descending
    power_curve.sort()
    load_dur_curve = power_curve[::-1]
    return load_dur_curve