当前位置: 首页>>代码示例>>Python>>正文


Python XSDataMXv1.XSDataCollection类代码示例

本文整理汇总了Python中XSDataMXv1.XSDataCollection的典型用法代码示例。如果您正苦于以下问题:Python XSDataCollection类的具体用法?Python XSDataCollection怎么用?Python XSDataCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了XSDataCollection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: createDataCollectionFromDataFiles

 def createDataCollectionFromDataFiles(self, _pyListXSDataFile):
     """
     This method takes as input a list of paths to XML data files. It parses
     these files and create a single XSDataCollection object.
     """
     EDVerbose.DEBUG("EDPluginControlCCP4iv10.createDataCollectionFromDataFiles")
     xsDataCollection = None
     xsDataCollectionCurrent = None
     for xsDataInputFile in _pyListXSDataFile:
         try:
             strInputFileContent = EDUtilsFile.readFile(xsDataInputFile.getPath().getValue())
             xsDataCollectionCurrent = XSDataCollection.parseString(strInputFileContent)
         except Exception, detail:
             errorMessage = EDMessage.ERROR_EXECUTION_03 % ('EDPluginControlCCP4iv10.preProcess', 'EDPluginControlCCP4iv10', detail)
             EDVerbose.error(errorMessage)
             self.addErrorMessage(errorMessage)
             self.setFailure()
         if (xsDataCollectionCurrent is None):
             errorMessage = EDMessage.ERROR_EXECUTION_03 % ('EDPluginControlCCP4iv10.preProcess', 'EDPluginControlCCP4iv10', "None data collection")
             EDVerbose.error(errorMessage)
             self.addErrorMessage(errorMessage)
             self.setFailure()
         else:
             # Instantiate the xsDataCollection object if it's not already done.  
             if (xsDataCollection is None):
                 xsDataCollection = XSDataCollection()
             for xsDataSubWedge in xsDataCollectionCurrent.getSubWedge():
                 xsDataCollection.addSubWedge(xsDataSubWedge)
开发者ID:antolinos,项目名称:edna,代码行数:28,代码来源:EDPluginControlCCP4iv10.py

示例2: doXdsIndexingIntegration

    def doXdsIndexingIntegration(self, _xsDataCollection):
        # Load the plugin
        self._edPluginIndexing = self.loadPlugin(self._strIndexingPluginName, "Indexing")
        # XDS Indexing
        xsDataIndexingInput = XSDataIndexingInput()
        xsDataIndexingInput.setDataCollection(_xsDataCollection)
        self._edPluginIndexing.dataInput = EDHandlerXSDataXDSv1_0.generateXSDataInputXDSIndexing(xsDataIndexingInput)
        self._edPluginIndexing.executeSynchronous()
        xsDataResultXDSIndexing = self._edPluginIndexing.dataOutput
        if xsDataResultXDSIndexing.spaceGroupNumber is not None:
            spaceGroupNumber = xsDataResultXDSIndexing.spaceGroupNumber.value
            unitCell = xsDataResultXDSIndexing.unitCell
            filePaths = xsDataResultXDSIndexing.filePaths
            index = 1
            for subWedge in _xsDataCollection.subWedge:
                xsDataCollection = XSDataCollection()
                xsDataCollection.addSubWedge(subWedge)
                xsDataIndexingInput = XSDataIndexingInput()
                xsDataIndexingInput.setDataCollection(xsDataCollection)

                xsDataInputXDSIntegration = EDHandlerXSDataXDSv1_0.generateXSDataInputXDSIntegration(xsDataIndexingInput,
                                                                                                     spaceGroupNumber,
                                                                                                     unitCell,
                                                                                                     filePaths)
                edPluginIntegration = self.loadPlugin(self._strIntegrationPluginName, "Integration_{0}".format(index))
                edPluginIntegration.dataInput = xsDataInputXDSIntegration
                edPluginIntegration.executeSynchronous()
                # self._edPluginIntegration.dataInput = xsDataInputXDSIntegration
                index += 1
开发者ID:IvarsKarpics,项目名称:edna-mx,代码行数:29,代码来源:EDPluginControlCharacterisationv1_6.py

