def updateStatusInfo(self) : msg = 'Selected detector(s): %s' % self.det_name.value() if self.det_name.value() == '' : msg += '!!! Detector is not selected !!!' #try : cp.guiinsexpdirdet.butDet.setStyleSheet(cp.styleButtonBad) #except : pass else : ctype='pedestals' if self.current_tab.value() == 'Dark' : ctype='pedestals' #if self.current_tab.value() == cp.guitabs.list_of_tabs[0] : ctype='pedestals' #msg = 'From %s to %s use dark run %s' % (self.str_run_from.value(), self.str_run_to.value(), self.str_run_number.value()) #for det_name in self.det_name.value().split(' ') : for det_name in cp.list_of_dets_selected() : calib_subdir = cp.dict_of_det_calib_types[det_name] #print 'calib_subdir =', calib_subdir msg += '\n' + gu.get_text_content_of_calib_dir_for_detector(path=self.calib_dir.value(), subdir=calib_subdir, det=det_name, calib_type=ctype) self.setStatusMessage(msg)
def cfg_file_body_for_peds_aver(self) : txt_cfg_body = '#Module parameters' self.ind = 0 for det_name in cp.list_of_dets_selected() : lst_tepes, lst_srcs = cp.blsp.list_of_types_and_sources_for_detector(det_name) list_path_peds_ave = gu.get_list_of_files_for_list_of_insets(fnm.path_peds_ave(), lst_srcs) list_path_peds_rms = gu.get_list_of_files_for_list_of_insets(fnm.path_peds_rms(), lst_srcs) list_path_hotpix_mask = gu.get_list_of_files_for_list_of_insets(fnm.path_hotpix_mask(), lst_srcs) if self.do_test_print : print 'Detector selected: %10s' % (det_name), ' sources:', lst_srcs for (self.source, self.fname_ave, self.fname_rms, self.fname_mask) in zip(lst_srcs, list_path_peds_ave, list_path_peds_rms, list_path_hotpix_mask) : self.ind += 1 #print self.ind, self.source, self.fname_ave, self.fname_rms # list_of_dets = ['CSPAD', 'CSPAD2x2', 'Princeton', 'pnCCD', 'Tm6740', 'Opal2000', 'Opal4000', 'Acqiris'] #if det_name == cp.list_of_dets[0] : self.add_cfg_module_peds_aver_cspad('cspad_mod.CsPadPedestals') #elif det_name == cp.list_of_dets[1] : self.add_cfg_module_peds_aver_cspad('cspad_mod.CsPad2x2Pedestals') if det_name == cp.list_of_dets[0] : self.add_cfg_module_peds_aver_cspad_with_mask('CSPadPixCoords.CSPadNDArrProducer') elif det_name == cp.list_of_dets[1] : self.add_cfg_module_peds_aver_cspad_with_mask('CSPadPixCoords.CSPad2x2NDArrProducer') elif det_name == cp.list_of_dets[2] : self.add_cfg_module_peds_aver_princeton() elif det_name == cp.list_of_dets[3] : self.add_cfg_module_peds_aver_pnccd_ndarr() #elif det_name == cp.list_of_dets[3] : self.add_cfg_module_peds_aver_pnccd_img() elif det_name == cp.list_of_dets[4] : self.add_cfg_module_peds_aver_camera() elif det_name == cp.list_of_dets[5] : self.add_cfg_module_peds_aver_camera() elif det_name == cp.list_of_dets[6] : self.add_cfg_module_peds_aver_camera() elif det_name == cp.list_of_dets[7] : self.add_cfg_module_peds_aver_acqiris() elif det_name == cp.list_of_dets[8] : self.print_warning() else : logger.warning('UNKNOWN DETECTOR: %s' % det_name, __name__)
def updateStatusInfo(self): msg = 'Selected detector(s): %s' % self.det_name.value() if self.det_name.value() == '': msg += '!!! Detector is not selected !!!' #try : cp.guiinsexpdirdet.butDet.setStyleSheet(cp.styleButtonBad) #except : pass else: ctype = 'pedestals' if self.current_tab.value() == 'Dark': ctype = 'pedestals' #if self.current_tab.value() == cp.guitabs.list_of_tabs[0] : ctype='pedestals' #msg = 'From %s to %s use dark run %s' % (self.str_run_from.value(), self.str_run_to.value(), self.str_run_number.value()) #for det_name in self.det_name.value().split(' ') : for det_name in cp.list_of_dets_selected(): calib_subdir = cp.dict_of_det_calib_types[det_name] #print 'calib_subdir =', calib_subdir msg += '\n' + gu.get_text_content_of_calib_dir_for_detector( path=self.calib_dir.value(), subdir=calib_subdir, det=det_name, calib_type=ctype) self.setStatusMessage(msg)
def cfg_file_body_for_peds_aver(self) : txt_cfg_body = '#Module parameters' self.ind = 0 for det_name in cp.list_of_dets_selected() : lst_tepes, lst_srcs = cp.blsp.list_of_types_and_sources_for_detector(det_name) list_path_peds_ave = gu.get_list_of_files_for_list_of_insets(fnm.path_peds_ave(), lst_srcs) list_path_peds_rms = gu.get_list_of_files_for_list_of_insets(fnm.path_peds_rms(), lst_srcs) list_path_hotpix_mask = gu.get_list_of_files_for_list_of_insets(fnm.path_hotpix_mask(), lst_srcs) if self.do_test_print : print 'Detector selected: %10s' % (det_name), ' sources:', lst_srcs for (self.source, self.fname_ave, self.fname_rms, self.fname_mask) in zip(lst_srcs, list_path_peds_ave, list_path_peds_rms, list_path_hotpix_mask) : self.ind += 1 #print self.ind, self.source, self.fname_ave, self.fname_rms # list_of_dets = ['CSPAD', 'CSPAD2x2', 'Princeton', 'pnCCD', 'Tm6740', 'Opal2000', 'Opal4000', 'Acqiris'] #if det_name == cp.list_of_dets[0] : self.add_cfg_module_peds_aver_cspad('cspad_mod.CsPadPedestals') #elif det_name == cp.list_of_dets[1] : self.add_cfg_module_peds_aver_cspad('cspad_mod.CsPad2x2Pedestals') if det_name == cp.list_of_dets[0] : self.add_cfg_module_peds_aver_cspad_with_mask('CSPadPixCoords.CSPadNDArrProducer') elif det_name == cp.list_of_dets[1] : self.add_cfg_module_peds_aver_cspad_with_mask('CSPadPixCoords.CSPad2x2NDArrProducer') elif det_name == cp.list_of_dets[2] : self.add_cfg_module_peds_aver_princeton() elif det_name == cp.list_of_dets[3] : self.add_cfg_module_peds_aver_pnccd() elif det_name == cp.list_of_dets[4] : self.add_cfg_module_peds_aver_camera() elif det_name == cp.list_of_dets[5] : self.add_cfg_module_peds_aver_camera() elif det_name == cp.list_of_dets[6] : self.add_cfg_module_peds_aver_camera() elif det_name == cp.list_of_dets[7] : self.add_cfg_module_peds_aver_acqiris() elif det_name == cp.list_of_dets[8] : self.print_warning() else : logger.warning('UNKNOWN DETECTOR: %s' % det_name, __name__)
def get_detector_selected(self): lst = cp.list_of_dets_selected() len_lst = len(lst) msg = '%d detector(s) selected: %s' % (len_lst, str(lst)) #logger.info(msg, __name__ ) if len_lst != 1: msg += ' Select THE ONE!' logger.warning(msg, __name__) return None return lst[0]
def get_detector_selected(self): lst = cp.list_of_dets_selected() len_lst = len(lst) msg = '%d detector(s) selected: %s' % (len_lst, str(lst)) #logger.info(msg, __name__ ) if len_lst !=1 : msg += ' Select THE ONE!' logger.warning(msg, __name__ ) return None return lst[0]
def list_of_types_and_sources_for_selected_detectors (self) : """Returns the list of types and sources in run for selected detector. For example, for CSPAD returns ['CsPad::DataV2', 'CsPad::DataV2'], ['CxiDs1.0:Cspad.0', 'CxiDsd.0:Cspad.0'] """ lst_types = [] lst_srcs = [] for det_name in cp.list_of_dets_selected() : lst_t, lst_s = self.list_of_types_and_sources_for_detector(det_name) lst_types += lst_t lst_srcs += lst_s return lst_types, lst_srcs
def list_of_types_and_sources_for_selected_detectors(self): """Returns the list of types and sources in run for selected detector. For example, for CSPAD returns ['CsPad::DataV2', 'CsPad::DataV2'], ['CxiDs1.0:Cspad.0', 'CxiDsd.0:Cspad.0'] """ lst_types = [] lst_srcs = [] for det_name in cp.list_of_dets_selected(): lst_t, lst_s = self.list_of_types_and_sources_for_detector( det_name) lst_types += lst_t lst_srcs += lst_s return lst_types, lst_srcs
def cfg_file_body_for_peds_aver(self) : txt_cfg_body = '#Module parameters' self.ind = 0 for det_name in cp.list_of_dets_selected() : lst_types, lst_srcs, lst_ctypes = cp.blsp.list_of_types_and_sources_for_detector(det_name) list_path_peds_ave = gu.get_list_of_files_for_list_of_insets(fnm.path_peds_ave(), lst_srcs) list_path_peds_rms = gu.get_list_of_files_for_list_of_insets(fnm.path_peds_rms(), lst_srcs) list_path_hotpix_mask = gu.get_list_of_files_for_list_of_insets(fnm.path_hotpix_mask(), lst_srcs) if self.do_test_print : print 'Detector selected: %10s' % (det_name), ' sources:', lst_srcs for (self.source, self.fname_ave, self.fname_rms, self.fname_mask) in zip(lst_srcs, list_path_peds_ave, list_path_peds_rms, list_path_hotpix_mask) : self.ind += 1 #print self.ind, self.source, self.fname_ave, self.fname_rms #list_of_dets = ['CSPAD', 'CSPAD2x2', 'Princeton', 'pnCCD', 'Tm6740', 'Opal1000', 'Opal2000', 'Opal4000', 'Opal8000', \ # 'OrcaFl40', 'Epix', 'Epix10k', 'Epix100a', 'Fccd960', 'Andor', 'Acqiris'] #if det_name == cp.list_of_dets[0] : self.add_cfg_module_peds_aver_cspad('cspad_mod.CsPadPedestals') #elif det_name == cp.list_of_dets[1] : self.add_cfg_module_peds_aver_cspad('cspad_mod.CsPad2x2Pedestals') if det_name == cp.list_of_dets[0] : self.add_cfg_module_peds_aver_cspad_with_mask('CSPadPixCoords.CSPadNDArrProducer') elif det_name == cp.list_of_dets[1] : self.add_cfg_module_peds_aver_cspad_with_mask('CSPadPixCoords.CSPad2x2NDArrProducer') elif det_name == cp.list_of_dets[2] : self.add_cfg_module_peds_aver_princeton() elif det_name == cp.list_of_dets[3] : self.add_cfg_module_peds_aver_pnccd_ndarr() #elif det_name == cp.list_of_dets[3] : self.add_cfg_module_peds_aver_pnccd_img() elif det_name == cp.list_of_dets[4] : self.add_cfg_module_peds_aver_camera() elif det_name == cp.list_of_dets[5] : self.add_cfg_module_peds_aver_camera() elif det_name == cp.list_of_dets[6] : self.add_cfg_module_peds_aver_camera() elif det_name == cp.list_of_dets[7] : self.add_cfg_module_peds_aver_camera() elif det_name == cp.list_of_dets[8] : self.add_cfg_module_peds_aver_camera() elif det_name == cp.list_of_dets[9] : self.add_cfg_module_peds_aver_camera() elif det_name == cp.list_of_dets[10]: self.add_cfg_module_peds_aver_epix() elif det_name == cp.list_of_dets[11]: self.add_cfg_module_peds_aver_epix() elif det_name == cp.list_of_dets[12]: self.add_cfg_module_peds_aver_epix() elif det_name == cp.list_of_dets[13]: self.add_cfg_module_peds_aver_camera(out_dtype='int') elif det_name == cp.list_of_dets[14]: self.add_cfg_module_peds_aver_andor() elif det_name == cp.list_of_dets[15]: self.add_cfg_module_peds_aver_acqiris() elif det_name == cp.list_of_dets[16]: self.print_warning() else : logger.warning('UNKNOWN DETECTOR: %s' % det_name, __name__) if self.ind > 0 : return True msg = 'Selected detectors NOT FOUND in the list of keys in xtc scan log file !!!' logger.warning(msg, __name__) return False
def setDet(self, txt=None, clearList=True): but_title = 'Select' if txt is None: but_title = 'Selected:%d' % len(cp.list_of_dets_selected()) self.butDet.setText(but_title + self.char_expand) self.det_but_title.setValue(but_title) logger.info('Selected detector(s): ' + self.det_name.value(), __name__) if cp.guistatus is not None: cp.guistatus.updateStatusInfo() if cp.guidarklist is not None: cp.guidarklist.updateList(clearList) if cp.guifilemanagerselect is not None: cp.guifilemanagerselect.resetFields()
def setDet(self, txt=None, clearList=True): but_title = 'Select' if txt is None : but_title = 'Selected:%d' % len(cp.list_of_dets_selected()) self.butDet.setText( but_title + self.char_expand ) self.det_but_title.setValue(but_title) logger.info('Selected detector(s): ' + self.det_name.value(), __name__) if cp.guistatus is not None : cp.guistatus.updateStatusInfo() if cp.guidarklist is not None : cp.guidarklist.updateList(clearList) if cp.guifilemanagerselect is not None : cp.guifilemanagerselect.resetFields()
def cfg_file_body_for_peds_aver(self) : txt_cfg_body = '#Module parameters' self.ind = 0 for det_name in cp.list_of_dets_selected() : lst_types, lst_srcs, lst_ctypes = cp.blsp.list_of_types_and_sources_for_detector(det_name) list_path_peds_ave = gu.get_list_of_files_for_list_of_insets(fnm.path_peds_ave(), lst_srcs) list_path_peds_rms = gu.get_list_of_files_for_list_of_insets(fnm.path_peds_rms(), lst_srcs) list_path_hotpix_mask = gu.get_list_of_files_for_list_of_insets(fnm.path_hotpix_mask(), lst_srcs) if self.do_test_print : print 'Detector selected: %10s' % (det_name), ' sources:', lst_srcs for (self.source, self.fname_ave, self.fname_rms, self.fname_mask) in zip(lst_srcs, list_path_peds_ave, list_path_peds_rms, list_path_hotpix_mask) : self.ind += 1 #print self.ind, self.source, self.fname_ave, self.fname_rms #list_of_dets = ['CSPAD', 'CSPAD2x2', 'Princeton', 'pnCCD', 'Tm6740', 'Opal1000', 'Opal2000', 'Opal4000', 'Opal8000', \ # 'OrcaFl40', 'Epix', 'Epix10k', 'Epix100a', 'Fccd960', 'Andor', 'Acqiris'] #if det_name == cp.list_of_dets[0] : self.add_cfg_module_peds_aver_cspad('cspad_mod.CsPadPedestals') #elif det_name == cp.list_of_dets[1] : self.add_cfg_module_peds_aver_cspad('cspad_mod.CsPad2x2Pedestals') if det_name == cp.list_of_dets[0] : self.add_cfg_module_peds_aver_cspad_with_mask('CSPadPixCoords.CSPadNDArrProducer') elif det_name == cp.list_of_dets[1] : self.add_cfg_module_peds_aver_cspad_with_mask('CSPadPixCoords.CSPad2x2NDArrProducer') elif det_name == cp.list_of_dets[2] : self.add_cfg_module_peds_aver_princeton() elif det_name == cp.list_of_dets[3] : self.add_cfg_module_peds_aver_pnccd_ndarr() #elif det_name == cp.list_of_dets[3] : self.add_cfg_module_peds_aver_pnccd_img() elif det_name == cp.list_of_dets[4] : self.add_cfg_module_peds_aver_camera() elif det_name == cp.list_of_dets[5] : self.add_cfg_module_peds_aver_camera() elif det_name == cp.list_of_dets[6] : self.add_cfg_module_peds_aver_camera() elif det_name == cp.list_of_dets[7] : self.add_cfg_module_peds_aver_camera() elif det_name == cp.list_of_dets[8] : self.add_cfg_module_peds_aver_camera() elif det_name == cp.list_of_dets[9] : self.add_cfg_module_peds_aver_camera() elif det_name == cp.list_of_dets[10]: self.add_cfg_module_peds_aver_epix() elif det_name == cp.list_of_dets[11]: self.add_cfg_module_peds_aver_epix() elif det_name == cp.list_of_dets[12]: self.add_cfg_module_peds_aver_epix() elif det_name == cp.list_of_dets[13]: self.add_cfg_module_peds_aver_camera(out_dtype='int') elif det_name == cp.list_of_dets[14]: self.add_cfg_module_peds_aver_andor() elif det_name == cp.list_of_dets[15]: self.add_cfg_module_peds_aver_acqiris() elif det_name == cp.list_of_dets[16]: self.print_warning() else : logger.warning('UNKNOWN DETECTOR: %s' % det_name, __name__) if self.ind > 0 : return True msg = 'Selected detectors NOT FOUND in the list of keys in xtc scan log file !!!' logger.warning(msg, __name__) return False
def setDet(self, txt=None, clearList=True): but_title = 'Select' if txt is None : but_title = 'Selected:%d' % len(cp.list_of_dets_selected()) self.butDet.setText( but_title + self.char_expand ) self.det_but_title.setValue(but_title) logger.info('Selected detector(s): ' + self.det_name.value(), __name__) if cp.guistatus is not None : cp.guistatus.updateStatusInfo() if cp.guitabs is not None and cp.current_tab.value() == cp.guitabs.list_of_tabs[0] and cp.guidarklist is not None : if self.but_current == self.butIns or self.but_current == self.butExp : cp.guidarklist.updateList(clearList) else : cp.guidarklist.updateList() if cp.guifilemanagersinglecontrol is not None : cp.guifilemanagersinglecontrol.resetFields() if cp.guifilemanagergroup is not None : cp.guifilemanagergroup.resetFields()
def setDet(self, txt=None, clearList=True): but_title = 'Select' if txt is None : but_title = 'Selected:%d' % len(cp.list_of_dets_selected()) self.butDet.setText( but_title + self.char_expand ) self.det_but_title.setValue(but_title) logger.info('Selected detector(s): ' + self.det_name.value(), __name__) if cp.guistatus is not None : cp.guistatus.updateStatusInfo() if cp.guitabs is not None and cp.current_tab.value() == cp.guitabs.list_of_tabs[0] and cp.guidarklist is not None : if self.but_current == self.butIns or self.but_current == self.butExp : cp.guidarklist.updateList(clearList) else : cp.guidarklist.updateList() if cp.guifilemanagersinglecontrol is not None : cp.guifilemanagersinglecontrol.resetFields() if cp.guifilemanagergroup is not None : cp.guifilemanagergroup.resetFields()
def list_of_types_and_sources_for_selected_detectors (self) : """Returns the list of data types, sources, and calib types in run for selected detector. For example, for CSPAD returns ['CsPad::DataV2', 'CsPad::DataV2'], ['CxiDs1.0:Cspad.0', 'CxiDs2.0:Cspad.0'] ['CsPad::CalibV1', 'CsPad::CalibV1'], """ lst_ctypes = [] lst_types = [] lst_srcs = [] for det_name in cp.list_of_dets_selected() : lst_t, lst_s, lst_c = self.list_of_types_and_sources_for_detector(det_name) #print 'lst_t: ', lst_t #print 'lst_s: ', lst_s #print 'lst_c: ', lst_c lst_ctypes += lst_c lst_types += lst_t lst_srcs += lst_s return lst_types, lst_srcs, lst_ctypes
def list_of_types_and_sources_for_selected_detectors(self): """Returns the list of data types, sources, and calib types in run for selected detector. For example, for CSPAD returns ['CsPad::DataV2', 'CsPad::DataV2'], ['CxiDs1.0:Cspad.0', 'CxiDs2.0:Cspad.0'] ['CsPad::CalibV1', 'CsPad::CalibV1'], """ lst_ctypes = [] lst_types = [] lst_srcs = [] for det_name in cp.list_of_dets_selected(): lst_t, lst_s, lst_c = self.list_of_types_and_sources_for_detector( det_name) #print 'lst_t: ', lst_t #print 'lst_s: ', lst_s #print 'lst_c: ', lst_c lst_ctypes += lst_c lst_types += lst_t lst_srcs += lst_s return lst_types, lst_srcs, lst_ctypes