def preLoopFunctions(self):
		self.dd = apDDprocess.initializeDDFrameprocess(self.params['sessionname'],self.params['wait'])
		self.dd.setUseGS(self.params['useGS'])
		self.dd.setRunDir(self.params['rundir'])
		self.dd.setTempDir(self.params['tempdir'])
		self.dd.setRawFrameType(self.getFrameType())
		self.dd.setUseGPUFlat(True)
		self.dd.setSquareOutputShape(self.params['square'])
		self.dd.setTrimingEdge(self.params['trim'])
		self.dd.setDoseFDriftCorrOptions(self.params)
		self.dd.setGPUid(self.params['gpuid'])
		# keepstack is resolved for various cases in conflict check.  There should be no ambiguity by now
		self.dd.setKeepStack(self.params['keepstack'])
		self.dd.setCycleReferenceChannels(self.params['cyclechannels'])
		
		if self.params['refimgid']:
			self.dd.setDefaultImageForReference(self.params['refimgid'])
		self.imageids = []
		if self.params['stackid']:
			# create a list of unaligned imageids from the particle stack
			imageids_from_stack = apStack.getImageIdsFromStack(self.params['stackid'])
			self.imageids = self.getUnAlignedImageIds(imageids_from_stack)
		# Optimize AppionLoop wait time for this since the processing now takes longer than
		# image acquisition
		self.setWaitSleepMin(0.4)
		self.setProcessBatchCount(1)
Esempio n. 2
0
    def preLoopFunctions(self):
        self.dd = apDDprocess.initializeDDFrameprocess(
            self.params['sessionname'], self.params['wait'])
        self.dd.setRunDir(self.params['rundir'])
        self.dd.setDoseFDriftCorrOptions(self.params)
        self.dd.setGPUid(self.params['gpuid'])
        # keepstack is resolved for various cases in conflict check.  There should be no ambiguity by now
        self.dd.setKeepStack(self.params['keepstack'])

        self.gain_corrected_ddproc = None
        self.imageids = []
        if self.params['stackid']:
            # create a list of unaligned imageids from the particle stack
            imageids_from_stack = apStack.getImageIdsFromStack(
                self.params['stackid'])
            self.imageids = self.getUnAlignedImageIds(imageids_from_stack)
            if not self.params['ddstack']:
                print 'This does not work yet.  Need to create gain-corrected-ddstack first'
        if self.params['ddstack']:
            self.gain_corrected_ddproc = apDDprocess.DDStackProcessing()
            self.gain_corrected_ddproc.setDDStackRun(
                ddstackrunid=self.params['ddstack'])
        # Optimize AppionLoop wait time for this since the processing now takes longer than
        # image acquisition
        self.setWaitSleepMin(0.4)
        self.setProcessBatchCount(1)
