def submit_batch_for_peds_scan(self): self.exportLocalPars() if not self.job_can_be_submitted(self.job_id_scan_str, self.time_scan_job_submitted, 'scan'): return self.time_scan_job_submitted = gu.get_time_sec() cfg.make_psana_cfg_file_for_peds_scan() command = 'psana -c ' + fnm.path_peds_scan_psana_cfg( ) + ' ' + fnm.path_to_xtc_files_for_run() # fnm.path_dark_xtc_cond() queue = self.queue.value() bat_log_file = fnm.path_peds_scan_batch_log() #print 'command :', command #print 'queue :', queue #print 'bat_log_file:', bat_log_file self.job_id_scan_str, out, err = gu.batch_job_submit( command, queue, bat_log_file) self.procDarkStatus ^= 1 # set bit to 1 if err != '': self.stop_auto_processing(is_stop_on_button_click=False) logger.warning( 'Autoprocessing for run %s is stopped due to batch submission error!!!' % self.str_run_number, __name__)
def make_psana_cfg_file_for_peds_scan (self) : self.path_in = apputils.AppDataPath('CalibManager/scripts/psana-scan.cfg').path() self.d_subs = {'FNAME_XTC' : self.path_to_data_files(), 'SKIP' : str( cp.bat_dark_start.value() - 1 ), 'EVENTS' : str( cp.bat_dark_scan.value() ), } txt_cfg = self.text_for_section () self.save_cfg_file(txt_cfg, fnm.path_peds_scan_psana_cfg())
def make_psana_cfg_file_for_peds_scan (self) : self.path_in = apputils.AppDataPath('CalibManager/scripts/psana-scan.cfg').path() self.d_subs = {'FNAME_XTC' : self.path_to_data_files(), 'SKIP' : '0', 'EVENTS' : '10', } txt_cfg = self.text_for_section () self.save_cfg_file(txt_cfg, fnm.path_peds_scan_psana_cfg())
def make_psana_cfg_file_for_peds_scan (self) : self.path_in = apputils.AppDataPath('CorAna/scripts/psana-peds-scan.cfg').path() self.path_out = fnm.path_peds_scan_psana_cfg() self.d_subs = {'SKIP' : 'IS_NOT_USED', 'EVENTS' : 'FOR_ALL_EVENTS', 'FNAME_TIMESTAMP_LIST' : fnm.path_peds_scan_tstamp_list() } self.print_substitution_dict() self.make_cfg_file()
def make_psana_cfg_file_for_peds_scan (self) : self.path_in = apputils.AppDataPath('CalibManager/scripts/psana-peds-scan.cfg').path() self.path_out = fnm.path_peds_scan_psana_cfg() self.d_subs = {'FNAME_XTC' : str(fnm.path_to_xtc_files_for_run()), 'SKIP' : 'IS_NOT_USED', 'EVENTS' : 'FOR_ALL_EVENTS', } self.print_substitution_dict() self.make_cfg_file()
def make_psana_cfg_file_for_peds_scan (self) : self.path_in = apputils.AppDataPath('CorAna/scripts/psana-peds-scan.cfg').path() self.path_out = fnm.path_peds_scan_psana_cfg() self.d_subs = {'FNAME_XTC' : fnm.path_dark_xtc_cond(), 'SKIP' : 'IS_NOT_USED', 'EVENTS' : 'FOR_ALL_EVENTS', 'FNAME_TIMESTAMP_LIST' : fnm.path_peds_scan_tstamp_list() } self.print_substitution_dict() self.make_cfg_file()
def make_psana_cfg_file_for_peds_scan(self): self.path_in = apputils.AppDataPath( 'CalibManager/scripts/psana-peds-scan.cfg').path() self.path_out = fnm.path_peds_scan_psana_cfg() self.d_subs = { 'FNAME_XTC': str(fnm.path_to_xtc_files_for_run()), 'SKIP': 'IS_NOT_USED', 'EVENTS': 'FOR_ALL_EVENTS', } self.print_substitution_dict() self.make_cfg_file()
def on_but_view(self): self.exportLocalPars() logger.debug('on_but_view', __name__) try : cp.guifilebrowser.close() #self.but_view.setStyleSheet(cp.styleButtonBad) except : #self.but_view.setStyleSheet(cp.styleButtonGood) cp.guifilebrowser = GUIFileBrowser(None, self.get_list_of_files_peds(), fnm.path_peds_scan_psana_cfg()) cp.guifilebrowser.move(self.pos().__add__(QtCore.QPoint(880,40))) # open window with offset w.r.t. parent cp.guifilebrowser.show()
def make_psana_cfg_file_for_peds_scan (self) : self.path_in = apputils.AppDataPath('CorAna/scripts/psana-peds-scan.cfg').path() self.path_out = fnm.path_peds_scan_psana_cfg() self.d_subs = {'FNAME_XTC' : fnm.path_dark_xtc_cond(), 'SKIP' : 'IS_NOT_USED', 'EVENTS' : 'FOR_ALL_EVENTS', 'FNAME_TIMESTAMP_LIST' : fnm.path_peds_scan_tstamp_list() } #self.print_substitution_dict() #self.make_cfg_file() txt_cfg = self.text_for_section() self.save_cfg_file(txt_cfg, self.path_out)
def command_for_peds_scan(self) : cfg.make_psana_cfg_file_for_peds_scan() #command = 'env' command = 'psana -c ' + fnm.path_peds_scan_psana_cfg() + self.opt command_seq = command.split() msg = 'Scan xtc file(s) using command:\n%s' % command \ + '\nand save results in the log-file: %s' % fnm.path_peds_scan_batch_log() logger.info(msg, __name__) err = gu.subproc_in_log(command_seq, fnm.path_peds_scan_batch_log()) # , shell=True) if err != '' : logger.error('\nerr: %s' % (err), __name__) self.stop_auto_processing(is_stop_on_button_click=False) logger.warning('Autoprocessing for run %s is stopped due to error at execution of the scan command' % self.str_run_number, __name__) else : logger.info('Scan for run %s is completed' % self.str_run_number, __name__)
def submit_batch_for_peds_scan(self) : self.exportLocalPars() if not self.job_can_be_submitted(self.job_id_scan_str, self.time_scan_job_submitted, 'scan') : return self.time_scan_job_submitted = gu.get_time_sec() cfg.make_psana_cfg_file_for_peds_scan() command = 'psana -c ' + fnm.path_peds_scan_psana_cfg() + ' ' + fnm.path_to_xtc_files_for_run() # fnm.path_dark_xtc_cond() queue = self.queue.value() bat_log_file = fnm.path_peds_scan_batch_log() #print 'command :', command #print 'queue :', queue #print 'bat_log_file:', bat_log_file self.job_id_scan_str, out, err = gu.batch_job_submit(command, queue, bat_log_file) self.procDarkStatus ^= 1 # set bit to 1 if err != '' : self.stop_auto_processing(is_stop_on_button_click=False) logger.warning('Autoprocessing for run %s is stopped due to batch submission error!!!' % self.str_run_number, __name__)