def make_psana_cfg_file_for_cora_split (self) : self.path_in = apputils.AppDataPath('CorAna/scripts/psana-cora-split.cfg').path() self.path_out = fnm.path_cora_split_psana_cfg() self.d_subs = {'FNAME_XTC' : fnm.path_data_xtc_cond(), 'SKIP' : str( cp.bat_data_start.value() - 1 ), 'EVENTS' : str( cp.bat_data_end.value() - cp.bat_data_start.value() + 1 ), 'IMG_REC_MODULE' : str( cp.bat_img_rec_mod.value() ), 'DETINFO' : str( cp.bat_det_info.value() ), 'PATH_PREFIX_CORA': str( fnm.path_prefix_cora() ), 'IMG_NPARTS' : str( cp.bat_img_nparts.value() ), 'FNAME_PEDS_AVE' : fnm.path_pedestals_ave(), } if cp.lld_type.value() == 'ADU' : # ['NONE', 'ADU', 'RMS'] self.d_subs['THRESHOLD_ADU' ] = str( cp.lld_adu.value() ) self.d_subs['THRESHOLD_NRMS'] = '0' self.d_subs['FNAME_PEDS_RMS'] = '' elif cp.lld_type.value() == 'RMS' : self.d_subs['THRESHOLD_ADU' ] = '-123456' # = default value - will not use trheshold self.d_subs['THRESHOLD_NRMS'] = str( cp.lld_rms.value() ) self.d_subs['FNAME_PEDS_RMS'] = fnm.path_pedestals_rms() else : self.d_subs['THRESHOLD_ADU' ] = '-123456' # = default value - will not use trheshold self.d_subs['THRESHOLD_NRMS'] = '0' self.d_subs['FNAME_PEDS_RMS'] = '' self.print_substitution_dict() self.make_cfg_file()
def make_psana_cfg_file_for_cora_split (self) : self.path_in = apputils.AppDataPath('CorAna/scripts/psana-cora-split.cfg').path() self.path_out = fnm.path_cora_split_psana_cfg() self.d_subs = {'FNAME_XTC' : fnm.path_data_xtc_cond(), 'SKIP' : str( cp.bat_data_start.value() - 1 ), 'EVENTS' : str( cp.bat_data_end.value() - cp.bat_data_start.value() + 1 ), 'IMG_REC_MODULE' : str( cp.bat_img_rec_mod.value() ), 'DETINFO' : str( cp.bat_det_info.value() ), 'PATH_PREFIX_CORA': str( fnm.path_prefix_cora() ), 'IMG_NPARTS' : str( cp.bat_img_nparts.value() ), 'FNAME_PEDS_AVE' : fnm.path_pedestals_ave(), } if cp.lld_type.value() == 'ADU' : # ['NONE', 'ADU', 'RMS'] self.d_subs['THRESHOLD_ADU' ] = str( cp.lld_adu.value() ) self.d_subs['DO_CONST_THR' ] = 'true' self.d_subs['THRESHOLD_NRMS'] = '0' self.d_subs['FNAME_PEDS_RMS'] = '' elif cp.lld_type.value() == 'RMS' : self.d_subs['THRESHOLD_ADU' ] = '0' self.d_subs['DO_CONST_THR' ] = 'false' self.d_subs['THRESHOLD_NRMS'] = str( cp.lld_rms.value() ) self.d_subs['FNAME_PEDS_RMS'] = fnm.path_pedestals_rms() else : self.d_subs['THRESHOLD_ADU' ] = '0' self.d_subs['DO_CONST_THR' ] = 'false' self.d_subs['THRESHOLD_NRMS'] = '0' self.d_subs['FNAME_PEDS_RMS'] = '' self.print_substitution_dict() self.make_cfg_file()
def onBrow(self): logger.debug('onBrowser', __name__) try : cp.guifilebrowser.close() self.but_brow.setStyleSheet(cp.styleButtonBad) except : self.but_brow.setStyleSheet(cp.styleButtonGood) cp.guifilebrowser = GUIFileBrowser(None, fnm.get_list_of_files_cora_split(), \ fnm.path_cora_split_psana_cfg()) cp.guifilebrowser.move(cp.guimain.pos().__add__(QtCore.QPoint(720,120))) cp.guifilebrowser.show()
def onBrow(self): logger.debug('onBrowser', __name__) try: cp.guifilebrowser.close() self.but_brow.setStyleSheet(cp.styleButtonBad) except: self.but_brow.setStyleSheet(cp.styleButtonGood) cp.guifilebrowser = GUIFileBrowser(None, fnm.get_list_of_files_cora_split(), \ fnm.path_cora_split_psana_cfg()) cp.guifilebrowser.move(cp.guimain.pos().__add__( QtCore.QPoint(720, 120))) cp.guifilebrowser.show()
def make_psana_cfg_file_for_cora_split (self) : self.str_of_modules = '' self.txt_cfg_header = '# Autogenerated config file for corana split\n' self.txt_cfg_body = '\n\n' self.add_cfg_module_tahometer() self.add_cfg_module_img_producer() self.add_cfg_trailer_for_cora_split() self.cfg_file_header_for_data_aver() self.save_cfg_file(self.txt_cfg_header + self.txt_cfg_body, fnm.path_cora_split_psana_cfg())
def make_psana_cfg_file_for_cora_split_v1(self): self.path_in = apputils.AppDataPath( 'CorAna/scripts/psana-cora-split.cfg').path() self.path_out = fnm.path_cora_split_psana_cfg() self.d_subs = { 'FNAME_XTC': fnm.path_data_xtc_cond(), 'SKIP': str(cp.bat_data_start.value() - 1), 'EVENTS': str(cp.bat_data_end.value() - cp.bat_data_start.value() + 1), 'IMG_REC_MODULE': str(cp.bat_img_rec_mod.value()), 'DETINFO': str(cp.bat_det_info.value()), 'PATH_PREFIX_CORA': str(fnm.path_prefix_cora()), 'IMG_NPARTS': str(cp.bat_img_nparts.value()), 'FNAME_PEDS_AVE': fnm.path_pedestals_ave(), 'FNAME_DATA_AVE': fnm.path_data_ave(), 'FNAME_DATA_RMS': fnm.path_data_rms() } fname_imon_cfg = fnm.path_cora_split_imon_cfg() self.make_imon_cfg_file(fname_imon_cfg) self.d_subs['FNAME_IMON_CFG'] = str(fname_imon_cfg) if cp.lld_type.value() == 'ADU': # ['NONE', 'ADU', 'RMS'] self.d_subs['THRESHOLD_ADU'] = str(cp.lld_adu.value()) self.d_subs['DO_CONST_THR'] = 'true' self.d_subs['THRESHOLD_NRMS'] = '0' self.d_subs['FNAME_PEDS_RMS'] = '' elif cp.lld_type.value() == 'RMS': self.d_subs['THRESHOLD_ADU'] = '0' self.d_subs['DO_CONST_THR'] = 'false' self.d_subs['THRESHOLD_NRMS'] = str(cp.lld_rms.value()) self.d_subs['FNAME_PEDS_RMS'] = fnm.path_pedestals_rms() else: self.d_subs['THRESHOLD_ADU'] = '0' self.d_subs['DO_CONST_THR'] = 'false' self.d_subs['THRESHOLD_NRMS'] = '0' self.d_subs['FNAME_PEDS_RMS'] = '' if os.path.lexists(fnm.path_cora_split_map_static_q()): self.d_subs['FNAME_MAP_BINS'] = fnm.path_cora_split_map_static_q() else: self.d_subs['FNAME_MAP_BINS'] = '' self.d_subs['FNAME_INT_BINS'] = fnm.path_cora_split_int_static_q() self.d_subs['NUMBER_OF_BINS'] = str(cp.ana_stat_part_q.value()) #self.print_substitution_dict() #self.make_cfg_file() txt_cfg = self.text_for_section() self.save_cfg_file(txt_cfg, self.path_out)
def make_psana_cfg_file_for_cora_split(self): self.str_of_modules = '' self.txt_cfg_header = '# Autogenerated config file for corana split\n' self.txt_cfg_body = '\n\n' self.add_cfg_module_tahometer() self.add_cfg_module_img_producer() self.add_cfg_trailer_for_cora_split() self.cfg_file_header_for_data_aver() self.save_cfg_file(self.txt_cfg_header + self.txt_cfg_body, fnm.path_cora_split_psana_cfg())
def make_psana_cfg_file_for_cora_split_v1 (self) : self.path_in = apputils.AppDataPath('CorAna/scripts/psana-cora-split.cfg').path() self.path_out = fnm.path_cora_split_psana_cfg() self.d_subs = {'FNAME_XTC' : fnm.path_data_xtc_cond(), 'SKIP' : str( cp.bat_data_start.value() - 1 ), 'EVENTS' : str( cp.bat_data_end.value() - cp.bat_data_start.value() + 1 ), 'IMG_REC_MODULE' : str( cp.bat_img_rec_mod.value() ), 'DETINFO' : str( cp.bat_det_info.value() ), 'PATH_PREFIX_CORA': str( fnm.path_prefix_cora() ), 'IMG_NPARTS' : str( cp.bat_img_nparts.value() ), 'FNAME_PEDS_AVE' : fnm.path_pedestals_ave(), 'FNAME_DATA_AVE' : fnm.path_data_ave(), 'FNAME_DATA_RMS' : fnm.path_data_rms() } fname_imon_cfg = fnm.path_cora_split_imon_cfg() self.make_imon_cfg_file (fname_imon_cfg) self.d_subs['FNAME_IMON_CFG' ] = str( fname_imon_cfg ) if cp.lld_type.value() == 'ADU' : # ['NONE', 'ADU', 'RMS'] self.d_subs['THRESHOLD_ADU' ] = str( cp.lld_adu.value() ) self.d_subs['DO_CONST_THR' ] = 'true' self.d_subs['THRESHOLD_NRMS'] = '0' self.d_subs['FNAME_PEDS_RMS'] = '' elif cp.lld_type.value() == 'RMS' : self.d_subs['THRESHOLD_ADU' ] = '0' self.d_subs['DO_CONST_THR' ] = 'false' self.d_subs['THRESHOLD_NRMS'] = str( cp.lld_rms.value() ) self.d_subs['FNAME_PEDS_RMS'] = fnm.path_pedestals_rms() else : self.d_subs['THRESHOLD_ADU' ] = '0' self.d_subs['DO_CONST_THR' ] = 'false' self.d_subs['THRESHOLD_NRMS'] = '0' self.d_subs['FNAME_PEDS_RMS'] = '' if os.path.lexists( fnm.path_cora_split_map_static_q() ) : self.d_subs['FNAME_MAP_BINS' ] = fnm.path_cora_split_map_static_q() else : self.d_subs['FNAME_MAP_BINS' ] = '' self.d_subs['FNAME_INT_BINS' ] = fnm.path_cora_split_int_static_q() self.d_subs['NUMBER_OF_BINS' ] = str( cp.ana_stat_part_q.value() ) #self.print_substitution_dict() #self.make_cfg_file() txt_cfg = self.text_for_section() self.save_cfg_file(txt_cfg, self.path_out)
def make_psana_cfg_file_for_cora_split (self) : self.path_in = apputils.AppDataPath('CorAna/scripts/psana-cora-split.cfg').path() self.path_out = fnm.path_cora_split_psana_cfg() self.d_subs = {'SKIP' : str( cp.bat_data_start.value() - 1 ), 'EVENTS' : str( cp.bat_data_end.value() - cp.bat_data_start.value() + 1 ), 'IMG_REC_MODULE' : str( cp.bat_img_rec_mod.value() ), 'DETINFO' : str( cp.bat_det_info.value() ), 'PATH_PREFIX_CORA': str( fnm.path_prefix_cora() ), 'IMG_NPARTS' : str( cp.bat_img_nparts.value() ) #'FILE_AVE' : fnm.path_data_ave(), #'FILE_RMS' : fnm.path_data_rms() } self.print_substitution_dict() self.make_cfg_file()
def make_psana_cfg_file_for_cora_split(self): self.path_in = apputils.AppDataPath( 'CorAna/scripts/psana-cora-split.cfg').path() self.path_out = fnm.path_cora_split_psana_cfg() self.d_subs = { 'SKIP': str(cp.bat_data_start.value() - 1), 'EVENTS': str(cp.bat_data_end.value() - cp.bat_data_start.value() + 1), 'IMG_REC_MODULE': str(cp.bat_img_rec_mod.value()), 'DETINFO': str(cp.bat_det_info.value()), 'PATH_PREFIX_CORA': str(fnm.path_prefix_cora()), 'IMG_NPARTS': str(cp.bat_img_nparts.value()) #'FILE_AVE' : fnm.path_data_ave(), #'FILE_RMS' : fnm.path_data_rms() } self.print_substitution_dict() self.make_cfg_file()