Skip to content

Commit

Permalink
Merge pull request #185 from ahoust17/main
Browse files Browse the repository at this point in the history
Update image_tools.py
  • Loading branch information
gduscher authored Dec 16, 2024
2 parents f3337eb + eee710e commit a6cde8b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pyTEMlib/image_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import sidpy
import pyTEMlib.file_tools as ft
import pyTEMlib.sidpy_tools
# import pyTEMlib.probe_tools

from tqdm.auto import trange, tqdm

Expand Down Expand Up @@ -56,7 +55,6 @@
from sklearn.cluster import DBSCAN

from ase.build import fcc110
from pyTEMlib import probe_tools

from scipy.ndimage import rotate
from scipy.interpolate import RegularGridInterpolator
Expand Down Expand Up @@ -94,7 +92,7 @@ def get_atomic_pseudo_potential(fov, atoms, size=512, rotation=0):
y = pos[1] / pixel_size
atom_width = 0.5 # Angstrom
gauss_width = atom_width/pixel_size # important for images at various fov. Room for improvement with theory
gauss = probe_tools.make_gauss(max_size, max_size, width = gauss_width, x0=x, y0=y)
gauss = pyTEMlib.probe_tools.make_gauss(max_size, max_size, width = gauss_width, x0=x, y0=y)
unit_cell_potential += gauss * atomic_number # gauss is already normalized to 1

# Create interpolation function for unit cell potential
Expand Down Expand Up @@ -125,7 +123,7 @@ def convolve_probe(ab, potential):
pad_height = pad_width = potential.shape[0] // 2
potential = np.pad(potential, ((pad_height, pad_height), (pad_width, pad_width)), mode='constant')

probe, A_k, chi = probe_tools.get_probe(ab, potential.shape[0], potential.shape[1], scale = 'mrad', verbose= False)
probe, A_k, chi = pyTEMlib.probe_tools.get_probe(ab, potential.shape[0], potential.shape[1], scale = 'mrad', verbose= False)


convolved = fftconvolve(potential, probe, mode='same')
Expand Down

0 comments on commit a6cde8b

Please sign in to comment.