quantile_mapping.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:storylines 作者: jhamman 项目源码 文件源码
def apply_quantile_mapping_by_month(input_data, data_to_match, **kwargs):
    '''apply quantile mapping by month
    '''
    obs_groups = data_to_match.groupby('time.month')
    input_groups = input_data.groupby('time.month')

    results = []
    for (key_obs, group_obs), (key_input, group_input) in zip(obs_groups,
                                                              input_groups):
        results.append(quantile_mapping(group_input, group_obs, **kwargs))

    # put the groups back together
    new_concat = xr.concat(results, dim='time')
    # Now sort the time dimension again
    sort_inds = np.argsort(new_concat.time.values)
    new_concat = new_concat.isel(time=sort_inds)

    return new_concat
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号