Skip to content

Commit

Permalink
Fixed some datasets and simluation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewHerzing committed Mar 21, 2024
1 parent 1a76b35 commit 0ff5f47
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tomotools/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get_catalyst_tilt_series(
maxshift=5,
tiltshift=0,
tiltrotate=0,
xonly=False,
yonly=False,
noise=False,
noise_factor=0.2,
):
Expand Down Expand Up @@ -87,7 +87,7 @@ def get_catalyst_tilt_series(
max_shift=maxshift,
tilt_shift=tiltshift,
tilt_rotate=tiltrotate,
x_only=xonly,
y_only=yonly,
)
if noise:
catalyst = add_noise(catalyst, "gaussian", noise_factor)
Expand Down
2 changes: 1 addition & 1 deletion tomotools/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def misalign_stack(stack, min_shift=-5, max_shift=5, tilt_shift=0, tilt_rotate=0
Number of pixels by which to offset the tilt axis from the center
tilt_rotate : int
Amount of rotation to apply to the stack
x_only : bool
y_only : bool
If True, limit the application of jitter to the x-direction only.
Default is False
Expand Down
3 changes: 1 addition & 2 deletions tomotools/tests/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def test_get_noisy_simulated_series(self):
stack = ds.get_catalyst_tilt_series(noise=True)
assert type(stack) is tomotools.TomoStack

def test_get_noisy_misaligned_simulated_series(self, noise=True,
misalign=True):
def test_get_noisy_misaligned_simulated_series(self, noise=True, misalign=True):
stack = ds.get_catalyst_tilt_series()
assert type(stack) is tomotools.TomoStack
2 changes: 1 addition & 1 deletion tomotools/tests/test_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_misalign_stack_with_shift(self):
def test_misalign_stack_with_xonly(self):
model = sim.create_catalyst_model(0, volsize=[10, 10, 10])
stack = sim.create_model_tilt_series(model)
shifted = sim.misalign_stack(stack, x_only=True)
shifted = sim.misalign_stack(stack, y_only=True)
assert shifted.data.shape == (90, 10, 10)

def test_misalign_stack_with_rotation(self):
Expand Down

0 comments on commit 0ff5f47

Please sign in to comment.