def prep_re_group(re_groupdict):
    """Extracts and prepares keyword match groups.

    Arg:
        re_groupdict: re.match.groupdict() instance.

    Returns:
        parameter keyword, historic mean range, $PxN channel name
    """

    param_key = re_groupdict.get('param')
    channel_name = re_groupdict.get('channel', '').strip('_').replace(' ','').upper()
    tmp_val = re_groupdict.get('val', '')
    if not tmp_val:
        mean_range = 10
    else:
        mean_range = int(tmp_val.strip('_'))

    return param_key, mean_range, channel_name