示例3: preProcess

    def preProcess(self, _edObject=None):
        """
        Gets the Configuration Parameters, if found, overrides default parameters
        """
        EDPluginControl.preProcess(self, _edObject)
        self.DEBUG("EDPluginControlGeneratePredictionv10.preProcess...")

        xsDataGeneratePredictionInput = self.getDataInput()

        xsDataSelectedIndexingSolution = xsDataGeneratePredictionInput.getSelectedIndexingSolution()
        xsDataExperimentalConditionRefined = xsDataSelectedIndexingSolution.getExperimentalConditionRefined()
        xsDataCollection = xsDataGeneratePredictionInput.getDataCollection()
        xsDataSubWedgeList = xsDataCollection.getSubWedge()

        # List containing instances of all the generate prediction plugins
        self.__listPluginGeneratePrediction = []

        # Loop through all subwedges
        iIndex = 0
        for xsDataSubWedge in xsDataSubWedgeList:

            xsDataImageList = xsDataSubWedge.getImage()
            # First find the lowest image number
            iLowestImageNumber = None
            for xsDataImage in xsDataImageList:
                iImageNumber = xsDataImage.getNumber().getValue()
                if (iLowestImageNumber is None):
                    iLowestImageNumber = iImageNumber
                elif (iImageNumber < iLowestImageNumber):
                    iLowestImageNumber = iImageNumber
            # Then loop through all images in a sub wedge
            for xsDataImage in xsDataImageList:
                iIndex += 1
                edPluginGeneratePrediction = self.loadPlugin(self.__strPluginGeneratePredictionName,
                                                              "%s-%02d" % (self.__strPluginGeneratePredictionName, iIndex))
                xsDataGeneratePredictionInput = XSDataGeneratePredictionInput()
                xsDataGeneratePredictionInput.setSelectedIndexingSolution(XSDataIndexingSolutionSelected.parseString(xsDataSelectedIndexingSolution.marshal()))
                xsDataCollectionNew = XSDataCollection()
                xsDataSubWedgeNew = XSDataSubWedge()
                xsDataSubWedgeNew.addImage(XSDataImage.parseString(xsDataImage.marshal()))
                xsDataSubWedgeNew.setExperimentalCondition(XSDataExperimentalCondition.parseString(xsDataSubWedge.getExperimentalCondition().marshal()))
                # We must modify the rotationOscillationStart for the new subwedge
                xsDataGoniostatNew = xsDataSubWedgeNew.getExperimentalCondition().getGoniostat()
                fGoniostatRotationAxisStart = xsDataGoniostatNew.getRotationAxisStart().getValue()
                fGonioStatOscillationRange = xsDataGoniostatNew.getOscillationWidth().getValue()
                iImageNumber = xsDataImage.getNumber().getValue()
                fGoniostatRotationAxisStartNew = fGoniostatRotationAxisStart + (iImageNumber - iLowestImageNumber) * fGonioStatOscillationRange
                xsDataGoniostatNew.setRotationAxisStart(XSDataAngle(fGoniostatRotationAxisStartNew))
                # 
                xsDataCollectionNew.addSubWedge(xsDataSubWedgeNew)
                xsDataGeneratePredictionInput.setDataCollection(xsDataCollectionNew)
                from EDHandlerXSDataMOSFLMv10 import EDHandlerXSDataMOSFLMv10
                xsDataMOSFLMInputGeneratePrediction = EDHandlerXSDataMOSFLMv10.generateXSDataMOSFLMInputGeneratePrediction(xsDataGeneratePredictionInput)
                edPluginGeneratePrediction.setDataInput(xsDataMOSFLMInputGeneratePrediction)
                self.__listPluginGeneratePrediction.append(edPluginGeneratePrediction)
开发者ID:IvarsKarpics,项目名称:edna-mx,代码行数:55,代码来源:EDPluginControlGeneratePredictionv10.py

示例4: preProcess

    def preProcess(self, _edObject=None):
        """
        Gets the Configuration Parameters, if found, overrides default parameters
        """
        EDPluginControl.preProcess(self, _edObject)
        self.DEBUG("EDPluginControlIntegrationv10.preProcess...")

        xsDataIntegrationInput = self.getDataInput()
        xsDataSelectedIndexingSolution = xsDataIntegrationInput.getSelectedIndexingSolution()
        self.__xsDataExperimentalConditionRefined = xsDataIntegrationInput.getExperimentalConditionRefined()
        # To be changed (see bug #40)
        if (self.__xsDataExperimentalConditionRefined is None):
            self.__xsDataExperimentalConditionRefined = xsDataSelectedIndexingSolution.getExperimentalConditionRefined()
        xsDataCollection = xsDataIntegrationInput.getDataCollection()
        xsDataSubWedgeList = xsDataCollection.getSubWedge()

        self.__edPluginIntegrationList = []

        iIndex = 0
        for xsDataSubWedge in xsDataSubWedgeList:
            iSubWedgeNumber = iIndex
            if (xsDataSubWedge.getSubWedgeNumber() is not None):
                # Use the incoming subwedge number if it exists
                iSubWedgeNumber = xsDataSubWedge.getSubWedgeNumber().getValue()

            edPluginIntegration = self.loadPlugin(self.__strPluginIntegrationName)

            if (not edPluginIntegration is None):
                iIndex += 1
                xsDataIntegrationInputSubWedge = XSDataIntegrationInput()
                xsDataIntegrationInputSubWedge.setSelectedIndexingSolution(XSDataIndexingSolutionSelected.parseString(xsDataSelectedIndexingSolution.marshal()))
                xsDataIntegrationInputSubWedge.setExperimentalConditionRefined(XSDataExperimentalCondition.parseString(self.__xsDataExperimentalConditionRefined.marshal()))
                xsDataCollection = XSDataCollection()
                xsDataCollection.addSubWedge(xsDataSubWedge)
                xsDataIntegrationInputSubWedge.setDataCollection(xsDataCollection)
                try:
                    from EDHandlerXSDataMOSFLMv10 import EDHandlerXSDataMOSFLMv10
                    xsDataMOSFLMInputIntegration = EDHandlerXSDataMOSFLMv10.generateXSDataMOSFLMInputIntegration(xsDataIntegrationInputSubWedge)
                    edPluginIntegration.setDataInput(xsDataMOSFLMInputIntegration)
                    edPluginIntegration.setBaseName("%s-%02d" % (self.__strPluginIntegrationName, iIndex))
                    edPluginIntegration.connectSUCCESS(self.doSuccessActionIntegration)
                    edPluginIntegration.connectFAILURE(self.doFailureActionIntegration)
                    # Here we store the sub wedge number for use in the results
                    self.__edPluginIntegrationList.append([iSubWedgeNumber, edPluginIntegration])
                except Exception as strErrorMessage:
                    self.addErrorMessage(strErrorMessage)
                    self.ERROR(strErrorMessage)
                    self.setFailure()
            else:
                strErrorMessage = "EDPluginControlIntegrationv10.preProcess: could not load plugin %s" % self.__strPluginIntegrationName
                self.error(strErrorMessage)
                self.addErrorMessage(strErrorMessage)
                self.setFailure()
