File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 3131
3232from event import names # TODO: add event to get DSAEvent class
3333
34+
35+ # set up slack client
36+ slack_file = '{0}/.config/slack_api' .format (os .path .expanduser ("~" ))
37+ if not os .path .exists (slack_file ):
38+ raise RuntimeError ("Could not find file with slack api token at {0}" .format (slack_file ))
39+ with open (slack_file ) as sf_handler :
40+ slack_token = sf_handler .read ()
41+ slack_client = slack .WebClient (token = slack_token )
42+
3443# half second at heimdall time resolution (after march 18)
3544offset = 1907
3645downsample = 4
@@ -676,6 +685,7 @@ def send_trigger(output_dict=None, outputfile=None):
676685 ) # tells look_after_dumps.py to manage data
677686 else :
678687 print (f"Candidate { candname } was detected as an injection. Not triggering voltage recording." )
688+ slack_client .chat_postMessage (channel = 'candidates' , text = f'Injection detected as { candname } with DM={ val ["dm" ]} and SNR={ val ["snr" ]} .' )
679689
680690
681691def dump_cluster_results_heimdall (
You can’t perform that action at this time.
0 commit comments