Skip to content

Commit

Permalink
clean up moire
Browse files Browse the repository at this point in the history
  • Loading branch information
sezelt committed Oct 16, 2023
1 parent 4cf1e30 commit 5de83bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 29 deletions.
32 changes: 5 additions & 27 deletions py4DSTEM/process/diffraction/crystal.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,12 @@
from matplotlib.patches import Circle
from fractions import Fraction
from typing import Union, Optional
from scipy.optimize import curve_fit
import sys

from emdfile import tqdmnd, PointList, PointListArray
from emdfile import PointList
from py4DSTEM.process.utils import single_atom_scatter, electron_wavelength_angstrom

from py4DSTEM.process.diffraction.crystal_viz import plot_diffraction_pattern
from py4DSTEM.process.diffraction.crystal_viz import plot_ring_pattern
from py4DSTEM.process.diffraction.utils import Orientation, calc_1D_profile

try:
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
from pymatgen.core.structure import Structure
except ImportError:
pass
from py4DSTEM.process.diffraction.utils import Orientation


class Crystal:
Expand Down Expand Up @@ -1091,7 +1082,6 @@ def generate_moire_diffraction_pattern(
exy_1=0.0,
phi_1=0.0,
power=2.0,
k_max=1.0,
):
"""
Calculate a Moire lattice from 2 parent diffraction patterns. The second lattice can be rotated
Expand All @@ -1118,13 +1108,12 @@ def generate_moire_diffraction_pattern(
Rotation of lattice 1 in real space.
power: float
Plotting power law (default is amplitude**2.0, i.e. intensity).
k_max: float
Max k value of the calculated (and plotted) Moire lattice.
Returns
--------
bragg_moire: BraggVector
Bragg vectors for moire lattice.
parent_peaks_0, parent_peaks_1, moire_peaks: BraggVectors
Bragg vectors for the rotated & strained parent lattices
and the moire lattice
"""

Expand Down Expand Up @@ -1159,14 +1148,6 @@ def generate_moire_diffraction_pattern(
l1 = bragg_peaks_1["l"][sub1]

# apply strain tensor to lattice 1

# infinitesimal
# m = np.array([
# [1 + exx_1, (exy_1 - phi_1)*0.5],
# [(exy_1 - phi_1)*0.5, 1 + eyy_1],
# ])

# finite rotation
m = np.array(
[
[np.cos(phi_1), -np.sin(phi_1)],
Expand All @@ -1189,11 +1170,8 @@ def generate_moire_diffraction_pattern(
np.arange(np.sum(sub1)),
indexing="ij",
)
# ind0 = ind0.ravel()
# ind1 = ind1.ravel()
qx = qx0[ind0] + qx1[ind1]
qy = qy0[ind0] + qy1[ind1]
# int_moire = int0_sub[ind0] + int1_sub[ind1]
int_moire = (int0_sub[ind0] * int1_sub[ind1]) ** 0.5

# moire labels
Expand Down
2 changes: 0 additions & 2 deletions py4DSTEM/process/diffraction/crystal_ACOM.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import numpy as np
import matplotlib.pyplot as plt
import os
from typing import Union, Optional
import time, sys
from tqdm import tqdm

from emdfile import tqdmnd, PointList, PointListArray
Expand Down

0 comments on commit 5de83bf

Please sign in to comment.