Skip to content

Commit

Permalink
Merge pull request #127 from pycroscopy/use_dict_2
Browse files Browse the repository at this point in the history
Update graph_tools.py
  • Loading branch information
gduscher authored Jun 22, 2023
2 parents ce5e737 + 35d09d5 commit 535cd81
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pyTEMlib/graph_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# from scipy.spatial import cKDTree, Voronoi, ConvexHull
import scipy.spatial
import scipy.optimize
import scipy.interpolate

from skimage.measure import grid_points_in_poly, points_in_poly

Expand Down Expand Up @@ -139,10 +140,13 @@ def get_bond_radii(atoms, bond_type='bond'):

r_a = []
for atom in atoms:
if bond_type == 'covalent':
r_a.append(pyTEMlib.crystal_tools.electronFF[atom.symbol]['bond_length'][0])
if atom.symbol == 'X':
r_a.append(1.2)
else:
r_a.append(pyTEMlib.crystal_tools.electronFF[atom.symbol]['bond_length'][1])
if bond_type == 'covalent':
r_a.append(pyTEMlib.crystal_tools.electronFF[atom.symbol]['bond_length'][0])
else:
r_a.append(pyTEMlib.crystal_tools.electronFF[atom.symbol]['bond_length'][1])
if atoms.info is None:
atoms.info = {}
atoms.info['bond_radii'] = r_a
Expand Down Expand Up @@ -911,7 +915,7 @@ def undistort(distortion_matrix, image_data):
grid_x, grid_y = np.mgrid[0:size_x - 1:size_x * 1j, 0:size_y - 1:size_y * 1j]
print('interpolate')

interpolated = griddata(np.array(corrected), np.array(intensity_values), (grid_x, grid_y), method='linear')
interpolated = scipy.interpolate.griddata(np.array(corrected), np.array(intensity_values), (grid_x, grid_y), method='linear')
return interpolated


Expand Down

0 comments on commit 535cd81

Please sign in to comment.