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
8 changes: 7 additions & 1 deletion src/aspire/abinitio/commonline_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import scipy.sparse as sparse

from aspire.operators import PolarFT
from aspire.utils import common_line_from_rots, fuzzy_mask
from aspire.utils import common_line_from_rots, fuzzy_mask, tqdm
from aspire.utils.random import choice

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -167,6 +167,10 @@ def build_clmatrix(self):
# Note that only use half of each ray
pf = self._apply_filter_and_norm("ijk, k -> ijk", pf, r_max, h)

# Setup a progress bar
_total_pairs_to_test = self.n_img * (self.n_check - 1) // 2
pbar = tqdm(desc="Searching over common line pairs", total=_total_pairs_to_test)

# Search for common lines between [i, j] pairs of images.
# Creating pf and building common lines are different to the Matlab version.
# The random selection is implemented.
Expand Down Expand Up @@ -211,6 +215,8 @@ def build_clmatrix(self):
clmatrix[j, i] = cl2
cl_dist[i, j] = sval
shifts_1d[i, j] = shifts[shift]
pbar.update()
pbar.close()

self.clmatrix = clmatrix
self.shifts_1d = shifts_1d
Expand Down
2 changes: 1 addition & 1 deletion src/aspire/reconstruction/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(

self.src = src
if basis is None:
logger.info("{self.__class__.__name__} instantiating default basis.")
logger.info(f"{self.__class__.__name__} instantiating default basis.")
basis = FFBBasis3D(src.L, dtype=src.dtype)
self.basis = basis
self.dtype = self.src.dtype
Expand Down