开发者ID:IvarsKarpics,项目名称:edna-mx,代码行数:53,代码来源:EDPluginControlIntegrationv10.py

示例5: doSuccessReadImageHeader

 def doSuccessReadImageHeader(self, _edPlugin=None):
     self.DEBUG("EDPluginControlGridScreeningv1_0.doSuccessReadImageHeader")
     self.retrieveSuccessMessages(_edPlugin, "EDPluginControlGridScreeningv1_0.doSuccessReadImageHeader")
     xsDataResultReadImageHeader = self.edPluginControlReadImageHeader.getDataOutput()
     if xsDataResultReadImageHeader is not None:
         xsDataSubWedge = xsDataResultReadImageHeader.getSubWedge()
         self.xsDataCollection = XSDataCollection()
         self.xsDataCollection.addSubWedge(xsDataSubWedge)
         self.xsDataCollection.setDiffractionPlan(self.xsDataDiffractionPlan)
         if not self.bDoOnlyIntegrationWithXMLOutput:
             xsDataInputControlImageQualityIndicators = XSDataInputControlImageQualityIndicators()
             if self.bStoreImageQualityIndicatorsInISPyB:
                 xsDataInputControlImageQualityIndicators.doUploadToIspyb = XSDataBoolean(True)
             else:
                 xsDataInputControlImageQualityIndicators.doUploadToIspyb = XSDataBoolean(False)
             xsDataInputControlImageQualityIndicators.addImage(XSDataImage(path=XSDataString(self.strImageFile)))
             self.edPluginControlIndicators.setDataInput(xsDataInputControlImageQualityIndicators)
             self.edPluginControlIndicators.connectSUCCESS(self.doSuccessIndicators)
             self.edPluginControlIndicators.connectFAILURE(self.doFailureIndicators)
             self.executePluginSynchronous(self.edPluginControlIndicators)
         else:
             xsDataIndexingInput = XSDataIndexingInput()
             xsDataIndexingInput.setDataCollection(self.xsDataCollection)
             from EDHandlerXSDataMOSFLMv10 import EDHandlerXSDataMOSFLMv10
             xsDataMOSFLMIndexingInput = EDHandlerXSDataMOSFLMv10.generateXSDataMOSFLMInputIndexing(xsDataIndexingInput)
             self.edPluginMOSFLMIndexing.connectSUCCESS(self.doSuccessIndexingMOSFLM)
             self.edPluginMOSFLMIndexing.connectFAILURE(self.doFailureIndexingMOSFLM)
             self.edPluginMOSFLMIndexing.setDataInput(xsDataMOSFLMIndexingInput)
             self.edPluginMOSFLMIndexing.executeSynchronous()
开发者ID:IvarsKarpics,项目名称:edna-mx,代码行数:29,代码来源:EDPluginControlGridScreeningv1_0.py

