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: 9 additions & 7 deletions src/murfey/server/feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -1115,12 +1115,12 @@ def _find_initial_model(visit: str, machine_config: MachineConfig) -> Path | Non


def _downscaled_box_size(
particle_diameter: int, pixel_size: float
particle_diameter_ang: float, pixel_size: float
) -> Tuple[int, float]:
particle_diameter = particle_diameter_ang / pixel_size
box_size = int(math.ceil(1.2 * particle_diameter))
box_size = box_size + box_size % 2
for small_box_pix in (
48,
64,
96,
128,
Expand All @@ -1145,9 +1145,9 @@ def _downscaled_box_size(
# Don't go larger than the original box
if small_box_pix > box_size:
return box_size, pixel_size
# If Nyquist freq. is better than 8.5 A, use this downscaled box, else step size
# If Nyquist freq. is better than 7.5 A, use this downscaled box, else step size
small_box_angpix = pixel_size * box_size / small_box_pix
if small_box_angpix < 4.25:
if small_box_angpix < 3.75:
return small_box_pix, small_box_angpix
raise ValueError(f"Box size is too large: {box_size}")

Expand All @@ -1161,9 +1161,9 @@ def _resize_intial_model(
env: Dict[str, str],
) -> None:
with mrcfile.open(input_path) as input_mrc:
input_size_x = input_mrc.nx
input_size_y = input_mrc.ny
input_size_z = input_mrc.nz
input_size_x = input_mrc.header.nx
input_size_y = input_mrc.header.ny
input_size_z = input_mrc.header.nz
if executables.get("clip") and not input_size_x == input_size_y == input_size_z:
# If the initial model is not a cube, do some padding
clip_proc = subprocess.run(
Expand Down Expand Up @@ -1198,6 +1198,8 @@ def _resize_intial_model(
str(downscaled_box_size),
"--rescale_angpix",
str(downscaled_pixel_size),
"--force_header_angpix",
str(downscaled_pixel_size),
"--o",
str(output_path),
],
Expand Down
Loading