Repository navigation
Replies: 5 comments 4 replies
|
|
|
Small comment ... the documentation on (d1,d2, d3) and (x1, x2, x3) as well as (x3, x1, x2) aka (z,y,x) are all right handed. But you are right (x,y,z) is left handed in this configuration. About orientation of detectors ... @loichuder is working on something related in #2868. Can you validate the orientation he is giving ? |
|
There is another difference between the flipping, as performed in |
|
If you read this thread, you can have a look at this PR which is about the same topic: #2911 |
|
I checked this numerically against pyFAI 2026.9.0, since the figure alone kept the question open. What It is also the frame pyFAI's own angles are computed in. For a tilted geometry Pixel indices → axes depends on
Lab directions: only import numpy as np
from pyFAI.detectors import Detector
from pyFAI.geometry import Geometry
for o in (1, 2, 3, 4):
det = Detector(pixel1=1e-4, pixel2=1e-4, max_shape=(100, 100), orientation=o)
g = Geometry(dist=0.1, poni1=5e-3, poni2=5e-3, detector=det)
z, y, x = g.calc_pos_zyx(d1=np.array([50., 51., 50.]), d2=np.array([50., 50., 51.]))
p = np.stack([z, y, x], 1)
print(o, "+row:", np.round((p[1] - p[0]) / 1e-4, 3), "+col:", np.round((p[2] - p[0]) / 1e-4, 3))
g = Geometry(dist=0.1, poni1=5e-3, poni2=5e-3, rot1=0.05, rot2=-0.03, rot3=0.02,
detector=Detector(pixel1=1e-4, pixel2=1e-4, max_shape=(100, 100)))
d1, d2 = np.array([10., 80., 30.]), np.array([70., 20., 90.])
z, y, x = g.calc_pos_zyx(d1=d1, d2=d2)
print(np.allclose(np.arctan2(np.hypot(x, y), z), g.tth(d1, d2)),
np.allclose(np.arctan2(y, x), g.chi(d1, d2))) |

Uh oh!
There was an error while loading. Please reload this page.
What is the coordinate system that is used for the return values of
pyFAI.geometry.core.Geometry.calc_pos_zyx()? The docstring sayswhich is unclear to me. Is it a right-handed or left-handed system? The return description says
How does this relate to the pyFAI geometry, as defined e.g. here:
https://pyfai.readthedocs.io/en/stable/geometry.html#geometry
Thanks!
All reactions