def _parse_idxref_lp_distance_etc(lp_file_lines):
    """Parse the LP file for refined distance, beam centre and so on..."""

    beam = None
    distance = None

    for line in lp_file_lines:
        if "DETECTOR COORDINATES" in line and "DIRECT BEAM" in line:
            beam = tuple(map(float, line.split()[-2:]))
        if "CRYSTAL TO DETECTOR" in line:
            distance = float(line.split()[-1])
            if distance < 0:
                distance *= -1

    return beam, distance