示例6: doSuccessEvaluationIndexingMOSFLM

 def doSuccessEvaluationIndexingMOSFLM(self, _edPlugin=None):
     self.DEBUG("EDPluginControlCharacterisationv1_5.doSuccessEvaluationIndexingMOSFLM")
     self.retrieveSuccessMessages(_edPlugin, "EDPluginControlCharacterisationv1_5.doSuccessEvaluationIndexingMOSFLM")
     # Retrieve status messages (if any)
     if self._edPluginExecEvaluationIndexingMOSFLM.hasDataOutput("statusMessageIndexing"):
         self.addStatusMessage("MOSFLM: " + self._edPluginExecEvaluationIndexingMOSFLM.getDataOutput("statusMessageIndexing")[0].getValue())
     # Check if indexing was successful
     bIndexingSuccess = self._edPluginExecEvaluationIndexingMOSFLM.getDataOutput("indexingSuccess")[0].getValue()
     if bIndexingSuccess:
         xsDataIndexingResult = self._edPluginExecEvaluationIndexingMOSFLM.getDataOutput("indexingResult")[0]
         self._xsDataResultCharacterisation.setIndexingResult(xsDataIndexingResult)
         self._strCharacterisationShortSummary += self.generateIndexingShortSummary(xsDataIndexingResult)
         xsDataCollection = self._xsDataResultCharacterisation.getDataCollection()
         xsDataGeneratePredictionInput = XSDataGeneratePredictionInput()
         xsDataGeneratePredictionInput.setDataCollection(XSDataCollection.parseString(xsDataCollection.marshal()))
         xsDataGeneratePredictionInput.setSelectedIndexingSolution(XSDataIndexingSolutionSelected.parseString(xsDataIndexingResult.getSelectedSolution().marshal()))
         self._edPluginControlGeneratePrediction.setDataInput(xsDataGeneratePredictionInput)
         if self._edPluginControlIndexingIndicators.hasDataOutput("indexingShortSummary"):
             self._strCharacterisationShortSummary += self._edPluginControlIndexingIndicators.getDataOutput("indexingShortSummary")[0].getValue()
         # Start the generation of prediction images - we synchronize in the post-process
         self._edPluginControlGeneratePrediction.execute()
         # Then start the integration of the reference images
         self.indexingToIntegration()
     else:
         strErrorMessage = "Execution of indexing with MOSFLM failed."
         self.ERROR(strErrorMessage)
         self.sendMessageToMXCuBE(strErrorMessage, "error")
         self.addErrorMessage(strErrorMessage)
         self.setFailure()
         self.generateExecutiveSummary(self)
         if self._strStatusMessage != None:
             self.setDataOutput(XSDataString(self._strStatusMessage), "statusMessage")
             self.writeDataOutput()
开发者ID:IvarsKarpics,项目名称:edna-mx,代码行数:33,代码来源:EDPluginControlCharacterisationv1_5.py

示例7: doFailureIndexingLabelit

 def doFailureIndexingLabelit(self, _edPlugin=None):
     EDVerbose.DEBUG("EDPluginControlCharacterisationv1_2.doFailureIndexingLabelit")
     self.addStatusMessage("Labelit: Indexing FAILURE.")
     if self.__xsDataResultCharacterisation is not None:
         self.setDataOutput(self.__xsDataResultCharacterisation)
     if self.__xsDataIndexingResultMOSFLM == None:
         strErrorMessage = "Execution of indexing with both MOSFLM and Labelit failed. Execution of characterisation aborted."
         EDVerbose.ERROR(strErrorMessage)
         self.addErrorMessage(strErrorMessage)
         self.generateExecutiveSummary(self)
         self.setFailure()
         if self.__strStatusMessage != None:
             self.setDataOutput(XSDataString(self.__strStatusMessage), "statusMessage")
             self.writeDataOutput()
     else:
         # Use the MOSFLM indexing results - even if it's P1
         self.__xsDataResultCharacterisation.setIndexingResult(self.__xsDataIndexingResultMOSFLM)
         xsDataCollection = self.__xsDataResultCharacterisation.getDataCollection()
         xsDataGeneratePredictionInput = XSDataGeneratePredictionInput()
         xsDataGeneratePredictionInput.setDataCollection(XSDataCollection.parseString(xsDataCollection.marshal()))
         xsDataGeneratePredictionInput.setSelectedIndexingSolution(XSDataIndexingSolutionSelected.parseString(self.__xsDataIndexingResultMOSFLM.getSelectedSolution().marshal()))
         self.__edPluginControlGeneratePrediction.setDataInput(xsDataGeneratePredictionInput)
         if self.__edPluginControlIndexingIndicators.hasDataOutput("indexingShortSummary"):
             self.__strCharacterisationShortSummary += self.__edPluginControlIndexingIndicators.getDataOutput("indexingShortSummary")[0].getValue()
         # Start the generation of prediction images - we synchronize in the post-process
         self.__edPluginControlGeneratePrediction.execute()
         # Then start the integration of the reference images
         self.indexingToIntegration()
开发者ID:antolinos,项目名称:edna,代码行数:28,代码来源:EDPluginControlCharacterisationv1_2.py

