Skip to content

Commit

Permalink
fixing radial order accounting
Browse files Browse the repository at this point in the history
  • Loading branch information
gvarnavi committed Oct 20, 2023
1 parent f9ae5e1 commit 9806e27
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions py4DSTEM/process/phase/iterative_parallax.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
(1, 2): "stig ",
(2, 1): "coma ",
(2, 3): "trefoil ",
(3, 0): "Cs ",
(3, 0): "C3 ",
(3, 2): "stig2 ",
(3, 4): "quadfoil ",
(4, 1): "coma2 ",
Expand Down Expand Up @@ -155,7 +155,7 @@ def to_h5(self, group):
self.metadata = Metadata(
name="aberrations_metadata",
data={
v["common name"]: v["value [Ang]"]
v["aberration name"]: v["value [Ang]"]
for k, v in self.aberration_dict.items()
},
)
Expand Down Expand Up @@ -1294,7 +1294,7 @@ def aberration_fit(
fit_CTF_FFT: bool = False,
fit_aberrations_max_radial_order: int = 3,
fit_aberrations_max_angular_order: int = 4,
fit_aberrations_min_radial_order: int = 1,
fit_aberrations_min_radial_order: int = 2,
fit_aberrations_min_angular_order: int = 0,
fit_max_thon_rings: int = 6,
fit_power_alpha: float = 2.0,
Expand Down Expand Up @@ -1366,7 +1366,7 @@ def aberration_fit(
mn = []

for m in range(
fit_aberrations_min_radial_order, fit_aberrations_max_radial_order + 1
fit_aberrations_min_radial_order - 1, fit_aberrations_max_radial_order
):
n_max = np.minimum(fit_aberrations_max_angular_order, m + 1)
for n in range(fit_aberrations_min_angular_order, n_max + 1):
Expand Down Expand Up @@ -1741,7 +1741,7 @@ def score_CTF(coefs):

self.aberration_dict = {
tuple(self._aberrations_mn[a0]): {
"common name": _aberration_names.get(
"aberration name": _aberration_names.get(
tuple(self._aberrations_mn[a0, :2]), "-"
).strip(),
"value [Ang]": self._aberrations_coefs[a0],
Expand Down Expand Up @@ -1774,7 +1774,7 @@ def score_CTF(coefs):
print()
print("Refined Aberration coefficients")
print("-------------------------------")
print("common radial angular dir. coefs")
print("aberration radial angular dir. coefs")
print("name order order Ang ")
print("---------- ------- ------- ---- -----")

Expand All @@ -1785,15 +1785,15 @@ def score_CTF(coefs):
print(
name
+ " "
+ str(m)
+ str(m + 1)
+ " 0 - "
+ str(np.round(self._aberrations_coefs[a0]).astype("int"))
)
elif a == 0:
print(
name
+ " "
+ str(m)
+ str(m + 1)
+ " "
+ str(n)
+ " x "
Expand All @@ -1803,7 +1803,7 @@ def score_CTF(coefs):
print(
name
+ " "
+ str(m)
+ str(m + 1)
+ " "
+ str(n)
+ " y "
Expand Down
2 changes: 1 addition & 1 deletion py4DSTEM/process/phase/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,7 @@ def aberrations_basis_function(
# mn = [[0,0,0]]
mn = []

for m in range(1, max_radial_order + 1):
for m in range(1, max_radial_order):
n_max = np.minimum(max_angular_order, m + 1)
for n in range(0, n_max + 1):
if (m + n) % 2:
Expand Down

0 comments on commit 9806e27

Please sign in to comment.