Skip to content

Commit

Permalink
small fixes for template generation and preparation (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
McHaillet authored Feb 21, 2024
1 parent 0c920fa commit 1280814
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pytom_tm/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ def generate_template_from_map(
input_map = np.pad(
input_map,
tuple([(d // 2, d // 2 + d % 2) for d in diff]),
mode='edge'
mode='constant',
constant_values=0,
)

if filter_to_resolution is None:
Expand All @@ -79,7 +80,8 @@ def generate_template_from_map(
input_map = np.pad(
input_map,
(pad // 2, pad // 2 + pad % 2),
mode='edge'
mode='constant',
constant_values=0
)
elif output_box_size < (input_map.shape[0] * input_spacing) // output_spacing:
logging.warning('Could not set specified box size as the map would need to be cut and this might '
Expand Down
2 changes: 2 additions & 0 deletions src/pytom_tm/tmjob.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,8 @@ def start_job(
read_mrc(self.template),
read_mrc(self.mask)
)
# apply mask directly to prevent any wedge convolution with weird edges
template *= mask

# init tomogram and template weighting
tomo_filter, template_wedge = 1, 1
Expand Down

0 comments on commit 1280814

Please sign in to comment.