def get_recess_int(df, Q, maxper=18, minper=6, thresh=30, inplace=False):
    """Gets intervals of recession from a hydrograph

    :param df: DataFrame with hydrograph data
    :param Q: Field in DataFrame with discharge data
    :param maxper: Period of record to scan discharge data for maxima; created for daily values; defaults to 18
    :param minper: Period of record to scan discharge data for minima; should be less than maxper; defaulst to 6
    :param thresh: Threshold of discharge below which maxima are not considered; defaults to 30
    :param inplace: Append to input database or create new one; defaults to False
    :return: DataFrame of original data and Max and Min, Indexes of maxima, Indexes of minima
    """
    if inplace:
        data = df
    else:
        data = df.copy()
    data['max'] = data[Q].rolling(maxper, center=True).max()
    data['max'] = data.ix[data['max'] == data['value'], 'max']
    data['max'] = data.ix[data['max'] > thresh, 'max']
    data['min'] = data[Q].rolling(minper, center=True).min()
    data['min'] = data.ix[data['min'] == data['value'], 'min']
    maxlist = data.index[data['max'].notnull()]
    firstmin = []
    for ind in maxlist:
        firstmin.append(data.ix[ind:, ('min')].first_valid_index())
    data['min'] = data.ix[data.index.isin(firstmin), 'min']
    return data, maxlist, firstmin
