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()
 def doSuccessEvaluationIndexingMOSFLM(self, _edPlugin=None):
     self.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":
                         self.screen("P1 space forced by diffraction plan")
                         bIndexWithLabelit = False
         if bIndexWithLabelit:
             self.screen("P1 space group choosed - reindexing with Labelit")
         else:
             self.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:
         self.screen("Indexing with MOSFLM failed!")
         bIndexWithLabelit = True
     if bIndexWithLabelit:
         # Execute Labelit indexing
         self.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()
 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()
 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()
 def doFailureIndexingLabelit(self, _edPlugin=None):
     self.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."
         self.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()
Esempio n. 6
0
 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()
    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)
Esempio n. 8
0
 def doSuccessEvaluationIndexingMOSFLM(self, _edPlugin=None):
     self.DEBUG(
         "EDPluginControlCharacterisationv1_4.doSuccessEvaluationIndexingMOSFLM"
     )
     self.retrieveSuccessMessages(
         _edPlugin,
         "EDPluginControlCharacterisationv1_4.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()
 def doSuccessEvaluationIndexingLABELIT(self, _edPlugin=None):
     self.DEBUG("EDPluginControlCharacterisationv1_5.doSuccessEvaluationIndexingLABELIT")
     self.retrieveSuccessMessages(_edPlugin, "EDPluginControlCharacterisationv1_5.doSuccessEvaluationIndexingLABELIT")
     # Retrieve status messages (if any)
     if self._edPluginExecEvaluationIndexingLABELIT.hasDataOutput("statusMessageIndexing"):
         self.addStatusMessage("Labelit: " + self._edPluginExecEvaluationIndexingLABELIT.getDataOutput("statusMessageIndexing")[0].getValue())
     # Check if indexing was successful
     bIndexingSuccess = self._edPluginExecEvaluationIndexingLABELIT.getDataOutput("indexingSuccess")[0].getValue()
     if bIndexingSuccess:
         xsDataIndexingResult = self._edPluginExecEvaluationIndexingLABELIT.getDataOutput("indexingResult")[0]
         self._xsDataResultCharacterisation.setIndexingResult(xsDataIndexingResult)
         if self._edPluginControlIndexingIndicators.hasDataOutput("indexingShortSummary"):
             self._strCharacterisationShortSummary += self._edPluginControlIndexingIndicators.getDataOutput("indexingShortSummary")[0].getValue()
         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"):
             indexingShortSummary = self._edPluginControlIndexingIndicators.getDataOutput("indexingShortSummary")[0].getValue()
             self._strCharacterisationShortSummary += indexingShortSummary
             self.sendMessageToMXCuBE(indexingShortSummary)
         # 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:
         if self._iNoImagesWithDozorScore > 0:
             strWarningMessage = "Execution of Indexing and Indicators plugin failed - trying to index with MOSFLM."
             self.WARNING(strWarningMessage)
             self.sendMessageToMXCuBE(strWarningMessage, "warning")
             self.addWarningMessage(strWarningMessage)
             xsDataIndexingInput = XSDataIndexingInput()
             xsDataIndexingInput.dataCollection = self._xsDataCollection
             xsDataIndexingInput.experimentalCondition = self._xsDataCollection.subWedge[0].experimentalCondition
             xsDataIndexingInput.crystal = self._xsDataCrystal
             self._edPluginControlIndexingMOSFLM.setDataInput(xsDataIndexingInput)
             self.executePluginSynchronous(self._edPluginControlIndexingMOSFLM)
         else:
             strErrorMessage = "Execution of indexing with Labelit 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()
Esempio n. 10
0
 def doSuccessActionIndexing(self, _edPlugin=None):
     self.verboseDebug("EDPluginControlIndexingv10.doSuccessActionIndexing")
     self.retrieveSuccessMessages(_edPlugin, "EDPluginControlIndexingv10.doSuccessActionIndexing")
     # Retrieve the output from the plugin
     self.xsDataIndexingResult = self.getDataIndexingResult(_edPlugin)
     self.generateShortSummary()
     # Add the list of images to the results
     xsDataListImage = self.generateImageList(self.xsDataCollection)
     self.xsDataIndexingResult.setImage(xsDataListImage)
     if (self.bGeneratePredictionImage):
         # Generate prediction images
         xsDataGeneratePredictionInput = XSDataGeneratePredictionInput()
         xsDataGeneratePredictionInput.setDataCollection(XSDataCollection.parseString(self.xsDataCollection.marshal()))
         xsDataGeneratePredictionInput.setSelectedIndexingSolution(XSDataIndexingSolutionSelected.parseString(self.xsDataIndexingResult.getSelectedSolution().marshal()))
         self.edPluginGeneratePrediction.setDataInput(xsDataGeneratePredictionInput)
         self.edPluginGeneratePrediction.executeSynchronous()
Esempio n. 11
0
    def preProcess(self, _edObject=None):
        """
        Gets the Configuration Parameters, if found, overrides default parameters
        """
        EDPluginControl.preProcess(self, _edObject)
        EDVerbose.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)
Esempio n. 12
0
 def doSuccessEvaluationIndexingLABELIT(self, _edPlugin=None):
     self.DEBUG(
         "EDPluginControlCharacterisationv1_4.doSuccessEvaluationIndexingLABELIT"
     )
     self.retrieveSuccessMessages(
         _edPlugin,
         "EDPluginControlCharacterisationv1_4.doSuccessEvaluationIndexingLABELIT"
     )
     # Retrieve status messages (if any)
     if self._edPluginExecEvaluationIndexingLABELIT.hasDataOutput(
             "statusMessageIndexing"):
         self.addStatusMessage(
             "Labelit: " +
             self._edPluginExecEvaluationIndexingLABELIT.getDataOutput(
                 "statusMessageIndexing")[0].getValue())
     # Check if indexing was successful
     bIndexingSuccess = self._edPluginExecEvaluationIndexingLABELIT.getDataOutput(
         "indexingSuccess")[0].getValue()
     if bIndexingSuccess:
         xsDataIndexingResult = self._edPluginExecEvaluationIndexingLABELIT.getDataOutput(
             "indexingResult")[0]
         self._xsDataResultCharacterisation.setIndexingResult(
             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"):
             indexingShortSummary = self._edPluginControlIndexingIndicators.getDataOutput(
                 "indexingShortSummary")[0].getValue()
             self._strCharacterisationShortSummary += indexingShortSummary
             self.sendMessageToMXCuBE(indexingShortSummary)
         # 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:
         if self._iNoImagesWithDozorScore > 0:
             if not self._bDoOnlyMoslmfIndexing:
                 strWarningMessage = "Execution of Indexing and Indicators plugin failed - trying to index with MOSFLM."
                 self.WARNING(strWarningMessage)
                 self.sendMessageToMXCuBE(strWarningMessage, "warning")
                 self.addWarningMessage(strWarningMessage)
             xsDataIndexingInput = XSDataIndexingInput()
             xsDataIndexingInput.dataCollection = self._xsDataCollection
             xsDataIndexingInput.experimentalCondition = self._xsDataCollection.subWedge[
                 0].experimentalCondition
             xsDataIndexingInput.crystal = self._xsDataCrystal
             self._edPluginControlIndexingMOSFLM.setDataInput(
                 xsDataIndexingInput)
             self.executePluginSynchronous(
                 self._edPluginControlIndexingMOSFLM)
         else:
             strErrorMessage = "Execution of indexing with Labelit 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()