def preProcess(self, _edPlugin=None): """ This method prepares the input for the CCP4i plugin and loads it. """ EDPluginControl.preProcess(self, _edPlugin) self.DEBUG("EDPluginControlInterfaceToMXCuBEv1_3.preProcess...") self.tStart = time.time() xsDataInputMXCuBE = self.getDataInput() xsDataInputInterface = XSDataInputInterface() self.edPluginControlInterface = self.loadPlugin( self.strPluginControlInterface) for xsDataSetMXCuBE in xsDataInputMXCuBE.getDataSet(): for xsDataFile in xsDataSetMXCuBE.getImageFile(): xsDataInputInterface.addImagePath(xsDataFile) xsDataInputInterface.setExperimentalCondition( xsDataInputMXCuBE.getExperimentalCondition()) xsDataInputInterface.setDiffractionPlan( xsDataInputMXCuBE.getDiffractionPlan()) xsDataInputInterface.setSample(xsDataInputMXCuBE.getSample()) xsDataInputInterface.setDataCollectionId( xsDataInputMXCuBE.getDataCollectionId()) self.edPluginControlInterface.setDataInput(xsDataInputInterface) #self.edPluginExecOutputHTML = self.loadPlugin(self.strPluginExecOutputHTMLName, "OutputHTML") self.edPluginExecSimpleHTML = self.loadPlugin( self.strPluginExecSimpleHTMLName, "SimpleHTML") self.xsDataResultMXCuBE = XSDataResultMXCuBE()
def process(self, _edPlugin=None): EDPluginControl.process(self, _edPlugin) self.DEBUG("EDPluginControlInterfaceToMXCuBEv1_3.process...") xsDataInputMXCuBE = self.getDataInput() xsDataInputInterface = XSDataInputInterface() self.edPluginControlInterface = self.loadPlugin( self.strPluginControlInterface) xsDataFirstImage = None for xsDataSetMXCuBE in xsDataInputMXCuBE.getDataSet(): for xsDataFile in xsDataSetMXCuBE.getImageFile(): xsDataInputInterface.addImagePath(xsDataFile) if xsDataFirstImage is None: xsDataFirstImage = xsDataFile xsDataExperimentalCondition = self.getFluxAndBeamSizeFromISPyB(xsDataFirstImage, \ xsDataInputMXCuBE.getExperimentalCondition()) xsDataInputInterface.setExperimentalCondition( xsDataExperimentalCondition) xsDataInputInterface.setDiffractionPlan( xsDataInputMXCuBE.getDiffractionPlan()) xsDataInputInterface.setSample(xsDataInputMXCuBE.getSample()) xsDataInputInterface.setDataCollectionId( xsDataInputMXCuBE.getDataCollectionId()) self.edPluginControlInterface.setDataInput(xsDataInputInterface) if self.edPluginControlInterface is not None: self.connectProcess( self.edPluginControlInterface.executeSynchronous) self.edPluginControlInterface.connectSUCCESS( self.doSuccessActionInterface) self.edPluginControlInterface.connectFAILURE( self.doFailureActionInterface)
def functionXMLin(_strFilename): """Here we create the XML string to be passed to the EDNA plugin from the input strFilename This can / should be modified by the final user @param _strFilename: full path of the input file @type _strFilename: python string representing the path @return: string """ EDVerbose.screen("Starting processing of image %s" % (_strFilename)) # First check if the filename end with .img or .mccd: strXML = None if (_strFilename.endswith(".img") or _strFilename.endswith(".mccd") or _strFilename.endswith(".cbf")): xsDataInputInterface = XSDataInputInterface() xsDataDiffractionPlan = XSDataDiffractionPlan() xsDataDiffractionPlan.setMaxExposureTimePerDataCollection(XSDataTime(EDParallelExecuteMXv1Characterisation.m_fMaxExposureTime)) xsDataInputInterface.setDiffractionPlan(xsDataDiffractionPlan) xsDataFile = XSDataFile() xsDataFile.setPath(XSDataString(_strFilename)) xsDataInputInterface.addImagePath(xsDataFile) strXML = xsDataInputInterface.marshal() else: EDVerbose.screen("File name not ending with .img or .mccd - ignored : %s" % _strFilename) return strXML