Skip to content

Commit

Permalink
fix issue with negative atomic coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
freude committed May 5, 2021
1 parent 07dc966 commit 05c7db3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions nanonet/tb/structure_designer.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ def __init__(self, **kwargs):

labels, coords = xyz2np(reader)

offset = 1e-3

min_x = np.min(coords[:, 0]) - offset
min_y = np.min(coords[:, 1]) - offset
min_z = np.min(coords[:, 2]) - offset

coords -= np.array([min_x, min_y, min_z])

num_lines = reader.count('\n')
if num_lines > 11:
logging.info("The xyz-file:\n {}".format('\n'.join(reader.split('\n')[:11])))
Expand Down

0 comments on commit 05c7db3

Please sign in to comment.