Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
juanep97 committed Nov 21, 2024
1 parent 31e6dc0 commit 7e76463
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions iop4lib/instruments/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,12 +545,13 @@ def compute_aperture_photometry(cls, redf, aperpix, r_in, r_out):

# correct position using centroid
# choose a box size that is somewhat larger than the aperture
# in case of pairs, choose a box size that is somewhat smaller than the distance between pairs
# in case of pairs, cap box size that is somewhat smaller than the distance between pairs

box_size = math.ceil(1.6 * aperpix)//2 * 2 + 1

if redf.has_pairs:
box_size = (math.ceil(np.linalg.norm(Instrument.by_name(redf.instrument).disp_sign_mean))//2 * 2 - 1)
_box_size_max = math.ceil(np.linalg.norm(Instrument.by_name(redf.instrument).disp_sign_mean))//2 * 2 - 1
box_size = min(box_size, _box_size_max)

centroid_px_pos = centroid_sources(img, xpos=wcs_px_pos[0], ypos=wcs_px_pos[1], box_size=box_size, centroid_func=centroid_2dg)
centroid_px_pos = (centroid_px_pos[0][0], centroid_px_pos[1][0])
Expand Down

0 comments on commit 7e76463

Please sign in to comment.