Esempio n. 3
0
    def onInit(self):
        if 'sessionname' not in self.params.keys():
            self.params['sessionname'] = leginondata.SessionData(
            ).direct_query(self.params['expid'])['name']
        self.dd = apDDprocess.initializeDDFrameprocess(
            self.params['sessionname'], self.params['wait'])
        self.dd.setRunDir(self.params['rundir'])
        # The gain/dark corrected ddstack is unlikely to be on local disk
        if 'tempdir' not in self.params.keys():
            self.dd.setTempDir()
        else:
            self.dd.setTempDir(self.params['tempdir'])
        self.dd.setNewBinning(self.rundata['params']['bin'])

        # Get the unfinished ddstack run parameters to apply them here
        jobdata = apDatabase.getJobDataFromPathAndType(
            self.rundata['path']['path'], 'makeddrawframestack')
        self.ddstack_script_params = apScriptLog.getScriptParamValuesFromRunname(
            self.rundata['runname'], self.rundata['path'], jobdata)
        if 'no-keepstack' in self.ddstack_script_params.keys():
            self.dd.setKeepStack(False)
        self.dd.setDoseFDriftCorrOptions(self.ddstack_script_params)
        # Give an unique lockname
        self.setLockname('ddalign')
        self.success_count = 0
    def preLoopFunctions(self):
        self.is_dd_frame = False
        self.is_dd_stack = False
        self.is_dd = False
        self.checkIsDD()
        self.batchboxertimes = []
        self.ctftimes = []
        self.mergestacktimes = []
        self.meanreadtimes = []
        self.insertdbtimes = []
        self.noimages = False
        self.totalpart = 0
        self.selectiondata = None
        # Different class needed depending on if ddstack is specified or available
        if self.is_dd:
            from appionlib import apDDprocess
        if self.is_dd_frame:
            apDisplay.printMsg('DD Frame Processing')
            self.dd = apDDprocess.initializeDDFrameprocess(
                self.params['sessionname'])
            self.dd.setUseGS(self.params['useGS'])
        if self.is_dd_stack:
            apDisplay.printMsg('DD Stack Processing')
            self.dd = apDDprocess.DDStackProcessing()

        if len(self.imgtree) == 0:
            apDisplay.printWarning("No images were found to process")
            self.noimages = True
            # Still need to set attributes if waiting for more images
            if not self.params['wait']:
                return
        if self.params['selectionid'] is not None:
            self.selectiondata = apParticle.getSelectionRunDataFromID(
                self.params['selectionid'])
            if self.params['particlelabel'] == 'fromtrace':
                if (not self.selectiondata['manparams']
                        or not self.selectiondata['manparams']['trace']):
                    apDisplay.printError(
                        "Can not use traced object center to extract boxed area without tracing"
                    )
                else:
                    self.params['particlelabel'] = '_trace'
        self.checkPixelSize()
        self.existingParticleNumber = 0
        self.setStartingParticleNumber()
        apDisplay.printMsg("Starting at particle number: " +
                           str(self.particleNumber))

        if self.params[
                'partlimit'] is not None and self.particleNumber > self.params[
                    'partlimit']:
            apDisplay.printError(
                "Number of particles in existing stack already exceeds limit!")
        self.logpeaks = 2
