Skip to content

Commit

Permalink
Don't bring in overlap in optimization attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanconn committed Mar 4, 2024
1 parent f7288b6 commit 96a0d4d
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions proseco/acq.py
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,32 @@ def optimize_catalog(self, verbose=False):

idx = self.get_id_idx(acqs_id_ok[idx_worst])

# Does the candidate overlap with any of the selected stars (except
# the worst one?
if os.environ.get("PROSECO_ACQ_OVERLAP_PENALTY") == "True":
has_overlap = False
for selected_id in acqs_id_ok:
if selected_id == acqs_id_ok[idx_worst]:
continue
selected_star = self.get_id(selected_id)
if box_overlap(
cand_acq["yang"],
cand_acq["zang"],
180,
selected_star["yang"],
selected_star["zang"],
180,
):
has_overlap = True
break

if has_overlap:
self.log(
f"Skipping candidate {cand_id} due to overlap with already selected star",
id=cand_id,
)
continue

self.log(
"Trying to use {} mag={:.2f} to replace idx={} with p_acq={:.3f}".format(
cand_id, cand_acq["mag"], idx, p_acqs[idx_worst]
Expand Down

0 comments on commit 96a0d4d

Please sign in to comment.