Skip to content

Commit c2ad19e

Browse files
committed
cleanup
1 parent 9729fd5 commit c2ad19e

1 file changed

Lines changed: 4 additions & 21 deletions

File tree

src/aspire/abinitio/commonline_nug.py

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
class CommonlineNUG(Orient3D):
1919
"""
20-
Class to estimate 3D orientations using non-uqique games.
20+
Class to estimate 3D orientations using non-uqique games for molecules with cyclic
21+
or dihedral symmetry.
2122
"""
2223

2324
def __init__(
@@ -95,16 +96,12 @@ def _build_full_pft(self):
9596
pf = self.pf
9697
self.pf_full = PolarFT.half_to_full(pf)
9798

98-
# Prepare the shift phases to try and generate filter for common-line detection
99+
# Prepare the shift phases for common-line detection
99100
r_max = self.pf_full.shape[2]
100-
self.shifts, self.shift_phases, h = _generate_shift_phase_and_filter(
101+
self.shifts, self.shift_phases, _ = _generate_shift_phase_and_filter(
101102
r_max, self.max_shift, self.shift_step, self.dtype
102103
)
103104

104-
# Apply bandpass filter, normalize each ray of each image
105-
# Note that only use half of each ray
106-
# self.pf_full = self._apply_filter_and_norm("ijk, k -> ijk", pf_full, r_max, h)
107-
108105
def estimate_rotations(self):
109106
self.compute_coeff()
110107
self.perform_admm()
@@ -709,8 +706,6 @@ def ADMM_preprocessing(self, C):
709706
D1 = d1[-1]
710707

711708
# AE and bE for quaternion constraints
712-
# AEq = xp.asarray(loadmat("data/Eq_constraints/AEqJ.mat")["AEq"])
713-
# AEqAEqtinv = xp.asarray(loadmat("data/Eq_constraints/AEqJ.mat")["AEqAEqtinv"])
714709
AEq = xp.asarray(self.construct_AEq())
715710
AEqAEqtinv = xp.linalg.pinv(AEq @ AEq.T)
716711

@@ -721,16 +716,6 @@ def ADMM_preprocessing(self, C):
721716

722717
# AI and bI
723718
W0, W1, Ngrid = self.compute_fejer_weights()
724-
# AI_mat=np.zeros((Ngrid,D0+D1))
725-
# for p in range(Ngrid):
726-
# w0=np.zeros(D0); w1=np.zeros(D1)
727-
# for k in range(1,Lmax+1):
728-
# w0[d0[k-1]:d0[k]]=(Lmax-k+2)*(Lmax-k+1)*(k+0.5)*W0[k-1][p].T.reshape(-1)
729-
# w1[d1[k-1]:d1[k]]=(Lmax-k+2)*(Lmax-k+1)*(k+0.5)*W1[k-1][p].T.reshape(-1)
730-
# # this needs double checking
731-
# AI_mat[p,:d0[-1]]=w0; AI_mat[p,d0[-1]:]=w1
732-
# AI_mat=xp.asarray(AI_mat) / 10;
733-
# bI=-(Lmax+2)*(Lmax+1)/2 / 10
734719
AI_mat_offdiag = np.zeros((Ngrid, D0 + D1), dtype=np.float64)
735720
for p in range(Ngrid):
736721
w0 = np.zeros(D0, dtype=np.float64)
@@ -874,7 +859,6 @@ def permutek_block(Ak, k):
874859
return W0, W1, Ngrid
875860

876861
def discretize_SO3(self):
877-
# S2 = loadmat("design20.mat")["design"]
878862
S2 = saff_kuijlaars(self.S2_grid)
879863
S2_size = S2.shape[0]
880864

@@ -1354,7 +1338,6 @@ def largest_eigenvalue(AI, Ngrid, N):
13541338
z = AI @ (AI.T @ z)
13551339
Lambda += 2000
13561340
logger.info("Largest eigenvalue of AIAIT is approximately %1.2f" % Lambda)
1357-
# Lambda=xp.linalg.eigvalsh(AI@AI.T)[-1]; print(Lambda)
13581341
return Lambda
13591342

13601343
def compute_rank(self, Lmax):

0 commit comments

Comments
 (0)