Skip to content

Commit

Permalink
Fix phase map with n_best = 1
Browse files Browse the repository at this point in the history
  • Loading branch information
viljarjf committed Jun 13, 2024
1 parent 852c9d0 commit 284fbc3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyxem/signals/indexation_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,8 @@ def to_phase_map(self):
raise ValueError("Only a single phase present in simulation")

phase_idxs = self.to_phase_index()
# in case n_best = 1
phase_idxs = phase_idxs.reshape(*self.axes_manager._navigation_shape_in_array, -1)
colors = [p.color_rgb for p in self.simulation.phases]

float_rgb = np.take(colors, phase_idxs[..., 0], axis=0)
Expand Down

0 comments on commit 284fbc3

Please sign in to comment.