From f38e2609a93157e54b67c91d63fffe52eba64df8 Mon Sep 17 00:00:00 2001 From: Qing Tian <qingtian@exflqr13361.desy.de> Date: Fri, 12 Oct 2018 10:56:23 +0200 Subject: [PATCH] modified timeout to cal_db_timeout --- cal_tools/cal_tools/agipdlib.py | 18 +++++++++--------- cal_tools/cal_tools/lpdlib.py | 16 ++++++++-------- notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb | 4 ++-- notebooks/LPD/LPD_Correct_and_Verify.ipynb | 4 ++-- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/cal_tools/cal_tools/agipdlib.py b/cal_tools/cal_tools/agipdlib.py index ad6d1325a..db81bbe7e 100644 --- a/cal_tools/cal_tools/agipdlib.py +++ b/cal_tools/cal_tools/agipdlib.py @@ -79,7 +79,7 @@ class AgipdCorrections: self.do_rel_gain = do_rel_gain self.sig_zero_mask = None self.base_offset = None - self.timeout = timeout + self.cal_db_timeout = timeout def get_iteration_range(self): """Returns a range expression over which to iterate in chunks @@ -393,7 +393,7 @@ class AgipdCorrections: np.zeros((128,512,max_cells_db,3)), cal_db_interface, creation_time=creation_time, - timeout=self.timeout) + timeout=self.cal_db_timeout) noise = get_constant_from_db(getattr(Detectors.AGIPD1M1, qm), Constants.AGIPD.Noise(), @@ -401,7 +401,7 @@ class AgipdCorrections: np.zeros((128,512,max_cells_db,3)), cal_db_interface, creation_time=creation_time, - timeout=self.timeout) + timeout=self.cal_db_timeout) bpixels = get_constant_from_db(getattr(Detectors.AGIPD1M1, qm), Constants.AGIPD.BadPixelsDark(), @@ -410,7 +410,7 @@ class AgipdCorrections: np.zeros((128,512,max_cells_db,3)), cal_db_interface, creation_time=creation_time, - timeout=self.timeout).astype(np.uint32) + timeout=self.cal_db_timeout).astype(np.uint32) thresholds = get_constant_from_db(getattr(Detectors.AGIPD1M1, qm), Constants.AGIPD.ThresholdsDark(), @@ -419,7 +419,7 @@ class AgipdCorrections: np.ones((128,512,max_cells_db,2)), cal_db_interface, creation_time=creation_time, - timeout=self.timeout) + timeout=self.cal_db_timeout) if only_dark: self.initialize(offset, None, bpixels, noise, thresholds, None) @@ -432,7 +432,7 @@ class AgipdCorrections: np.ones((128,512,max_cells_db,10)), cal_db_interface, creation_time=creation_time, - timeout=self.timeout).astype(np.float32) + timeout=self.cal_db_timeout).astype(np.float32) if slopesPC.shape[0] == 10: # constant dimension injected first slopesPC = np.moveaxis(slopesPC, 0, 3) @@ -457,7 +457,7 @@ class AgipdCorrections: np.ones((128,512,max_cells_db)), cal_db_interface, creation_time=creation_time, - timeout=self.timeout)) + timeout=self.cal_db_timeout)) rel_gain = np.ones((128, 512, self.max_cells, 3), np.float32) pc_high_m = slopesPC[...,:self.max_cells,0] @@ -493,7 +493,7 @@ class AgipdCorrections: np.zeros((max_cells_db, 128,512)), cal_db_interface, creation_time=creation_time, - timeout=self.timeout).astype(np.uint32), 0, 2)[...,None] + timeout=self.cal_db_timeout).astype(np.uint32), 0, 2)[...,None] bpixels |= get_constant_from_db(getattr(Detectors.AGIPD1M1, qm), Constants.AGIPD.BadPixelsFF(), @@ -503,7 +503,7 @@ class AgipdCorrections: np.zeros((128,512,max_cells_db)), cal_db_interface, creation_time=creation_time, - timeout=self.timeout).astype(np.uint32)[...,None] + timeout=self.cal_db_timeout).astype(np.uint32)[...,None] diff --git a/cal_tools/cal_tools/lpdlib.py b/cal_tools/cal_tools/lpdlib.py index e97b79c57..f6a1a78ea 100644 --- a/cal_tools/cal_tools/lpdlib.py +++ b/cal_tools/cal_tools/lpdlib.py @@ -77,7 +77,7 @@ class LpdCorrections: self.do_ff = do_ff filter_modules = [11] self.filter_cells = [0,1] if channel in filter_modules else [] - self.timeout = timeout + self.cal_db_timeout = timeout def get_iteration_range(self): """Returns a range expression over which to iterate in chunks @@ -376,7 +376,7 @@ class LpdCorrections: np.zeros((256,256,max_cells_db,3)), cal_db_interface, creation_time=creation_time, - timeout=self.timeout) + timeout=self.cal_db_timeout) noise = get_constant_from_db(getattr(Detectors.LPD1M1, qm), Constants.LPD.Noise(), @@ -385,7 +385,7 @@ class LpdCorrections: np.zeros((256,256,max_cells_db,3)), cal_db_interface, creation_time=creation_time, - timeout=self.timeout) + timeout=self.cal_db_timeout) bpixels = get_constant_from_db(getattr(Detectors.LPD1M1, qm), Constants.LPD.BadPixelsDark(), @@ -395,7 +395,7 @@ class LpdCorrections: np.zeros((256,256,max_cells_db,3)), cal_db_interface, creation_time=creation_time, - timeout=self.timeout).astype(np.uint32) + timeout=self.cal_db_timeout).astype(np.uint32) if only_dark: self.initialize(offset, None, None, bpixels, noise, None) return @@ -408,7 +408,7 @@ class LpdCorrections: np.ones((256,256,max_cells_db,2)), cal_db_interface, creation_time=creation_time, - timeout=self.timeout) + timeout=self.cal_db_timeout) rel_gains = slopesCI[...,0] rel_gain_offset = slopesCI[...,1] @@ -421,7 +421,7 @@ class LpdCorrections: np.ones((256,256)), cal_db_interface, creation_time=creation_time, - timeout=self.timeout)) + timeout=self.cal_db_timeout)) @@ -434,7 +434,7 @@ class LpdCorrections: np.zeros((256,256,max_cells_db,3)), cal_db_interface, creation_time=creation_time, - timeout=self.timeout).astype(np.uint32) + timeout=self.cal_db_timeout).astype(np.uint32) bpixels |= get_constant_from_db(getattr(Detectors.LPD1M1, qm), Constants.LPD.BadPixelsFF(), @@ -444,7 +444,7 @@ class LpdCorrections: np.zeros((256,256,max_cells_db)), cal_db_interface, creation_time=creation_time, - timeout=self.timeout).astype(np.uint32)[...,None] + timeout=self.cal_db_timeout).astype(np.uint32)[...,None] self.initialize(offset, rel_gains, rel_gain_offset, bpixels, noise, flat_fields) diff --git a/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb b/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb index bef0996b6..ff7d92f8d 100644 --- a/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb +++ b/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb @@ -38,7 +38,7 @@ "photon_energy = 9.2 # photon energy in keV\n", "index_v = 2 # version of RAW index type\n", "nodb = False # if set only file-based constants will be used\n", - "timeout_zmq = 900 # set to 900 as a default value to communicate with ZMQ\n", + "timeout_cal_db = 900 # set to 900 as a default value to communicate with ZMQ\n", "\n", "def balance_sequences(in_folder, run, sequences, sequences_per_node):\n", " import glob\n", @@ -420,7 +420,7 @@ " agipd_corr = AgipdCorrections(infile, outfile, max_cells, channel, max_pulses,\n", " bins_gain_vs_signal, bins_signal_low_range,\n", " bins_signal_high_range, bins_dig_gain_vs_signal,\n", - " do_rel_gain=do_rel_gain, timeout=timeout_zmq)\n", + " do_rel_gain=do_rel_gain, timeout=timeout_cal_db)\n", " \n", " try:\n", " agipd_corr.get_valid_image_idx() \n", diff --git a/notebooks/LPD/LPD_Correct_and_Verify.ipynb b/notebooks/LPD/LPD_Correct_and_Verify.ipynb index 1de3afbb4..c9f3c4c89 100644 --- a/notebooks/LPD/LPD_Correct_and_Verify.ipynb +++ b/notebooks/LPD/LPD_Correct_and_Verify.ipynb @@ -42,7 +42,7 @@ "geometry_file = \"/gpfs/exfel/d/cal/exchange/lpdMF_00.h5\" # the geometry file to use, MAR 2018\n", "beam_center_offset = [1.5, 1] # offset from the beam center, MAR 2018\n", "sequences_per_node = 2\n", - "timeout_zmq = 900 # set to 900 as a default value to communicate with ZMQ\n", + "timeout_cal_db = 900 # set to 900 as a default value to communicate with ZMQ\n", "\n", "def balance_sequences(in_folder, run, sequences, sequences_per_node):\n", " import glob\n", @@ -380,7 +380,7 @@ " \n", " lpd_corr = LpdCorrections(infile, outfile, max_cells, channel, max_pulses,\n", " bins_gain_vs_signal, bins_signal_low_range,\n", - " bins_signal_high_range, do_ff=do_ff, timeout=timeout_zmq)\n", + " bins_signal_high_range, do_ff=do_ff, timeout=timeout_cal_db)\n", " \n", " try:\n", " lpd_corr.get_valid_image_idx() \n", -- GitLab