本文整理汇总了Python中BatchJobPedestals.start_auto_processing方法的典型用法代码示例。如果您正苦于以下问题:Python BatchJobPedestals.start_auto_processing方法的具体用法?Python BatchJobPedestals.start_auto_processing怎么用?Python BatchJobPedestals.start_auto_processing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BatchJobPedestals
的用法示例。
在下文中一共展示了BatchJobPedestals.start_auto_processing方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: CommandLineCalib
# 需要导入模块: import BatchJobPedestals [as 别名]
# 或者: from BatchJobPedestals import start_auto_processing [as 别名]
#.........这里部分代码省略.........
if self.process :
self.log(self.sep + 'Begin dark run data processing interactively',1)
else :
self.log(self.sep + '\nWARNING: FILE PROCESSING OPTION IS TURNED OFF...'\
+ '\nAdd "-P" option in the command line to process files\n',4)
return
self.bjpeds = BatchJobPedestals(self.runnum)
self.bjpeds.command_for_peds_scan()
self.print_list_of_types_and_sources_from_xtc()
if not self.bjpeds.command_for_peds_aver() :
msg = self.sep + 'STATUS OF PROCESSING IS NOT GOOD !!!'\
+'\nSee details in the logfile(s)'
self.log(msg,4)
#return
self.print_dark_ave_batch_log()
return
#------------------------------
def proc_dark_run_in_batch(self) :
if self.process :
self.log(self.sep + 'Begin dark run data processing in batch queue %s' % self.queue,1)
else :
self.log(self.sep + '\nWARNING: FILE PROCESSING OPTION IS TURNED OFF...'\
+ '\nAdd "-P" option in the command line to process files\n',4)
return
self.bjpeds = BatchJobPedestals(self.runnum)
self.bjpeds.start_auto_processing()
sum_dt=0
dt = 10 # sec
for i in range(50) :
sleep(dt)
sum_dt += dt
status = self.bjpeds.status_for_peds_files_essential()
self.log('%3d sec: Files %s available' % (sum_dt, {False:'ARE NOT', True:'ARE'}[status]),1)
if status :
self.print_dark_ave_batch_log()
return
print 'WARNING: Too many check cycles. Probably LSF is dead...'
#if self.bjpeds.autoRunStage :
#self.bjpeds.stop_auto_processing()
#------------------------------
def deploy_calib_files(self) :
#list_of_deploy_commands, list_of_sources = fdmets.get_list_of_deploy_commands_and_sources_dark(self.str_run_number, self.str_run_range)
#msg = self.sep + 'Tentative deployment commands:\n' + '\n'.join(list_of_deploy_commands)
#self.log(msg,1)
if self.deploy :
self.log(self.sep + 'Begin deployment of calibration files',1)
fdmets.deploy_calib_files(self.str_run_number, self.str_run_range, mode='calibrun-dark', ask_confirm=False)
self.log('\nDeployment of calibration files is completed',1)
else :
self.log(self.sep + '\nWARNING: FILE DEPLOYMENT OPTION IS TURNED OFF...'\
+'\nAdd "-D" option in the command line to deploy files\n',4)
示例2: GUIDarkListItemRun
# 需要导入模块: import BatchJobPedestals [as 别名]
# 或者: from BatchJobPedestals import start_auto_processing [as 别名]
#.........这里部分代码省略.........
#self.box_txt.setGeometry(self.contentsRect())
def moveEvent(self, e):
#logger.debug('moveEvent', __name__)
#cp.posGUIMain = (self.pos().x(),self.pos().y())
pass
def closeEvent(self, event):
logger.debug('closeEvent', __name__)
#self.saveLogTotalInFile() # It will be saved at closing of GUIMain
#try : cp.guimain.butLogger.setStyleSheet(cp.styleButtonBad)
#except : pass
#self.box_txt.close()
#try : del cp.guistatus # GUIDarkListItemRun
#except : pass
def onClose(self):
logger.info('onClose', __name__)
self.close()
def exportLocalPars(self):
"""Export local parameters to configuration current"""
cp.str_run_number.setValue(self.str_run_number)
#cp.str_run_from .setValue(self.str_run_from )
#cp.str_run_to .setValue(self.str_run_to )
def onButGo(self):
self.exportLocalPars()
self.but_depl.setVisible(False)
logger.info('onButGo', __name__)
but = self.but_go
but.setStyleSheet(cp.styleDefault)
if but.text() == 'Go' :
logger.info('onButGo for run %s' % self.str_run_number, __name__ )
but.setEnabled(False)
self.bjpeds.start_auto_processing()
if self.bjpeds.autoRunStage :
but.setText('Stop')
but.setEnabled(True)
elif but.text() == 'Stop' :
logger.info('onButStop for run %s' % self.str_run_number, __name__ )
self.bjpeds.stop_auto_processing()
but.setEnabled(True)
but.setText('Go')
but.setStyleSheet(cp.styleButtonWarning)
def onStop(self):
msg = 'onStop - buttons status should be updated now for %s' % (self.str_run_number)
logger.info(msg, __name__)
self.but_go.setEnabled(True)
self.but_go.setText('Go')
self.updateButtons()
def setStatusMessage(self):
pass
#if cp.guistatus is None : return
#cp.guistatus.setStatusMessage(msg)
def onButDeploy(self):
logger.debug('onButDeploy', __name__ )
fdmets.deploy_calib_files(self.str_run_number, self.strRunRange(), mode='calibman-dark', ask_confirm=True)
if cp.guistatus is not None : cp.guistatus.updateStatusInfo()
def strRunRange(self):
return self.guirunrange.getRunRange()
#---------
# deployment stuff from here moved to FileDeployer
#---------
def updateButtons(self, str_run_type='', comment='', xtc_in_dir=True) :
#logger.info('update', __name__)
self.str_run_type = str_run_type
self.comment = comment
self.xtc_in_dir = xtc_in_dir
self.lab_type.setText(str_run_type + ' ' + comment)
self.setFieldsEnabled(cp.det_name.value() != '' and self.xtc_in_dir)
示例3: GUIDarkListItemRun
# 需要导入模块: import BatchJobPedestals [as 别名]
# 或者: from BatchJobPedestals import start_auto_processing [as 别名]
#.........这里部分代码省略.........
def onEdiFrom(self):
logger.debug('onEdiFrom', __name__ )
self.str_run_from = str( self.edi_from.displayText() )
msg = 'Set the run validity range from %s' % self.str_run_from
logger.info(msg, __name__ )
self.setStatusMessage()
def onEdiTo(self):
logger.debug('onEdiTo', __name__ )
self.str_run_to = str( self.edi_to.displayText() )
msg = 'Set the run validity range up to %s' % self.str_run_to
logger.info(msg, __name__ )
self.setStatusMessage()
def exportLocalPars(self):
"""Export local parameters to configuration current"""
cp.str_run_number.setValue(self.str_run_number)
#cp.str_run_from .setValue(self.str_run_from )
#cp.str_run_to .setValue(self.str_run_to )
def onButGo(self):
self.exportLocalPars()
self.but_depl.setVisible(False)
but = self.but_go
but.setStyleSheet(cp.styleDefault)
if but.text() == 'Go' :
logger.info('onButGo for run %s' % self.str_run_number, __name__ )
self.bjpeds.start_auto_processing()
but.setText('Stop')
elif but.text() == 'Stop' :
logger.info('onButStop for run %s' % self.str_run_number, __name__ )
self.bjpeds.stop_auto_processing()
but.setText('Go')
but.setStyleSheet(cp.styleButtonBad)
def onStop(self):
self.but_go.setText('Go')
self.setStatusStyleOfButtons()
def setStatusMessage(self):
pass
#if cp.guistatus is None : return
#msg = 'From %s to %s use dark run %s' % (self.str_run_from.value(), self.str_run_to.value(), self.str_run_number.value())
#msg = gu.get_text_content_of_calib_dir_for_detector(path=self.calib_dir.value(), det=self.det_name.value(), calib_type='pedestals')
#cp.guistatus.setStatusMessage(msg)
def onButDeploy(self):
"""Deploys the calibration file(s)"""
list_of_deploy_commands = self.get_list_of_deploy_commands()
msg = 'Deploy calibration file(s):'
if list_of_deploy_commands == [] :
msg += 'List of commands IS EMPTY !!!'
logger.info(msg, __name__)
return
示例4: GUIDarkListItemRun
# 需要导入模块: import BatchJobPedestals [as 别名]
# 或者: from BatchJobPedestals import start_auto_processing [as 别名]
#.........这里部分代码省略.........
logger.debug('onEdiFrom', __name__ )
self.str_run_from = str( self.edi_from.displayText() )
msg = 'Set the run validity range from %s' % self.str_run_from
logger.info(msg, __name__ )
self.setStatusMessage()
def onEdiTo(self):
logger.debug('onEdiTo', __name__ )
self.str_run_to = str( self.edi_to.displayText() )
msg = 'Set the run validity range up to %s' % self.str_run_to
logger.info(msg, __name__ )
self.setStatusMessage()
def exportLocalPars(self):
"""Export local parameters to configuration current"""
cp.str_run_number.setValue(self.str_run_number)
#cp.str_run_from .setValue(self.str_run_from )
#cp.str_run_to .setValue(self.str_run_to )
def onButGo(self):
self.exportLocalPars()
self.but_depl.setVisible(False)
but = self.but_go
but.setStyleSheet(cp.styleDefault)
if but.text() == 'Go' :
logger.info('onButGo for run %s' % self.str_run_number, __name__ )
but.setEnabled(False)
self.bjpeds.start_auto_processing()
but.setText('Stop')
but.setEnabled(True)
elif but.text() == 'Stop' :
logger.info('onButStop for run %s' % self.str_run_number, __name__ )
self.bjpeds.stop_auto_processing()
but.setEnabled(True)
but.setText('Go')
but.setStyleSheet(cp.styleButtonWarning)
def onStop(self):
msg = 'onStop - buttons status should be updated now for %s' % (self.str_run_number)
logger.info(msg, __name__)
self.but_go.setEnabled(True)
self.but_go.setText('Go')
#self.setStatusStyleOfButtons()
self.updateButtons()
def setStatusMessage(self):
pass
#if cp.guistatus is None : return
#cp.guistatus.setStatusMessage(msg)
def onButDeploy(self):
"""Deploys the calibration file(s)"""
list_of_deploy_commands, list_of_sources = self.get_list_of_deploy_commands_and_sources()
msg = 'Deploy calibration file(s):'
示例5: CommandLineCalib
# 需要导入模块: import BatchJobPedestals [as 别名]
# 或者: from BatchJobPedestals import start_auto_processing [as 别名]
#.........这里部分代码省略.........
+ '\n det_name : %s' % self.det_name \
+ '\n queue : %s' % self.queue \
+ '\n num_events : %d' % self.num_events \
+ '\n skip_events : %d' % self.skip_events \
+ '\n thr_rms : %f' % self.thr_rms \
+ '\n process : %s' % self.process \
+ '\n deploy : %s' % self.deploy
#+ '\nself.logfile : ' % self.logfile
#------------------------------
def print_command_line_pars(self, args, opts) :
print '\nprint_command_line_pars(...):'
print 'args:', args
print 'opts:', opts
#print 'args:\n', ', '.join(args)
#for k,v in opts.iteritems():
# print '%s : %s' % (k.ljust(16),v)
#------------------------------
def proc_dark_run_in_batch(self) :
if self.process :
print '\n' + 50*'-' + '\nBegin dark run data processing in batch queue %s' % self.queue
else :
print '\n' + 50*'-' + '\nWARNING: File processing option IS TURNED OFF... \nAdd "-P" option in the command line to process files'
return
self.bjpeds = BatchJobPedestals(self.runnum)
self.bjpeds.start_auto_processing()
sum_dt=0
dt = 10 # sec
for i in range(50) :
sleep(dt)
sum_dt += dt
status = self.bjpeds.status_for_peds_files_essential()
print '%3d sec: Files %s available' % (sum_dt, {False:'ARE NOT', True:'ARE'}[status])
if status : break
print 'WARNING: Too many check cycles. Probably LSF is dead...'
#if self.bjpeds.autoRunStage :
#self.bjpeds.stop_auto_processing()
#------------------------------
def deploy_calib_files(self) :
list_of_deploy_commands, list_of_sources = fdmets.get_list_of_deploy_commands_and_sources_dark(self.str_run_number, self.str_run_range)
msg = '\n' + 50*'-' + '\nTentative deployment commands:\n' + '\n'.join(list_of_deploy_commands)
print msg
if self.deploy :
print '\n' + 50*'-' + '\nBegin deployment of calibration files'
fdmets.deploy_calib_files(self.str_run_number, self.str_run_range, mode='calibrun-dark', ask_confirm=False)
else :
print '\n' + 50*'-' + '\nWARNING: File deployment option IS TURNED OFF... \nAdd "-D" option in the command line to deploy files'
#------------------------------
# def submit_job_in_batch(self) :