def get_limit_spec(limit):
    """
    Based on an input *limit* string of the form:

    <system>.<type>.<direction>.<qualifier>

    (where the "qualifier" element is optional) return the various pieces
    into a dictionary for convenience.
    
    Parameters
    ----------
    limit : str
        The input limit string. 
        
    Returns
    -------
    dict
        A dictionary specifying the names of the various pieces of the
        limit string. 
    """
    words = limit.split(".")
    if len(words) < 3:
        raise RuntimeError(f"{limit} is not a valid limit string")
    limit_spec = {
        "system": words[0],
        "type": words[1],
        "direction": words[2]
    }
    if len(words) == 4:
        limit_spec["qualifier"] = words[3]
    else:
        limit_spec["qualifier"] = None
    return limit_spec