Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ sphinx:
configuration: doc/source/conf.py
fail_on_warning: true

formats:
- pdf
#formats:
# - pdf
2 changes: 1 addition & 1 deletion doc/source/slack.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ Slack Posters

slackbot class
--------------------------------
.. autoclass:: fast_response.slack_posters.slack
.. autoclass:: fast_response.slack_posters.slack.slackbot
:members:
6 changes: 3 additions & 3 deletions fast_response/AlertFollowup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand All @@ -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. '
Expand Down
2 changes: 1 addition & 1 deletion fast_response/FastResponseAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions fast_response/GWFollowup.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,7 @@ def write_circular(self):

else:
#significance = '{:1.2f}'.format(self.significance(pvalue))

info = ' <dt>\t <ra>\t\t <dec>\t\t <angErr>\t\t\t <p_gwava>\t\t\t <p_llama>\n'
info = '|<dt> | <ra> | <dec> | <angErr> | <p_gwava> | <p_llama> |\n'
table = ''
n_coincident_events=0
for event in events:
Expand Down
23 changes: 11 additions & 12 deletions fast_response/MonitoringAndMocks/Data_Display.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@
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/'

#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": [],
Expand Down Expand Up @@ -160,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')
Expand Down Expand Up @@ -317,11 +316,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")
Expand Down Expand Up @@ -391,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')
Expand Down
5 changes: 3 additions & 2 deletions fast_response/circular_templates/gw_gcn_template_high.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions fast_response/circular_templates/gw_gcn_template_low.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
<name> calculated from the map circulated in the <noticeID> 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 <name> ranges from <lowSens> to <highSens> GeV cm^-2 in a 1000 second
time window.
IceCubes sensitivity to neutrino point sources with an E^-2 spectrum,
expressed as E^2 dN/dE evaluated at 1 TeV, ranges from <lowSens> to <highSens> GeV cm^-2
within the 90% spatial containment region of <name> 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
Expand Down
8 changes: 4 additions & 4 deletions fast_response/circular_templates/internal_followup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 <alert_name> (<gcn_number>)
in a time range of 1000 seconds centered on the alert event time (<start_utc> UTC to <stop_utc> UTC) during which IceCube was collecting good quality data. Excluding the event
that prompted the alert, <n_events> track-like <events_is_are> found within the 90% containment region of <alert_name>.<coincident_events_and_p_str>
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 <alert_name> <short_sens_range> GeV cm^-2 in a 1000 second
that prompted the alert, <n_events> track-like <events_is_are> found within the 90% containment region of <alert_name>. <coincident_events_and_p_str>
IceCube’s sensitivity to neutrino point sources with an E^-2.5 spectrum, expressed as E^2 dN/dE evaluated at 1 TeV, <short_sens_range> GeV cm^-2 within the 90% spatial containment region of <alert_name> 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 <low_en> GeV and <high_en> GeV.

A subsequent search was performed including 2 days of data centered on the alert event time (<long_start_utc> UTC to <long_stop_utc> UTC).
<long_p_and_lim> 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 <alert_name> <long_sens_range> GeV cm^-2 in a 2 day time window.
<long_p_and_lim> IceCube’s sensitivity to neutrino point sources with an E^-2.5 spectrum, expressed as E^2 dN/dE evaluated at 1 TeV, <long_sens_range> GeV cm^-2 within the 90% spatial containment region of <alert_name> 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.
Expand Down
2 changes: 1 addition & 1 deletion fast_response/listeners/gw_gcn_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion fast_response/reports/ReportGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']))),
Expand Down
11 changes: 7 additions & 4 deletions fast_response/scripts/combine_results_kafka.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions fast_response/slack_posters/slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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={}
Expand Down