Skip to content
Merged
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
16 changes: 12 additions & 4 deletions src/aspire/source/micrograph.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,18 @@ def __init__(
f" {acceptable_lens[1]}, or {acceptable_lens[2]}."
)

# Generate explicit filter indices (zero-indexed).
self.filter_indices = np.arange(self.total_particle_count) % len(
ctf_filters
)
# Generate explicit total_particle_count filter_indices
# Note these indices are zero-indexed.
if len(ctf_filters) == self.micrograph_count:
# creates mapping [0,0,0..., 1,1,1,... ,micrograph_count-1]
self.filter_indices = np.repeat(
np.arange(self.micrograph_count, dtype=int),
self.particles_per_micrograph,
)
elif len(ctf_filters) == self.total_particle_count:
self.filter_indices = np.arange(self.total_particle_count, dtype=int)
elif len(ctf_filters) == 1:
self.filter_indices = np.zeros(self.total_particle_count, dtype=int)

self.ctf_filters = ctf_filters

Expand Down
Loading