Esempio n. 5
0
	def preLoopFunctions(self):
		self.dd = apDDprocess.initializeDDFrameprocess(self.params['sessionname'],self.params['wait'])
		self.dd.setRunDir(self.params['rundir'])
		self.dd.setRawFrameType(self.getFrameType())
		self.dd.setDoseFDriftCorrOptions(self.params)

		self.exposurerate_is_default = self.params['radiationdamage_exposurerate'] == 1.0
		
		self.imageids = []
		# Optimize AppionLoop wait time for this since the processing now takes longer than
		# image acquisition
		self.setWaitSleepMin(0.4)
		self.setProcessBatchCount(1)
		self.params['output_fileformat'] = 'mrc'
	def preLoopFunctions(self):
		self.is_dd_frame = False
		self.is_dd_stack = False
		self.is_dd = False
		self.checkIsDD()
		self.batchboxertimes = []
		self.ctftimes = []
		self.mergestacktimes = []
		self.meanreadtimes = []
		self.insertdbtimes = []
		self.noimages = False
		self.totalpart = 0
		self.selectiondata = None
		# Different class needed depending on if ddstack is specified or available
		if self.is_dd:
			from appionlib import apDDprocess
		if self.is_dd_frame:
			apDisplay.printMsg('DD Frame Processing')
			self.dd = apDDprocess.initializeDDFrameprocess(self.params['sessionname'])
			self.dd.setUseGS(self.params['useGS'])
		if self.is_dd_stack:
			apDisplay.printMsg('DD Stack Processing')
			self.dd = apDDprocess.DDStackProcessing()

		if len(self.imgtree) == 0:
			apDisplay.printWarning("No images were found to process")
			self.noimages = True
			# Still need to set attributes if waiting for more images
			if not self.params['wait']:
				return
		if self.params['selectionid'] is not None:
			self.selectiondata = apParticle.getSelectionRunDataFromID(self.params['selectionid'])
			if self.params['particlelabel'] == 'fromtrace':
				if (not self.selectiondata['manparams'] or not self.selectiondata['manparams']['trace']):
					apDisplay.printError("Can not use traced object center to extract boxed area without tracing")
				else:
					self.params['particlelabel'] = '_trace'
		self.checkPixelSize()
		self.existingParticleNumber=0
		self.setStartingParticleNumber()
		apDisplay.printMsg("Starting at particle number: "+str(self.particleNumber))

		if self.params['partlimit'] is not None and self.particleNumber > self.params['partlimit']:
			apDisplay.printError("Number of particles in existing stack already exceeds limit!")
		self.logpeaks = 2
 def onInit(self):
         if 'sessionname' not in self.params.keys():
                 self.params['sessionname'] = leginondata.SessionData().direct_query(self.params['expid'])['name']
         self.dd = apDDprocess.initializeDDFrameprocess(self.params['sessionname'],self.params['wait'])
         self.dd.setRunDir(self.params['rundir'])
         # The gain/dark corrected ddstack is unlikely to be on local disk
         if 'tempdir' not in self.params.keys():
                 self.dd.setTempDir()
         else:
                 self.dd.setTempDir(self.params['tempdir'])
         self.dd.setNewBinning(self.rundata['params']['bin'])
 
         # Get the unfinished ddstack run parameters to apply them here
         jobdata = apDatabase.getJobDataFromPathAndType(self.rundata['path']['path'], 'makeddrawframestack')
         self.ddstack_script_params = apScriptLog.getScriptParamValuesFromRunname(self.rundata['runname'],self.rundata['path'],jobdata)
         if 'no-keepstack' in self.ddstack_script_params.keys():
                 self.dd.setKeepStack(False)
         # Give an unique lockname
         self.setLockname('ddalign')
         self.success_count = 0
 def preLoopFunctions(self):
         self.dd = apDDprocess.initializeDDFrameprocess(self.params['sessionname'],self.params['wait'])
         self.dd.setUseGS(self.params['useGS'])
         self.dd.setRunDir(self.params['rundir'])
         self.dd.setTempDir(self.params['tempdir'])
         self.dd.setRawFrameType(self.getFrameType())
         self.dd.setUseGPUFlat(self.params['gpuflat'])
         self.dd.setGPUid(self.params['gpuid'])
         # keepstack is resolved for various cases in conflict check.  There should be no ambiguity by now
         self.dd.setKeepStack(self.params['keepstack'])
         self.dd.setCycleReferenceChannels(self.params['cyclechannels'])
         
         if self.params['refimgid']:
                 self.dd.setDefaultImageForReference(self.params['refimgid'])
         self.imageids = []
         if self.params['stackid']:
                 self.imageids = apStack.getImageIdsFromStack(self.params['stackid'])
         # Optimize AppionLoop wait time for this since the processing now takes longer than
         # image acquisition
         self.setWaitSleepMin(0.4)
         self.setProcessBatchCount(1)
    def preLoopFunctions(self):
        self.dd = apDDprocess.initializeDDFrameprocess(self.params["sessionname"], self.params["wait"])
        self.dd.setRunDir(self.params["rundir"])
        self.dd.setDoseFDriftCorrOptions(self.params)
        self.dd.setGPUid(self.params["gpuid"])
        # keepstack is resolved for various cases in conflict check.  There should be no ambiguity by now
        self.dd.setKeepStack(self.params["keepstack"])

        self.gain_corrected_ddproc = None
        self.imageids = []
        if self.params["stackid"]:
            # create a list of unaligned imageids from the particle stack
            imageids_from_stack = apStack.getImageIdsFromStack(self.params["stackid"])
            self.imageids = self.getUnAlignedImageIds(imageids_from_stack)
            if not self.params["ddstack"]:
                print "This does not work yet.  Need to create gain-corrected-ddstack first"
        if self.params["ddstack"]:
            self.gain_corrected_ddproc = apDDprocess.DDStackProcessing()
            self.gain_corrected_ddproc.setDDStackRun(ddstackrunid=self.params["ddstack"])
            # Optimize AppionLoop wait time for this since the processing now takes longer than
            # image acquisition
        self.setWaitSleepMin(0.4)
        self.setProcessBatchCount(1)