def apply_daily_results_by_month_to_mast_data(mast_data, corr_results,
    ref_ws_col='ref', site_ws_col='site', splice=True):
    """Applies the slopes and offsets from a daily correaltion, binned by month, to a DataFrame of wind speed data.

    :Parameters:

    mast_data: DataFrame
        timeseries of wind speed data

    corr_results: DataFrame
        slope, offset, R2, uncert, points for each month

    ref_ws_col: string, default 'ref'
        Reference anemometer data to use. Extracted from mast_data DataFrame.

    site_ws_col: string, default 'site'
        Site anemometer data to use. Extracted from mast_data DataFrame

    splice: Boolean, default True
        Returns site data where available and gap-fills any missing periods between the site mast
        and the reference mast's measurement period. Otherwise, returns purely sythesized data without
        taking into account the measured wind speeds.

    :Returns:

    out: time series DataFrame
        predicted wind speeds at the site

    """
    if corr_results.index.nlevels > 1:
        corr_results = corr_results.loc[(ref_ws_col), :]
    corr_data = mast_data.loc[:, ([ref_ws_col, site_ws_col])].dropna(how='all')
    corr_data['month'] = corr_data.index.month
    corr_data['slope'] = corr_data.month.map(corr_results.slope)
    corr_data['offset'] = corr_data.month.map(corr_results.offset)
    corr_data['syn'] = corr_data[ref_ws_col
        ] * corr_data.slope + corr_data.offset
    corr_data['syn_splice'] = corr_data[site_ws_col]
    corr_data.loc[corr_data.syn_splice.isnull(), 'syn_splice'] = corr_data.loc[
        corr_data.syn_splice.isnull(), 'syn']
    if splice:
        syn_data = corr_data.syn_splice.to_frame('syn')
    else:
        syn_data = corr_data.syn.to_frame('syn')
    return syn_data
