Skip to content

Commit ef0d80e

Browse files
authored
Merge pull request #85 from scipp/fix-geometry
Rotated detector pixel offset based on the starting position.
2 parents 24da326 + 5c39817 commit ef0d80e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/ess/nmx/mcstas/xml.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,11 @@ def _pixel_positions(
338338
return (
339339
(pixel_n_slow * slow_axis_steps)
340340
+ (pixel_n_fast * fast_axis_steps)
341-
+ position_offset
342-
)
341+
+ detector.rotation_matrix
342+
* sc.vector(
343+
[detector.start_x, detector.start_y, 0.0], unit=position_offset.unit
344+
) # Detector pixel offset should also be rotated first.
345+
) + position_offset
343346

344347

345348
def _detector_pixel_positions(

0 commit comments

Comments
 (0)