Skip to content

Commit

Permalink
Fix x-ray propagation sign to always be positive
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Avery <[email protected]>
  • Loading branch information
saransh13 authored and psavery committed Dec 18, 2024
1 parent 164b618 commit 5d1ef9c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hexrdgui/calibration/cartesian_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
def cartesian_viewer():
return InstrumentViewer()

def get_xray_propagation_sign(instr):
return np.sign(instr.beam_vector[2])

class InstrumentViewer:

Expand All @@ -40,7 +42,8 @@ def __init__(self):
self.detector_corners = {}

dist = HexrdConfig().cartesian_virtual_plane_distance
dplane_tvec = np.array([0., 0., -dist])
sgn = get_xray_propagation_sign(self.instr)
dplane_tvec = np.array([0., 0., sgn*dist])

rotate_x = HexrdConfig().cartesian_plane_normal_rotate_x
rotate_y = HexrdConfig().cartesian_plane_normal_rotate_y
Expand Down

0 comments on commit 5d1ef9c

Please sign in to comment.