Skip to content

Commit

Permalink
BugFix: Fix hexagonal issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
CSSFrancis committed Feb 7, 2024
1 parent 44c4673 commit 7efd4ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion diffsims/simulations/simulation2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,10 @@ def plot(

if show_labels:
millers = np.round(
np.matmul(coords.hkl, self.get_current_rotation().T)
np.matmul(
np.matmul(coords.data, self.get_current_rotation().T),
coords.phase.structure.lattice.base.T,
)
).astype(np.int16)
# only label the points inside the axes
xlim = ax.get_xlim()
Expand Down
2 changes: 1 addition & 1 deletion diffsims/utils/sim_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def _get_kinematical_structure_factor(

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

# Calculate the complex structure factor
Expand Down

0 comments on commit 7efd4ee

Please sign in to comment.