示例8: doSuccessEvaluationIndexingMOSFLM

 def doSuccessEvaluationIndexingMOSFLM(self, _edPlugin=None):
     EDVerbose.DEBUG("EDPluginControlCharacterisationv1_2.doSuccessEvaluationIndexingMOSFLM")
     self.retrieveSuccessMessages(_edPlugin, "EDPluginControlCharacterisationv1_2.doSuccessEvaluationIndexing")
     # Retrieve status messages (if any)
     if self.__edPluginExecEvaluationIndexingMOSFLM.hasDataOutput("statusMessageImageQualityIndicators"):
         self.addStatusMessage(self.__edPluginExecEvaluationIndexingMOSFLM.getDataOutput("statusMessageImageQualityIndicators")[0].getValue())
     if self.__edPluginExecEvaluationIndexingMOSFLM.hasDataOutput("statusMessageIndexing"):
         self.addStatusMessage("MOSFLM: " + self.__edPluginExecEvaluationIndexingMOSFLM.getDataOutput("statusMessageIndexing")[0].getValue())
     # Check if indexing was successful
     bIndexWithLabelit = False
     bIndexingSuccess = self.__edPluginExecEvaluationIndexingMOSFLM.getDataOutput("indexingSuccess")[0].getValue()
     if bIndexingSuccess:
         xsDataIndexingResult = self.__edPluginExecEvaluationIndexingMOSFLM.getDataOutput("indexingResult")[0]
         self.__xsDataIndexingResultMOSFLM = xsDataIndexingResult
         # Check if space group is P1 - if yes run Labelit indexing
         xsDataIndexingSolutionSelected = xsDataIndexingResult.getSelectedSolution()
         xsDataCrystal = xsDataIndexingSolutionSelected.getCrystal()
         xsDataSpaceGroup = xsDataCrystal.getSpaceGroup()
         strSpaceGroupName = xsDataSpaceGroup.getName().getValue().upper()
         # Check if MOSFLM has indexed in P1
         if strSpaceGroupName == "P1":
             # Check if the user maybe asked for P1!
             bIndexWithLabelit = True
             if self.__xsDataCollection.getDiffractionPlan() is not None:
                 if self.__xsDataCollection.getDiffractionPlan().getForcedSpaceGroup() is not None:
                     if self.__xsDataCollection.getDiffractionPlan().getForcedSpaceGroup().getValue().upper() == "P1":
                         EDVerbose.screen("P1 space forced by diffraction plan")
                         bIndexWithLabelit = False
         if bIndexWithLabelit:
             EDVerbose.screen("P1 space group choosed - reindexing with Labelit")
         else:
             EDVerbose.screen("MOSFLM indexing successful!")
             if self.__edPluginControlIndexingIndicators.hasDataOutput("indexingShortSummary"):
                 self.__strCharacterisationShortSummary += self.__edPluginControlIndexingIndicators.getDataOutput("indexingShortSummary")[0].getValue()
             # Generate prediction images
             xsDataCollection = self.__xsDataResultCharacterisation.getDataCollection()
             self.__xsDataResultCharacterisation.setIndexingResult(xsDataIndexingResult)
             xsDataGeneratePredictionInput = XSDataGeneratePredictionInput()
             xsDataGeneratePredictionInput.setDataCollection(XSDataCollection.parseString(xsDataCollection.marshal()))
             xsDataGeneratePredictionInput.setSelectedIndexingSolution(XSDataIndexingSolutionSelected.parseString(xsDataIndexingResult.getSelectedSolution().marshal()))
             self.__edPluginControlGeneratePrediction.setDataInput(xsDataGeneratePredictionInput)
             # Start the generation of prediction images - we synchronize in the post-process
             self.__edPluginControlGeneratePrediction.execute()
             # Then start the integration of the reference images
             self.indexingToIntegration()
     else:
         EDVerbose.screen("Indexing with MOSFLM failed!")
         bIndexWithLabelit = True
     if bIndexWithLabelit:
         # Execute Labelit indexing
         EDVerbose.screen("Now trying to index with Labelit - please be patient...")
         xsDataIndexingInput = XSDataIndexingInput()
         xsDataSubWedgeList = self.__xsDataCollection.getSubWedge()
         xsDataExperimentalCondition = xsDataSubWedgeList[0].getExperimentalCondition()
         xsDataIndexingInput.setDataCollection(self.__xsDataCollection)
         xsDataIndexingInput.setExperimentalCondition(xsDataExperimentalCondition)
         if self.__xsDataCrystal != None:
             xsDataIndexingInput.setCrystal(self.__xsDataCrystal)
         self.__edPluginControlIndexingLabelit.setDataInput(xsDataIndexingInput)
         self.__edPluginControlIndexingLabelit.executeSynchronous()
开发者ID:antolinos,项目名称:edna,代码行数:60,代码来源:EDPluginControlCharacterisationv1_2.py

