def GetBoundaries(n, line):
    """
    Parse and extract a boundary of n+1 elements from a line
    of text
    
    Parameters
    ----------
    n: int
        Number of elements
    line: string
        line containing boundary data
    
    Returns
    -------
    
    Array of n+1 floats representing the boundary
    """
    split = line.split(" ")
    split = [x for x in split if x]  # remove empty lines

    boundaries = []
    
    # we assume boundaries and n is equal
    if len(split) != n+1:
        raise RuntimeError("GetBoundaries: Wrong number of boundaries")
    
    for i in range(0,n+1):
        d = float(split[i])
        boundaries.append(d)

    if boundaries.count == 0:
        return None

    return boundaries