def get_t_demand_list(temp_curve, th_curve):
    """
    Sorts thermal energy demand based on values of ambient temperatures.

    Parameters
    ----------
    temp_curve : list of ambient temperatures for one year
    th_curve : list of thermal energy demand for one year

    Returns
    -------
    t_demand_curve : thermal energy curve sorted based on ambient temperature values
    """
    return [th_demand for _, th_demand in sorted(zip(temp_curve, th_curve))]