示例9: preProcess

    def preProcess(self, _edObject=None):
        EDPluginControl.preProcess(self)
        EDVerbose.DEBUG("EDPluginControlCharacterisationv1_3.preProcess")
        # Load the plugins
        self._edPluginControlIndexingIndicators = self.loadPlugin(self._strPluginControlIndexingIndicators, \
                                                                   "Indexing")
        self._edPluginControlIndexingLabelit = self.loadPlugin(self._strPluginControlIndexingLabelit, \
                                                                   "IndexingLabelit")
        self._edPluginExecEvaluationIndexingMOSFLM = self.loadPlugin(self._strPluginExecEvaluationIndexing, \
                                                                   "IndexingEvalualtionMOSFLM")
        self._edPluginExecEvaluationIndexingLABELIT = self.loadPlugin(self._strPluginExecEvaluationIndexing, \
                                                                   "IndexingEvalualtionLABELIT")
        self._edPluginControlGeneratePrediction = self.loadPlugin(self._strPluginControlGeneratePrediction, \
                                                                   "GeneratePrediction")
        self._edPluginControlIntegration = self.loadPlugin(self._strPluginControlIntegration, \
                                                            "Integration")
        self._edPluginControlXDSGenerateBackgroundImage = self.loadPlugin(self._strPluginControlXDSGenerateBackgroundImage, \
                                                            "ControlXDSGenerateBackgroundImage")
        self._edPluginControlStrategy = self.loadPlugin(self._strPluginControlStrategy, \
                                                         "Strategy")
        if (self._edPluginControlIndexingIndicators is not None):
            EDVerbose.DEBUG("EDPluginControlCharacterisationv1_3.preProcess: " + self._strPluginControlIndexingIndicators + " Found... setting Data Input")
            # create Data Input for indexing
            xsDataInputCharacterisation = self.getDataInput()
            self._xsDataCollection = xsDataInputCharacterisation.getDataCollection()
            xsDataCrystal = None
            xsDataSubWedgeList = self._xsDataCollection.getSubWedge()
            if ((xsDataSubWedgeList is None) or (xsDataSubWedgeList == [])):
                strError = "EDPluginControlCharacterisationv1_3.preProcess: No subwedges in input data."
                EDVerbose.ERROR(strError)
                self.setFailure()
            else:
                xsDataExperimentalCondition = xsDataSubWedgeList[0].getExperimentalCondition()

                # Fix for bug 431: if the flux is zero raise an error
                xsDataDoubleFlux = xsDataExperimentalCondition.getBeam().getFlux()
                if (xsDataDoubleFlux is not None):
                    if (xsDataDoubleFlux.getValue() < 0.1):
                        strErrorMessage = "Input flux is negative or close to zero. Execution of characterisation aborted."
                        EDVerbose.ERROR(strErrorMessage)
                        self.addErrorMessage("EDPluginControlCharacterisationv1_3.preProcess ERROR: " + strErrorMessage)
                        #self.addComment(strErrorMessage)
                        self.setFailure()

                xsDataDiffractionPlan = self._xsDataCollection.getDiffractionPlan()
                xsDataStringForcedSpaceGroup = xsDataDiffractionPlan.getForcedSpaceGroup()
                if (xsDataStringForcedSpaceGroup is not None):
                    self._xsDataCrystal = XSDataCrystal()
                    xsDataSpaceGroup = XSDataSpaceGroup()
                    xsDataSpaceGroup.setName(xsDataStringForcedSpaceGroup)
                    self._xsDataCrystal.setSpaceGroup(xsDataSpaceGroup)

                self._edPluginControlIndexingIndicators.setDataInput(self._xsDataCollection, "dataCollection")
                if self._xsDataCrystal is not None:
                    self._edPluginControlIndexingIndicators.setDataInput(self._xsDataCrystal, "crystal")

                # Populate characterisation object
                self._xsDataResultCharacterisation = XSDataResultCharacterisation()
                self._xsDataResultCharacterisation.setDataCollection(XSDataCollection.parseString(self._xsDataCollection.marshal()))
开发者ID:antolinos,项目名称:edna,代码行数:59,代码来源:EDPluginControlCharacterisationv1_3.py

示例10: createDataInputCharacterisationFromDataSets

 def createDataInputCharacterisationFromDataSets(self, _pyListXSDataCCP4iDataSet):
     """
     This method takes as input a list of ccp4i data sets. Each data set can contain several
     paths to image files. It runs the EDPluginControlSubWedgeAssemble plugin to read the
     experimental information from the image headers and then creates a single XSDataInputCharacterisation object.
     """
     EDVerbose.DEBUG("EDPluginControlCCP4iv1_1.createDataInputCharacterisationFromDataSets")
     xsDataInputCharacterisation = None
     # We might have to run the plugin several times
     edActionCluster = EDActionCluster()
     pyListPluginControlSubWedgeAssemble = []
     # Prepare the action cluster
     iIndex = 1
     for xsDataCCP4iDataSet in _pyListXSDataCCP4iDataSet:
         edPluginControlSubWedgeAssemble = self.loadPlugin(self.__strPluginControlSubWedgeAssembleName, "SubWedgeAssemble-%02d" % iIndex)
         edPluginControlSubWedgeAssemble.connectSUCCESS(self.doSuccessActionSubWedgeAssemble)
         edPluginControlSubWedgeAssemble.connectFAILURE(self.doFailureActionSubWedgeAssemble)
         # Prepare the input for the sub wedge assemble plugin
         xsDataInputSubWedgeAssemble = XSDataInputSubWedgeAssemble()
         for xsDataImageFile in xsDataCCP4iDataSet.getImageFile():
             xsDataInputSubWedgeAssemble.addFile(xsDataImageFile)
         edPluginControlSubWedgeAssemble.setDataInput(xsDataInputSubWedgeAssemble)
         pyListPluginControlSubWedgeAssemble.append(edPluginControlSubWedgeAssemble)
         self.addPluginToActionCluster(edPluginControlSubWedgeAssemble)
         iIndex += 1
     # Run the action cluster synchronously
     self.executeActionCluster()
     self.synchronizeActionCluster()
     # Recuperate the output
     for edPluginControlSubWedgeAssemble in pyListPluginControlSubWedgeAssemble:
         if (edPluginControlSubWedgeAssemble.isFailure()):
             self.setFailure()
         else:
             xsDataResultSubWedgeAssemble = edPluginControlSubWedgeAssemble.getDataOutput()
             for xsDataSubWedge in xsDataResultSubWedgeAssemble.getSubWedge():
                 # Instantiate the xsDataInputCharacterisation object if it's not already done.
                 xsDataCollection = None
                 if (xsDataInputCharacterisation is None):
                     xsDataInputCharacterisation = XSDataInputCharacterisation()
                 else:
                     xsDataCollection = xsDataInputCharacterisation.getDataCollection()
                 if (xsDataCollection is None):
                     xsDataCollection = XSDataCollection()
                 xsDataCollection.addSubWedge(xsDataSubWedge)
                 xsDataInputCharacterisation.setDataCollection(xsDataCollection)
     return xsDataInputCharacterisation
