Skip to content

Commit

Permalink
Copy data before modifying
Browse files Browse the repository at this point in the history
  • Loading branch information
viljarjf committed Dec 9, 2024
1 parent 8f3b511 commit e22123c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyxem/signals/indexation_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ def vectors_from_orientation_map(
hkl = hkl[index]
phase = dict2phase(**phase)
# Copy manually, as deepcopy adds a lot of overhead with the phase
vectors = DiffractingVector(phase, xyz=data)
vectors = DiffractingVector(phase, xyz=data.copy())
# Flip y, as discussed in https://github.com/pyxem/pyxem/issues/925
vectors.y = -vectors.y

Expand All @@ -497,7 +497,7 @@ def vectors_from_orientation_map(
vectors = ~rotation * vectors.to_miller()
vectors = DiffractingVector(
vectors.phase,
xyz=-vectors.data.copy(), # Negating for proper alignment - is this flipping z direction?
xyz=-vectors.data, # Negating for proper alignment - is this flipping z direction?
intensity=intensities,
)
vectors.coordinate_format = coordinate_format
Expand Down

0 comments on commit e22123c

Please sign in to comment.