Skip to content

Commit

Permalink
Shifts for subparticles are reverted
Browse files Browse the repository at this point in the history
  • Loading branch information
Abrishami Vahid committed Mar 12, 2019
1 parent 805553b commit afc1d4b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
11 changes: 6 additions & 5 deletions lib/localrec/localized_reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def angles_to_degrees(particle):
def create_subparticles(particle, symmetry_matrices, subparticle_vector_list,
part_image_size, randomize, output,
unique, subparticles_total, align_subparticles,
subtract_masked_map, do_create_star, filters):
subtract_masked_map, do_create_star, filters, ang_pix):
""" Obtain all subparticles from a given particle and set
the properties of each such subparticle. """

Expand Down Expand Up @@ -189,17 +189,18 @@ def create_subparticles(particle, symmetry_matrices, subparticle_vector_list,

# modify the subparticle defocus paramaters by its z location
if hasattr(particle, 'rlnDefocusU'):
subpart.rlnDefocusU = particle.rlnDefocusU + z
subpart.rlnDefocusV = particle.rlnDefocusV + z
z_ang = ang_pix * z
subpart.rlnDefocusU = particle.rlnDefocusU + z_ang
subpart.rlnDefocusV = particle.rlnDefocusV + z_ang

# save the subparticle coordinates (integer part) relative to the
# user given image size and as a small shift in the origin (decimal part)
x_d, x_i = math.modf(x)
y_d, y_i = math.modf(y)
subpart.rlnCoordinateX = int(part_image_size / 2) - x_i
subpart.rlnCoordinateY = int(part_image_size / 2) - y_i
subpart.rlnOriginX = -x_d
subpart.rlnOriginY = -y_d
subpart.rlnOriginX = x_d
subpart.rlnOriginY = y_d

overlaps = (unique >= 0 and
not filter_unique(subparticles, subpart, unique))
Expand Down
3 changes: 2 additions & 1 deletion relion_localized_reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ def main(self):
args.align_subparticles,
args.masked_map,
True,
filters)
filters,
args.angpix)

mdOut.addData(subparticles)
mdOutSub.addData(subtracted)
Expand Down

0 comments on commit afc1d4b

Please sign in to comment.