def permute_cycle_tz(tz, cycle):
    """
    Permute a daily cycle by a given amount of hours.
    This is a way to convert from local time to UTC

    Parameters
    ----------
    tz: String
        String corresponding to the timezone
    cycle: List of length N_HOUR_DAY
        Hourly scaling factors to be permuted

    Returns
    -------
    Permuted cycle scaling factors
    """
    shift = int(tz)

    # half hours for the time zone are not considered
    try:
        answer = [cycle[shift - i] for i in range(len(cycle), 0, -1)]
    except IndexError:
        answer = [cycle[shift - i + 24] for i in range(len(cycle), 0, -1)]

    return answer