def get_chronogram_vals(series, lights_on, lights_off):
    """
    Convert a time series to chronongram values (i.e. averaged
    by hour for the light cycle)

    Parameters
    ----------
    series : pandas.Series
        time series data
    lights_on : int
        Integer from 0-23 denoting start of light cycle
    lights_off : int
        Integer from 0-23 denoting end of light cycle

    Returns
    -------
    reindexed : pandas.Series
        Series of chronogram values, with 0 being start of the light cycle

    """
    byhour = series.groupby([series.index.hour]).sum()
    byhourday = series.groupby([series.index.hour, series.index.date])
    num_days_by_hour = byhourday.sum().index.get_level_values(0).value_counts()
    byhour = byhour.divide(num_days_by_hour, axis=0)
    new_index = list(range(lights_on, 24)) + list(range(0,lights_on))
    reindexed = byhour.reindex(new_index)
    reindexed.index.name = 'hour'
    reindexed = reindexed.fillna(0)
    return reindexed