开发者ID:antolinos,项目名称:edna,代码行数:46,代码来源:EDPluginControlCCP4iv1_1.py

示例11: testCreatePyarchHtmlDirectoryPath

 def testCreatePyarchHtmlDirectoryPath(self):
     strTestDataDir = self.getPluginTestsDataHome()
     strTestFile = os.path.join(strTestDataDir, "EDHandlerESRFPyarchv1_0", "XSDataCollection_reference.xml")
     strXml = self.readAndParseFile(strTestFile)
     xsDataCollection = XSDataCollection.parseString(strXml)
     strPyarchHtmlDirectoryPath = EDHandlerESRFPyarchv1_0.createPyarchHtmlDirectoryPath(xsDataCollection)
     # print strPyarchHtmlDirectoryPath
     strReferencePath = "/data/pyarch/2016/id30b/opid30b/20161214/RAW_DATA/Magda/Test_x1_2_dnafiles"
     EDAssert.equal(strReferencePath, strPyarchHtmlDirectoryPath, "Correct pyarch path")
开发者ID:IvarsKarpics,项目名称:edna-mx,代码行数:9,代码来源:EDTestCaseEDHandlerESRFPyarchv1_0.py

示例12: getXSDataResultStrategy

    def getXSDataResultStrategy(self, _xsDataResultBest, _xsDataExperimentalCondition, _xsDataSample):
        xsDataResultStrategy = XSDataResultStrategy()


        #xsDataCollectionRunsBest = _xsDataResultBest.getCollectionRun()
        xsDataCollectionPlansBest = _xsDataResultBest.getCollectionPlan()

        for xsDataCollectionPlanBest in xsDataCollectionPlansBest:

            xsDataCollectionPlan = XSDataCollectionPlan()
            xsDataCollectionStrategy = XSDataCollection()

            xsDataDoubleTransmission = xsDataCollectionPlanBest.getStrategySummary().getAttenuation()

            for xsDataCollectionRunBest in xsDataCollectionPlanBest.getCollectionRun():
                xsDataSubWedge = XSDataSubWedge()
                strXmlStringDataExperimentalCondition = _xsDataExperimentalCondition.marshal()
                xsDataExperimentalCondition = XSDataExperimentalCondition.parseString(strXmlStringDataExperimentalCondition)
                xsDataExperimentalCondition.getBeam().setExposureTime(xsDataCollectionRunBest.getExposureTime())
                xsDataExperimentalCondition.getBeam().setTransmission(xsDataDoubleTransmission)
                xsDataExperimentalCondition.getDetector().setDistance(xsDataCollectionRunBest.getDistance())
                xsDataExperimentalCondition.getGoniostat().setRotationAxisStart(xsDataCollectionRunBest.getPhiStart())
                xsDataExperimentalCondition.getGoniostat().setOscillationWidth(xsDataCollectionRunBest.getPhiWidth())
                fRotationAxisEnd = xsDataCollectionRunBest.getPhiStart().getValue() + xsDataCollectionRunBest.getNumberOfImages().getValue() * xsDataCollectionRunBest.getPhiWidth().getValue()
                xsDataExperimentalCondition.getGoniostat().setRotationAxisEnd(XSDataAngle(fRotationAxisEnd))
                xsDataSubWedge.setExperimentalCondition(xsDataExperimentalCondition)
                xsDataSubWedge.setSubWedgeNumber(xsDataCollectionRunBest.getCollectionRunNumber())
                xsDataCollectionStrategy.addSubWedge(xsDataSubWedge)

            xsDataCollectionStrategy.setSample(_xsDataSample)

            xsDataCollectionPlan.setCollectionStrategy(xsDataCollectionStrategy)
            xsDataStrategySummary = xsDataCollectionPlanBest.getStrategySummary()
            xsDataCollectionPlan.setStrategySummary(xsDataStrategySummary)

            xsDataStatistics = xsDataCollectionPlanBest.getStatisticalPrediction()
            xsDataCollectionPlan.setStatistics(xsDataStatistics)

            xsDataCollectionPlan.setCollectionPlanNumber(xsDataCollectionPlanBest.getCollectionPlanNumber())

            xsDataResultStrategy.addCollectionPlan(xsDataCollectionPlan)

        return xsDataResultStrategy
开发者ID:antolinos,项目名称:edna,代码行数:43,代码来源:EDHandlerXSDataBestv1_1.py

