def read_lm_data(lines, lenfield=19):
    """Read the potential data of a particular LM channel in vsp and vns file

    Note that the header containing 'L=,M=' should be excluded. Only numbers and
    empty lines are allowed. Unit conversion from Rydberg to Hartree is done.

    Args:
        lines (list of str): file lines containing data of potential
        lenfield (int): the length of field that one number occupies, 19 as default

    Returns:
        list, potential in Hartree unit
    """
    l = ''.join([x.strip() for x in lines])
    ll = len(l)
    if ll%lenfield != 0:
        raise IOError("Bad input, total length %d not divided by %d" % (ll, lenfield))
    n = int(ll/lenfield)
    data = [float(l[lenfield*i:lenfield*(i+1)])/2.0 for i in range(n)]
    return data