Skip to content
Snippets Groups Projects
Commit 1bc445dc authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Allow DB failure to pass

parent 4bcda901
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,7 @@ import os
import queue
import shutil
import threading
from urllib.error import URLError
import matplotlib
# Force matplotlib to not use any Xwindows backend.
......@@ -98,9 +99,17 @@ class ZTPlot(kp.Module):
def _update_calibration(self):
self.cprint("Updating calibration")
self.t0set = self.sds.t0sets(detid=self.det_id).iloc[-1]['CALIBSETID']
self.calib = kp.calib.Calibration(det_id=self.det_id, t0set=self.t0set)
self.max_z = round(np.max(self.calib.detector.pmts.pos_z) + 10, -1)
try:
self.t0set = self.sds.t0sets(
detid=self.det_id).iloc[-1]['CALIBSETID']
self.calib = kp.calib.Calibration(det_id=self.det_id,
t0set=self.t0set)
except URLError as e:
self.log.error(
"Unable to update calibration, no connection to the DB.\n{}".
format(e))
else:
self.max_z = round(np.max(self.calib.detector.pmts.pos_z) + 10, -1)
def process(self, blob):
if 'Hits' not in blob:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment