for each reciprocal spot q ∈ Q. Our hope is that with enough samples, some of the vectors in A proposes the correct Miller index of each spot in Q * . So to refine A we use these proposed indices and robust optimization. We use LTS with residual threshold annealing (as described in the main body of the paper) to determine the outliers of Q and find the refinement of vector a that satisfies the most the Laue condition with target h a,q , i.e., we optimize the following expression. Recall that we know the ideal crystal lattice basis M ⋆ 0 := (a ⋆ , b ⋆ , c ⋆ ). We now attach copies of M ⋆ 0 to each of candidates vector of A by aligning their first vector as follows.