Closed psavery closed 1 year ago
For my example, this produces nearly the same results with a few differences. One of which is that (2, -4, 0)
near the bottom becomes (-2, 4, 0)
. It looks like that is what it actually was previously (before the transforms were merged), so that also matches better.
Previous:
Using np.dot()
:
And actually, this now matches exactly what we had before migrating to the new transforms. Here is what we used to have in the old transforms:
It appears the dot product version is an exact match for this example.
This issue arose from #509, due to somewhat complex details.
In short, the old
gvecToDetectorXY()
would filter out g-vectors going the wrong way (they would result innan
), butgvecToDetectorXYArray()
would not.The new
gvec_to_xy()
has behavior matchinggvecToDetectorXYArray()
. But that means that places wheregvecToDetectorXY()
used to be used, we need to verify that the function does not receive g-vectors going the wrong way.Looking through the code, however, I only found one place where
gvecToDetectorXY()
used to receive g-vectors going the wrong way. It was the Laue overlay simulator, which would compute g-vectors from symmetrical HKLs (which is why it would have duplicate g-vectors going the wrong way).All other cases where
gvecToDetectorXY()
was called would be after the g-vectors were computed fromanglesToGvec()
, which I believe should always produce g-vectors going in the correct direction.As such, we only need to filter out wrong-direction g-vectors in the Laue simulator.
Fixes: hexrd/hexrdgui#1412