Skip to content

Commit 7efd4ee

Browse files
committed
BugFix: Fix hexagonal issues.
1 parent 44c4673 commit 7efd4ee

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

diffsims/simulations/simulation2d.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,10 @@ def plot(
507507

508508
if show_labels:
509509
millers = np.round(
510-
np.matmul(coords.hkl, self.get_current_rotation().T)
510+
np.matmul(
511+
np.matmul(coords.data, self.get_current_rotation().T),
512+
coords.phase.structure.lattice.base.T,
513+
)
511514
).astype(np.int16)
512515
# only label the points inside the axes
513516
xlim = ax.get_xlim()

diffsims/utils/sim_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def _get_kinematical_structure_factor(
278278

279279
# Express the atom positions in the same reference frame as the
280280
# Miller indices
281-
mat = np.linalg.inv(np.dot(structure.lattice.stdbase, structure.lattice.recbase))
281+
mat = np.linalg.inv(np.dot(structure.lattice.stdbase, structure.lattice.recbase.T))
282282
xyz = np.dot(xyz, mat)
283283

284284
# Calculate the complex structure factor

0 commit comments

Comments
 (0)