Skip to content

Commit

Permalink
add test for tophat filer extraction and plotting
Browse files Browse the repository at this point in the history
  • Loading branch information
sroet committed Aug 23, 2024
1 parent 8bbf93e commit 1595a35
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion tests/test_tmjob.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ def test_tm_job_half_precision(self):
self.assertEqual(s.dtype, np.float16)
self.assertEqual(a.dtype, np.float32)

def test_extraction(self):
def test_extractions(self):
_ = self.job.start_job(0, return_volumes=True)

# extract particles after running the job
Expand Down Expand Up @@ -755,6 +755,23 @@ def test_extraction(self):
create_plot=False,
)

# Test exraction with tophat filter and plotting
df, scores = extract_particles(
job,
5,
100,
tomogram_mask_path=TEST_EXTRACTION_MASK_INSIDE,
create_plot=True,
tophat_filter=True,
)
self.assertNotEqual(
len(scores),
0,
msg="We expected a detected particle with a extraction mask that "
"covers the object.",
)
# We don't look for the plots, they might be skipped if no plotting is available

def test_get_defocus_offsets(self):
tilt_angles = list(range(-51, 54, 3))
x_offset_um = 200 * 13.79 * 1e-4
Expand Down

0 comments on commit 1595a35

Please sign in to comment.