Skip to content

Commit

Permalink
add finite check to star checker in g2d fit in reference_cleaning.py
Browse files Browse the repository at this point in the history
  • Loading branch information
emirkmo committed May 25, 2022
1 parent 5aebfeb commit a2b9c44
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flows/reference_cleaning.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ def force_reject_g2d(xarray, yarray, image: FlowsImage, rsq_min=0.5, radius=10,
curr_star /= np.nanmax(curr_star)

ypos, xpos = np.mgrid[:curr_star.shape[0], :curr_star.shape[1]]
gfit = gfitter(g2d, x=xpos, y=ypos, z=curr_star)
nan_filter = np.isfinite(curr_star) # This shouldn't be necessary if images are properly cleaned?
gfit = gfitter(g2d, x=xpos[nan_filter], y=ypos[nan_filter], z=curr_star[nan_filter])

# Center
xys[i] = np.array([gfit.x_mean + x - radius, gfit.y_mean + y - radius], dtype='float64')
Expand Down

0 comments on commit a2b9c44

Please sign in to comment.