From 171ba753e258d7111216853879d9cb41eba5abc0 Mon Sep 17 00:00:00 2001 From: jessiethw Date: Tue, 24 Jun 2025 15:06:41 -0500 Subject: [PATCH 01/13] fix slack poster docs --- doc/source/slack.rst | 2 +- fast_response/slack_posters/slack.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/source/slack.rst b/doc/source/slack.rst index 52c6fad..df81c67 100644 --- a/doc/source/slack.rst +++ b/doc/source/slack.rst @@ -5,5 +5,5 @@ Slack Posters slackbot class -------------------------------- -.. autoclass:: fast_response.slack_posters.slack +.. autoclass:: fast_response.slack_posters.slack.slackbot :members: diff --git a/fast_response/slack_posters/slack.py b/fast_response/slack_posters/slack.py index 0c8425d..59f858d 100644 --- a/fast_response/slack_posters/slack.py +++ b/fast_response/slack_posters/slack.py @@ -15,7 +15,7 @@ class slackbot(object): Parameters ---------- channel: str - Channel name to use in message + Channel name to post message """ def __init__(self, channel_name): @@ -33,8 +33,8 @@ def get_chan_id(self, channel_name): Parameters ---------- - channel: str - Channel name + channel_name: str + Name of the channel to send to """ chan_ids={} From 0663f34dc690592eaccd23bb2ff360c297ccd60b Mon Sep 17 00:00:00 2001 From: jessiethw Date: Wed, 2 Jul 2025 12:01:26 -0500 Subject: [PATCH 02/13] correct which events show on recent page --- fast_response/MonitoringAndMocks/Data_Display.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fast_response/MonitoringAndMocks/Data_Display.py b/fast_response/MonitoringAndMocks/Data_Display.py index 037d60b..230fb96 100644 --- a/fast_response/MonitoringAndMocks/Data_Display.py +++ b/fast_response/MonitoringAndMocks/Data_Display.py @@ -317,11 +317,11 @@ def find_ts(i, ts_list): ax.text(-0.1, 15, "Page Last Updated: {} UTC".format(now)) plt.savefig('/home/mromfoe/public_html/O4_followup_monitoring/Update_Time.png') -df = pd.DataFrame({"Name": ed["Name"][-15::-1], - "Merger Time": ed["Trigger_Time"][-15::-1], - "GCN Alert": ed["GCN_Alert"][-15::-1], - "Script Finishes": ed["End_Time"][-15::-1], - "Total Latency in Seconds": ed["Total_Latency"][-15::-1]}) +df = pd.DataFrame({"Name": ed["Name"][:15], + "Merger Time": ed["Trigger_Time"][:15], + "GCN Alert": ed["GCN_Alert"][:15], + "Script Finishes": ed["End_Time"][:15], + "Total Latency in Seconds": ed["Total_Latency"][:15]}) html1 = df.to_html() text_file1 = open("/home/mromfoe/public_html/O4_followup_monitoring/Recent_Runs.html", "w") From 9bf5fb7bdf4fbe499b3b3c9cd26f46caab2ff761 Mon Sep 17 00:00:00 2001 From: jessiethw Date: Thu, 3 Jul 2025 13:16:56 -0500 Subject: [PATCH 03/13] label mjd on coinc events and number of trials on tsd --- fast_response/FastResponseAnalysis.py | 2 +- fast_response/reports/ReportGenerator.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fast_response/FastResponseAnalysis.py b/fast_response/FastResponseAnalysis.py index 2d0736f..bbe5fb1 100644 --- a/fast_response/FastResponseAnalysis.py +++ b/fast_response/FastResponseAnalysis.py @@ -415,7 +415,7 @@ def plot_tsd(self, allow_neg=False): bins = np.linspace(0., 25., 30) plt.hist(self.tsd, bins= bins, - label="Background Scrambles", density=True) + label="{} Background Scrambles".format(len(self.tsd)), density=True) if self.ts >= -500.: plt.axvline(self.ts, color = 'k', label = "Observed TS") else: diff --git a/fast_response/reports/ReportGenerator.py b/fast_response/reports/ReportGenerator.py index 3174eea..7244e6a 100644 --- a/fast_response/reports/ReportGenerator.py +++ b/fast_response/reports/ReportGenerator.py @@ -231,7 +231,7 @@ def make_coinc_events_table(self, f): for event in self.analysis.coincident_events: event_table+=[ ("Run:Event",'{}:{}'.format(event['run'], event['event'])), - ("Time","{}".format( + ("Time (MJD)","{}".format( event['time'])), (r'$\alpha$, $\delta$',"{:3.2f}\degree, {:+3.2f}\degree" .format(np.rad2deg(event['ra']), np.rad2deg(event['dec']))), From 9adeb5fa02036637296150ef6f07568993ec55c6 Mon Sep 17 00:00:00 2001 From: jessiethw Date: Tue, 8 Jul 2025 13:00:48 -0500 Subject: [PATCH 04/13] move who to call to call script --- fast_response/MonitoringAndMocks/Data_Display.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fast_response/MonitoringAndMocks/Data_Display.py b/fast_response/MonitoringAndMocks/Data_Display.py index 230fb96..ae3e52b 100644 --- a/fast_response/MonitoringAndMocks/Data_Display.py +++ b/fast_response/MonitoringAndMocks/Data_Display.py @@ -16,10 +16,9 @@ import subprocess, warnings warnings.filterwarnings('ignore', module='astropy._erfa') -def dial_up(who="jessie"): +def dial_up(): cell_tower = "/home/jthwaites/private/" - # subprocess.call([cell_tower+"make_call.py", f"--{who}=True", '--troubleshoot=True']) - print('Calld') + subprocess.call([cell_tower+"make_call.py", '--troubleshoot=True']) path = os.environ.get('FAST_RESPONSE_OUTPUT') out_put = '/data/user/jthwaites/o4-mocks/' From 21f54128dfa80eb8835308ab816984a2150ba7e1 Mon Sep 17 00:00:00 2001 From: jessiethw Date: Wed, 9 Jul 2025 11:32:29 -0500 Subject: [PATCH 05/13] Always add the pval in 1000s case --- fast_response/AlertFollowup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fast_response/AlertFollowup.py b/fast_response/AlertFollowup.py index 7921e89..5134f7b 100644 --- a/fast_response/AlertFollowup.py +++ b/fast_response/AlertFollowup.py @@ -176,7 +176,7 @@ def write_circular(self, alert_results): ev_is_are = 'event is' if len(analysis_1000['coincident_events']) == 1 else 'events are' if not high_sig: if len(analysis_1000['coincident_events']) == 0: - coinc_and_p = '' + coinc_and_p = 'We report a p-value of {:.2f} in this time window. '.format(analysis_1000['p']) elif len(analysis_1000['coincident_events']) == 1: coinc_and_p = 'We find that this additional event is well described by atmospheric\n' \ + 'background expectations, with a p-value of {:.2f}. '.format(analysis_1000['p']) @@ -190,12 +190,12 @@ def write_circular(self, alert_results): coinc_and_p = 'We accordingly derive a p-value of {:.3f}.'.format(analysis_1000['p']) if analysis_1000['p'] < 0.01: coinc_and_p = coinc_and_p + ' Due to the coincidences identified in this search, ' \ - + 'we strongly encourage followup observations.' + + 'we strongly encourage followup observations. ' else: pass if analysis_2day['p'] < 0.01: long_p_and_lim = 'In this case, we report a p-value of {:.3f}.'.format(analysis_2day['p']) \ - + ' Due to the coincidences identified in this search, we strongly encourage followup observations.' + + ' Due to the coincidences identified in this search, we strongly encourage followup observations. ' else: long_p_and_lim = 'In this case, we report a p-value of {:.2f},'.format(analysis_2day['p']) \ + ' consistent with no significant \nexcess of track events. ' From babc9f052f037de7600459ac7735ac447a623697 Mon Sep 17 00:00:00 2001 From: jessiethw Date: Thu, 17 Jul 2025 14:39:08 -0500 Subject: [PATCH 06/13] use 2000 and fix axis --- fast_response/MonitoringAndMocks/Data_Display.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fast_response/MonitoringAndMocks/Data_Display.py b/fast_response/MonitoringAndMocks/Data_Display.py index ae3e52b..1d54e29 100644 --- a/fast_response/MonitoringAndMocks/Data_Display.py +++ b/fast_response/MonitoringAndMocks/Data_Display.py @@ -24,7 +24,7 @@ def dial_up(): out_put = '/data/user/jthwaites/o4-mocks/' #Creating readable (and callable) files from ALL pickle files previously created in gw_gcn_listener -mock_files = sorted(glob.glob(path+'/PickledMocks/*MS*.pickle'), reverse=True)[:1000] +mock_files = sorted(glob.glob(path+'/PickledMocks/*MS*.pickle'), reverse=True)[:2000] def sort_mocks(mock_files): event_dict = pd.DataFrame({"Trigger_Time": [], "GCN_Alert": [], "End_Time": [], @@ -159,7 +159,7 @@ def find_ts(i, ts_list): ax.plot_date(unique_days, initial, color = 'orange') now = datetime.now(timezone.utc) -past = now + relativedelta(months=-2) +past = now + relativedelta(months=-1) ax.set_xlim(past, now) ax.fmt_xdata = DateFormatter('%Y-%m-%d %H:%M:%S') From 80933f166a065535b02788ad163db32973b56315 Mon Sep 17 00:00:00 2001 From: jessiethw Date: Fri, 18 Jul 2025 16:08:06 -0500 Subject: [PATCH 07/13] pdf docs not building properly, remove for now --- .readthedocs.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 728e4f9..2933bad 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -21,5 +21,5 @@ sphinx: configuration: doc/source/conf.py fail_on_warning: true -formats: - - pdf \ No newline at end of file +#formats: +# - pdf From 970da6b6b835119a812dea8a7cf7c6dfdf58e646 Mon Sep 17 00:00:00 2001 From: jessiethw Date: Fri, 18 Jul 2025 16:08:36 -0500 Subject: [PATCH 08/13] fix legend labels --- fast_response/MonitoringAndMocks/Data_Display.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fast_response/MonitoringAndMocks/Data_Display.py b/fast_response/MonitoringAndMocks/Data_Display.py index 1d54e29..5b67f6c 100644 --- a/fast_response/MonitoringAndMocks/Data_Display.py +++ b/fast_response/MonitoringAndMocks/Data_Display.py @@ -390,8 +390,8 @@ def make_bg_pval_dist(fontsize=15, lower_y_bound=-3.5, load_all=False): #uniform_bins=np.logspace(lower_y_bound,0.,int(abs(lower_y_bound*7))+1) #evenly spaced bins in logspace #plt.step(uniform_bins[1:], np.diff(uniform_bins), label = 'Uniform p-value expectation', lw = 3.) plt.step(p_x_vals[1:], np.diff(p_x_vals), label = 'Uniform p-value distribution', lw = 3.) - plt.plot([0.1,0.1], [10**lower_y_bound, 1e0],linestyle='dotted', label=f'{lt_10per*100.:.2f} \% of p-values $<$ 0.1') - plt.plot([0.01, 0.01], [10**lower_y_bound, 1e0], linestyle='dashed',label=f'{lt_1per*100.:.2f} \% of p-values $<$ 0.01') + plt.plot([0.1,0.1], [10**lower_y_bound, 1e0],linestyle='dotted', label=f'{lt_10per*100.:.2f}% of p-values $<$ 0.1') + plt.plot([0.01, 0.01], [10**lower_y_bound, 1e0], linestyle='dashed',label=f'{lt_1per*100.:.2f}% of p-values $<$ 0.01') plt.xscale('log') plt.yscale('log') From 804d21d8cf5f9160cd264479185ff4ae0e24f6ca Mon Sep 17 00:00:00 2001 From: jessiethw Date: Mon, 15 Sep 2025 08:38:10 -0500 Subject: [PATCH 09/13] add ev name to slack poster for troubleshooting --- fast_response/listeners/gw_gcn_listener.py | 2 +- fast_response/scripts/combine_results_kafka.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/fast_response/listeners/gw_gcn_listener.py b/fast_response/listeners/gw_gcn_listener.py index 4e80ec3..8692431 100755 --- a/fast_response/listeners/gw_gcn_listener.py +++ b/fast_response/listeners/gw_gcn_listener.py @@ -78,7 +78,7 @@ def process_gcn(payload, root): if root.attrib['role']=='observation' and not mock: ## Call everyone because it's a real event! - call_command=['/home/jthwaites/private/make_call.py'] + call_command=['/home/jthwaites/private/make_call.py', f'--name={name}'] call_args = ['--justin'] for arg in call_args: diff --git a/fast_response/scripts/combine_results_kafka.py b/fast_response/scripts/combine_results_kafka.py index f28d35c..ad42e75 100644 --- a/fast_response/scripts/combine_results_kafka.py +++ b/fast_response/scripts/combine_results_kafka.py @@ -293,7 +293,8 @@ def parse_notice(record, wait_for_llama=False, heartbeat=False): if record.attrib['role']=='observation' and not heartbeat: try: subprocess.call(['/home/jthwaites/private/make_call.py', - '--troubleshoot_gcn=True', '--missing_llama=True']) + '--troubleshoot_gcn=True', '--missing_llama=True', + f'--name={name}']) except: logger.warning('Failed to send alert to shifters: Issue finding LLAMA results. ') if llama_results_finished: @@ -302,7 +303,8 @@ def parse_notice(record, wait_for_llama=False, heartbeat=False): if record.attrib['role']=='observation' and not heartbeat: try: subprocess.call(['/home/jthwaites/private/make_call.py', - '--troubleshoot_gcn=True', '--missing_uml=True']) + '--troubleshoot_gcn=True', '--missing_uml=True', + f'--name={name}']) except: logger.warning('Failed to send alert to shifters: Issue finding UML results. ') else: @@ -311,7 +313,8 @@ def parse_notice(record, wait_for_llama=False, heartbeat=False): if record.attrib['role']=='observation' and not heartbeat: err_msg = ['/home/jthwaites/private/make_call.py', '--troubleshoot_gcn=True', - '--missing_llama=True'] + '--missing_llama=True', + f'--name={name}'] if not subthreshold: err_msg.append('--missing_uml=True') try: From 13c995f1ce21afc4a9e418e23255f4b0b920d1dd Mon Sep 17 00:00:00 2001 From: Alicia Mand Date: Tue, 16 Sep 2025 10:36:32 -0500 Subject: [PATCH 10/13] updated templates with more clear message --- fast_response/circular_templates/gw_gcn_template_low.txt | 8 ++++---- fast_response/circular_templates/internal_followup.txt | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fast_response/circular_templates/gw_gcn_template_low.txt b/fast_response/circular_templates/gw_gcn_template_low.txt index 5cbf754..e4975cb 100644 --- a/fast_response/circular_templates/gw_gcn_template_low.txt +++ b/fast_response/circular_templates/gw_gcn_template_low.txt @@ -12,10 +12,10 @@ During this time period IceCube was collecting good quality data. No significant track-like events are found in spatial coincidence of calculated from the map circulated in the notice. -IceCube's sensitivity assuming an E^-2 spectrum (E^2 dN/dE) to neutrino -point sources within the locations spanned by the 90% spatial containment -of ranges from to GeV cm^-2 in a 1000 second -time window. +IceCube’s sensitivity to neutrino point sources with an E^-2 spectrum, +expressed as E^2 dN/dE evaluated at 1 TeV, ranges from to GeV cm^-2 +within the 90% spatial containment region of in a 1000 second +time window. The IceCube Neutrino Observatory is a cubic-kilometer neutrino detector operating at the geographic South Pole, Antarctica. The IceCube realtime diff --git a/fast_response/circular_templates/internal_followup.txt b/fast_response/circular_templates/internal_followup.txt index 8441c0c..bc51313 100644 --- a/fast_response/circular_templates/internal_followup.txt +++ b/fast_response/circular_templates/internal_followup.txt @@ -4,14 +4,14 @@ The IceCube Collaboration (http://icecube.wisc.edu/) reports: IceCube has performed a search [1] for additional track-like muon neutrino events arriving from the direction of () in a time range of 1000 seconds centered on the alert event time ( UTC to UTC) during which IceCube was collecting good quality data. Excluding the event -that prompted the alert, track-like found within the 90% containment region of . -The IceCube sensitivity to neutrino point sources with an E^-2.5 spectrum (E^2 dN/dE at 1 TeV) within the locations spanned by the 90% spatial containment region of GeV cm^-2 in a 1000 second +that prompted the alert, track-like found within the 90% containment region of . +IceCube’s sensitivity to neutrino point sources with an E^-2.5 spectrum, expressed as E^2 dN/dE evaluated at 1 TeV, ranges from GeV cm^-2 within the 90% spatial containment region of in a 1000 second time window. 90% of events IceCube would detect from a source at this declination with an E^-2.5 spectrum have energies in the approximate energy range between GeV and GeV. A subsequent search was performed including 2 days of data centered on the alert event time ( UTC to UTC). - The IceCube sensitivity to neutrino point sources with an E^-2.5 spectrum (E^2 dN/dE at 1 TeV) within the locations spanned by the 90% -spatial containment region of GeV cm^-2 in a 2 day time window. + IceCube’s sensitivity to neutrino point sources with an E^-2.5 spectrum, expressed as E^2 dN/dE evaluated at 1 TeV, ranges from GeV cm^-2 within the 90% spatial containment region of in a 2 day +time window. The IceCube Neutrino Observatory is a cubic-kilometer neutrino detector operating at the geographic South Pole, Antarctica. The IceCube realtime alert point of contact can be reached at roc@icecube.wisc.edu. From cc3bdf771eeb094ebb6fe80dcc5388872196d406 Mon Sep 17 00:00:00 2001 From: Alicia Mand Date: Tue, 16 Sep 2025 11:27:18 -0500 Subject: [PATCH 11/13] removed "ranges from" language which is already autogenerated --- fast_response/circular_templates/internal_followup.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fast_response/circular_templates/internal_followup.txt b/fast_response/circular_templates/internal_followup.txt index bc51313..2b4adb8 100644 --- a/fast_response/circular_templates/internal_followup.txt +++ b/fast_response/circular_templates/internal_followup.txt @@ -5,12 +5,12 @@ The IceCube Collaboration (http://icecube.wisc.edu/) reports: IceCube has performed a search [1] for additional track-like muon neutrino events arriving from the direction of () in a time range of 1000 seconds centered on the alert event time ( UTC to UTC) during which IceCube was collecting good quality data. Excluding the event that prompted the alert, track-like found within the 90% containment region of . -IceCube’s sensitivity to neutrino point sources with an E^-2.5 spectrum, expressed as E^2 dN/dE evaluated at 1 TeV, ranges from GeV cm^-2 within the 90% spatial containment region of in a 1000 second +IceCube’s sensitivity to neutrino point sources with an E^-2.5 spectrum, expressed as E^2 dN/dE evaluated at 1 TeV, GeV cm^-2 within the 90% spatial containment region of in a 1000 second time window. 90% of events IceCube would detect from a source at this declination with an E^-2.5 spectrum have energies in the approximate energy range between GeV and GeV. A subsequent search was performed including 2 days of data centered on the alert event time ( UTC to UTC). - IceCube’s sensitivity to neutrino point sources with an E^-2.5 spectrum, expressed as E^2 dN/dE evaluated at 1 TeV, ranges from GeV cm^-2 within the 90% spatial containment region of in a 2 day + IceCube’s sensitivity to neutrino point sources with an E^-2.5 spectrum, expressed as E^2 dN/dE evaluated at 1 TeV, GeV cm^-2 within the 90% spatial containment region of in a 2 day time window. The IceCube Neutrino Observatory is a cubic-kilometer neutrino detector operating at the geographic South Pole, Antarctica. The IceCube realtime alert point of contact can From 75e6ad82fba6191e12656eeabc728ef2fa1aeb8b Mon Sep 17 00:00:00 2001 From: jessiethw Date: Mon, 22 Sep 2025 08:10:39 -0500 Subject: [PATCH 12/13] add per ev pval statement to template --- fast_response/GWFollowup.py | 3 +-- fast_response/circular_templates/gw_gcn_template_high.txt | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fast_response/GWFollowup.py b/fast_response/GWFollowup.py index 607cbbc..e5f03cc 100644 --- a/fast_response/GWFollowup.py +++ b/fast_response/GWFollowup.py @@ -405,8 +405,7 @@ def write_circular(self): else: #significance = '{:1.2f}'.format(self.significance(pvalue)) - - info = '
\t \t\t \t\t \t\t\t \t\t\t \n' + info = '|
| | | | | |\n' table = '' n_coincident_events=0 for event in events: diff --git a/fast_response/circular_templates/gw_gcn_template_high.txt b/fast_response/circular_templates/gw_gcn_template_high.txt index 0573857..baeba97 100644 --- a/fast_response/circular_templates/gw_gcn_template_high.txt +++ b/fast_response/circular_templates/gw_gcn_template_high.txt @@ -36,10 +36,11 @@ Properties of the coincident events are shown below. ... where: -dt = Time of track event minus time of GW trigger (sec) +dt = Time of track event minus time of GW trigger (sec). Angular uncertainty = Angular uncertainty of track event: the radius of a circle representing 90% CL containment by area. -p-value = the p-value for this specific track event from each search. +p-value = the p-value for this specific track event from each search. + Event p-values are provided when the per-event p-value is less than 0.1 in either search. The IceCube Neutrino Observatory is a cubic-kilometer neutrino detector operating at the geographic South Pole, Antarctica. The IceCube realtime alert point of contact can be From 96c36c7e216188a0acc18f3b06b93029b1717c14 Mon Sep 17 00:00:00 2001 From: jessiethw Date: Mon, 22 Sep 2025 08:23:51 -0500 Subject: [PATCH 13/13] no LLAMA for aframe --- fast_response/scripts/combine_results_kafka.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fast_response/scripts/combine_results_kafka.py b/fast_response/scripts/combine_results_kafka.py index ad42e75..38ca7f5 100644 --- a/fast_response/scripts/combine_results_kafka.py +++ b/fast_response/scripts/combine_results_kafka.py @@ -187,7 +187,7 @@ def parse_notice(record, wait_for_llama=False, heartbeat=False): if int(params['Significant'])==0: subthreshold=True logger.warning('low-significance alert found. ') - if params['Group'] == 'Burst' or params["Pipeline"] =='CWB': + if params['Group'] == 'Burst' or params["Pipeline"] =='CWB' or params["Pipeline"]=='aframe': wait_for_llama = False m = 'Significant' if not subthreshold else 'Subthreshold' logger.warning('{} burst or CWB alert found. '.format(m))