Skip to content

Commit

Permalink
Translate angle index to degrees
Browse files Browse the repository at this point in the history
  • Loading branch information
viljarjf committed May 10, 2024
1 parent c023897 commit 2ab8143
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pyxem/signals/polar_diffraction2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,18 @@ def get_orientation(
output_dtype=float,
)

# Translate in-plane rotation from index to degrees
# by using the calibration of the axis
def rotation_index_to_degrees(data, axis):
data = data.copy()
ind = data[:, 2].astype(int)
data[:, 2] = rad2deg(axis[ind])
return data

orientation.map(
rotation_index_to_degrees, axis=self.axes_manager.signal_axes[0].axis
)

orientation.set_signal_type("orientation_map")
orientation.simulation = simulation
orientation.column_names = ["index", "correlation", "rotation", "factor"]
Expand Down

0 comments on commit 2ab8143

Please sign in to comment.