Skip to content

Commit

Permalink
Support multi-phase vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
viljarjf committed Jun 11, 2024
1 parent b1aa171 commit d7b14b9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pyxem/signals/indexation_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,10 @@ def to_single_phase_orientations(self, **kwargs) -> Orientation:
symmetry=self.simulation.phases.point_group,
)

def to_single_phase_vectors(
def to_vectors(
self, n_best_index: int = 0, **kwargs
) -> hs.signals.Signal1D:
"""Get the reciprocal lattice vectors for a single-phase simulation.
"""Get the reciprocal lattice vectors for each navigation position.
Parameters
----------
Expand All @@ -408,10 +408,10 @@ def to_single_phase_vectors(
"""

if self.simulation.has_multiple_phases:
raise ValueError("Multiple phases found in simulation")

# Use vector data as signal in case of different vectors per navigation position
vectors_signal = hs.signals.Signal1D(self.simulation.coordinates)
# Use vector data as signal in case of different vectors per navigation position
vectors_signal = hs.signals.Signal1D(self.simulation.coordinates)
else:
vectors_signal = hs.signals.Signal1D([sim for sim in self.simulations])
v = self.map(
extract_vectors_from_orientation_map,
all_vectors=vectors_signal,
Expand Down Expand Up @@ -580,7 +580,7 @@ def to_markers(
navigation_chunks = None
all_markers = []
for n in range(n_best):
vectors = self.to_single_phase_vectors(
vectors = self.to_vectors(
lazy_output=True, navigation_chunks=navigation_chunks
)
color = marker_colors[n % len(marker_colors)]
Expand Down

0 comments on commit d7b14b9

Please sign in to comment.