Skip to content

Commit

Permalink
FIX
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalkowalewski1 committed Jul 8, 2024
1 parent 82ff81c commit e5afd2b
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions picasso/aim.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,12 @@ def intersection_max(
x1 = x[min_frame_idx & max_frame_idx]
y1 = y[min_frame_idx & max_frame_idx]

# skip if no reference localizations
if len(x1) == 0:
drift_x[s] = drift_x[s-1]
drift_y[s] = drift_y[s-1]
continue

# undrifting from the previous round
x1 += rel_drift_x
y1 += rel_drift_y
Expand Down Expand Up @@ -552,6 +558,11 @@ def intersection_max_z(
y1 = y[min_frame_idx & max_frame_idx]
z1 = z[min_frame_idx & max_frame_idx]

# skip if no reference localizations
if len(x1) == 0:
drift_z[s] = drift_z[s-1]
continue

# undrifting from the previous round
z1 += rel_drift_z

Expand Down Expand Up @@ -664,9 +675,9 @@ def aim(
drift_x = drift_x1 + drift_x2
drift_y = drift_y1 + drift_y2

# # shift the drifts by the mean value (like in Picasso)
# drift_x -= _np.mean(drift_x)
# drift_y -= _np.mean(drift_y)
# # shift the drifts by the mean value
drift_x -= _np.mean(drift_x)
drift_y -= _np.mean(drift_y)

# combine to Picasso format
drift = _np.rec.array((drift_x, drift_y), dtype=[("x", "f"), ("y", "f")])
Expand Down

0 comments on commit e5afd2b

Please sign in to comment.