10x speed up of XRD calculation using numpy vectorization.