Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions grex_t2/cluster_heimdall.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,7 @@ def filter_clustered(
logging.info(f"Filtering clusters from {len(tab)} to {len(tab_out)} candidates.")

return tab_out



def dump_cluster_results_json(
tab,
db_con: sqlite3.Connection,
Expand Down Expand Up @@ -344,7 +343,10 @@ def dump_cluster_results_json(
trigger_payload = {"candname": candname, "itime": int(itimes[imaxsnr])}

# Check to see if the max SNR candidate corresponds with an injection

isinjection = database.is_injection(mjd, db_con)
output_dict[candname]["isinjection"] = isinjection #Added_Priya

if isinjection:
logging.info("Candidate corresponds with injection, skipping trigger")

Expand All @@ -353,15 +355,15 @@ def dump_cluster_results_json(
logging.info(f"Writing trigger file for index {imaxsnr} with SNR={maxsnr}")
json.dump(output_dict, f, ensure_ascii=False, indent=4)

if trigger and not isinjection:
if trigger: #and not isinjection:
send_trigger(trigger_payload)

return row, candname, last_trigger_time

else:
logging.info(f"Not triggering on block with {len(tab)} candidates")
return None, lastname, last_trigger_time


def send_trigger(trigger_payload):
trigger_message = json.dumps(trigger_payload).encode("utf-8")
Expand Down