示例13: generatePredictionImageList

 def generatePredictionImageList(self, _edPluginGeneratePrediction, _xsDataCollection, _xsDataIndexingResult):
     """
     Generate a list containing the prediction images
     """
     self.verboseDebug("EDPluginControlIndexingv10.generatePredictionImageList")
     xsDataGeneratePredictionInput = XSDataGeneratePredictionInput()
     xsDataGeneratePredictionInput.setDataCollection(XSDataCollection.parseString(_xsDataCollection.marshal()))
     xsDataGeneratePredictionInput.setSelectedIndexingSolution(XSDataIndexingSolutionSelected.parseString(_xsDataIndexingResult.getSelectedSolution().marshal()))
     _edPluginGeneratePrediction.setDataInput(xsDataGeneratePredictionInput)
     _edPluginGeneratePrediction.executeSynchronous()
开发者ID:antolinos,项目名称:edna,代码行数:10,代码来源:EDPluginControlIndexingv10.py

示例14: preProcess

    def preProcess(self, _edObject=None):
        """
        Gets the Configuration Parameters, if found, overrides default parameters
        """
        EDPluginControl.preProcess(self, _edObject)
        EDVerbose.DEBUG("EDPluginControlCharacterisationv1_1.preProcess...")

        self.__edPluginIndexing = self.loadPlugin(self.__strPluginIndexingName   , "Indexing")
        self.__edPluginIntegration = self.loadPlugin(self.__strPluginIntegrationName, "Integration")
        self.__edPluginStrategy = self.loadPlugin(self.__strPluginStrategyName   , "Strategy")

        if (self.__edPluginIndexing is not None):
            EDVerbose.DEBUG("EDPluginControlCharacterisationv1_1.preProcess: " + self.__strPluginIndexingName + " Found... setting Data Input")
            # create Data Input for indexing
            xsDataInputStrategy = self.getDataInput()
            xsDataCollection = xsDataInputStrategy.getDataCollection()
            xsDataSample = xsDataCollection.getSample()
            xsDataSubWedgeList = xsDataCollection.getSubWedge()
            if ((xsDataSubWedgeList is None) or (xsDataSubWedgeList == [])):
            	strError = "EDPluginControlCharacterisationv1_1.preProcess: No subwedges in input data."
            	EDVerbose.ERROR(strError)
                self.setFailure()
            else:
                xsDataExperimentalCondition = xsDataSubWedgeList[0].getExperimentalCondition()

                # Fix for bug 431: if the flux is zero raise an error
                xsDataDoubleFlux = xsDataExperimentalCondition.getBeam().getFlux()
                if (xsDataDoubleFlux is not None):
                    if (xsDataDoubleFlux.getValue() < 0.1):
                        pyStrErrorMessage = "EDPluginControlCharacterisationv1_1.preProcess ERROR: Input flux is negative or close to zero. Execution of characterisation aborted."
                        EDVerbose.ERROR(pyStrErrorMessage)
                        self.addErrorMessage(pyStrErrorMessage)
                        self.setFailure()

                xsDataIndexingInput = XSDataIndexingInput()
                xsDataIndexingInput.setDataCollection(xsDataCollection)
                xsDataIndexingInput.setExperimentalCondition(xsDataExperimentalCondition)

                xsDataDiffractionPlan = xsDataCollection.getDiffractionPlan()
                xsDataStringForcedSpaceGroup = xsDataDiffractionPlan.getForcedSpaceGroup()
                if (xsDataStringForcedSpaceGroup is not None):
                    xsDataCrystal = XSDataCrystal()
                    xsDataSpaceGroup = XSDataSpaceGroup()
                    xsDataSpaceGroup.setName(xsDataStringForcedSpaceGroup)
                    xsDataCrystal.setSpaceGroup(xsDataSpaceGroup)
                    xsDataIndexingInput.setCrystal(xsDataCrystal)

                self.__edPluginIndexing.setDataInput(xsDataIndexingInput)

                # Populate characterisation object
                self.__xsDataResultCharacterisation = XSDataResultCharacterisation()
                self.__xsDataResultCharacterisation.setDataCollection(XSDataCollection.parseString(xsDataCollection.marshal()))
开发者ID:antolinos,项目名称:edna,代码行数:52,代码来源:EDPluginControlCharacterisationv1_1.py

示例15: testSetDataInput

    def testSetDataInput(self):
        edPluginControlCharacterisationv10 = self.createPlugin()
        xsPluginItemGood01 = self.getPluginConfiguration(os.path.join(self.getPluginTestsDataHome(), "XSConfiguration.xml"))
        edPluginControlCharacterisationv10.setConfiguration(xsPluginItemGood01)
        edPluginControlCharacterisationv10.configure()

        edStringXMLInput = self.readAndParseFile(self.strReferenceInputFile)
        edPluginControlCharacterisationv10.setDataInput(edStringXMLInput)
        from XSDataMXv1 import XSDataCollection
        xsDataCollectionReference = XSDataCollection.parseString(edStringXMLInput)

        xsDataCharacterisationv10Input = edPluginControlCharacterisationv10.getDataInput()
        EDAssert.equal(xsDataCollectionReference.marshal(), xsDataCharacterisationv10Input.marshal())
开发者ID:antolinos,项目名称:edna,代码行数:13,代码来源:EDTestCasePluginUnitControlCharacterisationv10.py


注:本文中的XSDataMXv1.XSDataCollection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。