Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions src/pyFAI/geometry/imaged11.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,18 @@ def convert_to_ImageD11(poni, distance_unit="µm", wavelength_unit="nm"):
distance_unit = to_unit(distance_unit, LENGTH_UNITS)
wavelength_unit = to_unit(wavelength_unit, LENGTH_UNITS)
f2d = convert_to_Fit2d(poni)
# TODO: manage orientation here
id11 = {"o11": 1,
"o12": 0,
"o21": 0,
"o22": -1}
orientation = detector.orientation
if orientation == 3:
(o11, o12, o21, o22) = (1, 0, 0, -1)
elif orientation == 1:
(o11, o12, o21, o22) = (1, 0, 0, +1)
elif orientation == 4:
(o11, o12, o21, o22) = (-1, 0, 0, -1)
elif orientation == 2:
(o11, o12, o21, o22) = (-1, 0, 0, +1)
else:
raise ValueError("Invalid orientation")
id11 = {"o11": o11, "o12": o12, "o21": o21, "o22": o22}
id11["distance"] = (f2d.directDist or 0) * 1e-3 * distance_unit.scale
id11["y_center"] = (f2d.centerX or 0) # in pixel
id11["z_center"] = (f2d.centerY or 0) # in pixel
Expand Down
Loading