Getting the ($hkl$) Miller indices from the angle of incidence of a light ray I was given an X-ray diffraction lab this week. We measured the count rate for different angles $2\theta$ of the rotation of the detector. From these measurements we plotted a graph of 2theta vs the count rate, and deduced the peaks. From that we could then calculate the interplanar spacing $d$ using Bragg's law. Here is where I am stuck: From the calculated values of $d$, I know that I have to use the equation
$$d=\frac{a}{\sqrt{h^2 + k^2 + l^2}}$$ 
to find the lattice constant $a$,  but how do I find the ($hkl$) values?
The sample used was NaCl, with a face-centered cubic unit cell.
 A: For a given Bravais lattice you need to find the indices for which the structure factor $S_{hkl}$ doesn't vanish. For cubic lattices it's actually quite straightforward (e.g. for hexagonal ones can be already very tricky), knowing NaCl has a fcc structure, we know then the atomic positions in a unit-cell:
Na $\rightarrow$ $[0,0,0]$, $[1/2,1/2,0]$, $[1/2,0,1/2]$, $[0,1/2,1/2]$  and 
Cl $\rightarrow$ $[1/2,1/2,1/2]$, $[0,0,1/2]$, $[0,1/2,0]$, $[0,0,1/2].$ 
Next we need the expression of the structure factor for orthogonal lattices ($f_i$ is the form factor of atom $i,$ which contains information on the chemical identity of the atom):
$$
S_{\rm hkl} = \sum_{\rm atom\, i \in unit-cell} f_i \exp[2\pi i(hx_i + ky_i + lz_i)]
$$
Now just substitute the atomic coordinates one by one into $S_{hkl}$ and do the summation which should give you:
$$
S_{hkl} = \left(f_{Na}+f_{Cl}e^{\pi i(h+k+l)}\right) \left(1+e^{\pi i(h+k)}+e^{\pi i(h+l)}+e^{\pi i(k+l)}\right)
$$
Almost done now, just try few examples of $khl$ and see for which ones the structure factor doesn't go to zero (easy process because of the simplified form of the 2nd product term in $S$). Now you can check for yourself that for any set of mixed indices (i.e. even and odd indices together) $S \to 0,$ e.g. $S_{100}=0.$ Next we try all even and all odd indices, and find that $S$ is non-zero in both cases. So now you have your recipe for determining which $hkl$ values are valid for a fcc structure: $111, 200, 220, 311,...$ 
This type of treatments are covered in most basic solid state books, definitely encourage you to read about these things more formally.
