def _parse_idxref_lp_distance_etc(lp_file_lines):
    """Parse the LP file for refined distance, beam centre and so on..."""
    beam = None
    diatance = None
    i = 0
    while i < len(lp_file_lines):
        line = lp_file_lines[i]
        i += 1
        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
