Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
8678291
fixup log and pbar for ctf est
garrettwrong Oct 1, 2026
fb9fe12
debugging, reconcile outputs with MATLAB
garrettwrong Oct 8, 2026
1604b8f
move gd iters to an input parameter
garrettwrong Oct 8, 2026
cf206f5
split up elliptical average
garrettwrong Oct 8, 2026
01d7045
cleanup some of the easier TODO items
garrettwrong Oct 9, 2026
24ae4dd
initial migration ctf est algo to estimate method
garrettwrong Oct 12, 2026
e217d18
begin cleanup image savig
garrettwrong Oct 12, 2026
3c82ce4
continue cleanup rounds
garrettwrong Oct 12, 2026
c57e99c
remove redundant taper transpose
garrettwrong Oct 12, 2026
26356d4
cleanup pca code/call
garrettwrong Oct 12, 2026
99689ad
temp timer line
garrettwrong Oct 12, 2026
c55fea1
migrate the taper application to GPU
garrettwrong Oct 12, 2026
f0fdd7c
initial replace ctf_formula
garrettwrong Oct 13, 2026
7633342
continue replacing formula and fixing plots
garrettwrong Oct 13, 2026
3d7fe31
continue ctf est code cleanup
garrettwrong Oct 14, 2026
3ff9a9d
cleanup path searching, attempt to make recursive
garrettwrong Oct 14, 2026
e9db829
optimize background fill, improve filepath handing
garrettwrong Oct 14, 2026
bdf585d
fixup low_freq_cutoff
garrettwrong Oct 14, 2026
b5ca44f
add optimized gd
garrettwrong Oct 14, 2026
f3436e7
update ctf cli opts
garrettwrong Oct 14, 2026
951ed1b
continue arg cleanup
garrettwrong Oct 15, 2026
547194c
rm stray todos in legacy code
garrettwrong Oct 15, 2026
cc59c87
extend to additional basis and more arg work
garrettwrong Oct 15, 2026
5951e6c
initial add bfgs
garrettwrong Oct 16, 2026
a82470a
continue cleanup
garrettwrong Oct 16, 2026
132e707
skip long/hi-mem ctf tests
garrettwrong Oct 16, 2026
fe82ea1
fixup scalar,0d,1d arg handling
garrettwrong Oct 16, 2026
999cc5a
fixup path key for gallery
garrettwrong Oct 19, 2026
d79b4d6
more flexible arg handling
garrettwrong Oct 19, 2026
a1a3a2a
add option handling
garrettwrong Oct 19, 2026
08afcd4
optimize estimated psd
garrettwrong Oct 19, 2026
31a3663
optimized opt1d stats/correlation compute
garrettwrong Oct 19, 2026
d478da8
expose opt1d loop to class and cli
garrettwrong Oct 20, 2026
3721f3f
remove profiler lines
garrettwrong Oct 20, 2026
d66b41c
more stable with 4 tapers
garrettwrong Oct 20, 2026
01f53db
fix argname typo in cli
garrettwrong Oct 20, 2026
65b4cee
handle failure to find soln and improve linprog call:
garrettwrong Oct 20, 2026
af31621
default for psd_size
garrettwrong Oct 20, 2026
1f6524e
improve numerical stability by fixing basis artifacts
garrettwrong Oct 21, 2026
7a97395
less redundant name in starfiles
garrettwrong Oct 21, 2026
43a7017
fix ast angle tranpose issue (blocks.T) and cleanup some strings
garrettwrong Oct 22, 2026
5729178
optimize preproc micrograph and rm legacy implementation
garrettwrong Oct 22, 2026
6311a50
review string and arg cleanup
garrettwrong Oct 26, 2026
3da7678
fix the implicitly hardcoded 10 step size
garrettwrong Oct 26, 2026
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
2 changes: 1 addition & 1 deletion gallery/tutorials/tutorials/ctf.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def generate_example_image(L, noise_variance=0.1):
amplitude_contrast=radial_ctf_filter.alpha,
voltage=radial_ctf_filter.voltage,
psd_size=512,
num_tapers=2,
num_tapers=4,
dtype=np.float64,
)

Expand Down
64 changes: 51 additions & 13 deletions src/aspire/commands/estimate_ctf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
)
@click.option(
"--num_tapers",
default=2,
default=4,
type=int,
help="Number of tapers to apply in PSD estimation",
)
@click.option(
"--psd_size",
default=512,
default=1024,
type=int,
help="Size of blocks for use in Power Spectrum estimation",
)
Expand All @@ -47,6 +47,21 @@
@click.option(
"--g_max", default=5, type=float, help="Inverse of maximum resolution for PSD"
)
@click.option(
"--min_defocus",
default=5000,
type=int,
help="Start of defocus loop scan (Angstrom).",
)
@click.option(
"--max_defocus",
default=100000,
type=int,
help="End of defocus loop scan (Angstrom).",
)
@click.option(
"--step_defocus", default=10, type=int, help="Step of defocus loop scan (Angstrom)."
)
@click.option(
"--dtype",
default="float32",
Expand All @@ -57,6 +72,15 @@
default="results",
help="Path to output files, defaults to './results'",
)
@click.option(
"--save_ctf_images", is_flag=True, default=False, help="Save ctf diagnostic images."
)
@click.option(
"--save_noise_images",
is_flag=True,
default=False,
help="Save noise diagnostic images.",
)
@log_level_option
def estimate_ctf(
data_folder,
Expand All @@ -68,31 +92,45 @@ def estimate_ctf(
psd_size,
g_min,
g_max,
min_defocus,
max_defocus,
step_defocus,
output_dir,
dtype,
save_ctf_images,
save_noise_images,
loglevel,
):
"""
Given parameters estimates CTF from experimental data
and returns CTF as a mrc file.

This is a Click command line interface wrapper for
the aspire.ctf module.
the aspire.ctf.CtfEstimator.

Note not every option to `CtfEstimator` is exposed via CLI. Users
may want to consider calling `estimate_ctf` directly for advanced
applications. The CLI is provided convenient general use.
"""

# Set desired logging option for the command line
setConsoleLoggingLevel(loglevel)

return ctf.estimate_ctf(
data_folder,
pixel_size,
cs,
amplitude_contrast,
voltage,
num_tapers,
psd_size,
g_min,
g_max,
output_dir,
dtype,
pixel_size=pixel_size,
cs=cs,
amplitude_contrast=amplitude_contrast,
voltage=voltage,
num_tapers=num_tapers,
psd_size=psd_size,
g_min=g_min,
g_max=g_max,
min_defocus=min_defocus,
max_defocus=max_defocus,
step_defocus=step_defocus,
output_dir=output_dir,
dtype=dtype,
save_ctf_images=save_ctf_images,
save_noise_images=save_noise_images,
)
Loading
Loading