Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ The following instructions are currently supported by picometer:
- fit `plane` to the currect atom / centroid selection;
- **Evaluation instructions**
- write out fractional `coordinates` of currently selected centroids or atoms.
- write out `displacement` parameters of currently selected centroids or atoms
(note: currently does not correctly handle symmetry transformations).
- write out `displacement` parameters of currently selected centroids or atoms.
- measure `distance` between 2 selected objects; if the selection includes
groups of atoms, measure closes distance to the group of atoms.
- measure `angle` between 2–3 selected objects: planes, lines, or (ordered) atoms.
Expand Down
8 changes: 6 additions & 2 deletions picometer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# read version from installed package
from importlib.metadata import version
from importlib.metadata import PackageNotFoundError, version

__version__ = version("picometer")

try:
__version__ = version('picometer')
except PackageNotFoundError:
__version__ = '0+unknown'
4 changes: 3 additions & 1 deletion picometer/atom.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ def transform(self, symm_op_code: str) -> 'AtomSet':
uij = self.fract_uij # shape: (n_atoms, 3, 3)
mask = ~np.isnan(uij).all(axis=(1, 2)) # atoms with defined Uij
if np.any(mask):
uij_rot = (s := symm_op.tf) @ uij[mask] @ s.T
abc_r = [self.base.a_r, self.base.b_r, self.base.c_r]
k = np.diag([1 / a for a in abc_r]) @ symm_op.tf @ np.diag(abc_r)
uij_rot = k @ uij[mask] @ k.T
data.loc[mask, 'U11'] = uij_rot[:, 0, 0]
data.loc[mask, 'U22'] = uij_rot[:, 1, 1]
data.loc[mask, 'U33'] = uij_rot[:, 2, 2]
Expand Down
Loading