def generateMOSFLMCommands(self):
        """
        This method creates a list of MOSFLM indexing commands given a valid
        XSDataMOSFLMIndexingingInput as self.getDataInput()
        """
        EDPluginMOSFLMv10.generateMOSFLMCommands(self)
        EDVerbose.DEBUG("EDPluginMOSFLMIndexingv10.generateMOSFLMCommands")

        xsDataMOSFLMIndexingInput = self.getDataInput()

        if (xsDataMOSFLMIndexingInput != None):

            self.addListCommandExecution("NEWMAT " + self.getNewmatFileName())

            xsDataMOSFLMImageList = xsDataMOSFLMIndexingInput.getImage()
            for xsDataMOSFLMImage in xsDataMOSFLMImageList:
                iImageNumber = xsDataMOSFLMImage.getNumber().getValue()
                fRotationAxisStart = xsDataMOSFLMImage.getRotationAxisStart().getValue()
                fRotationAxisEnd = xsDataMOSFLMImage.getRotationAxisEnd().getValue()
                self.addListCommandExecution("AUTOINDEX DPS REFINE IMAGE " + str(iImageNumber) + " " \
                                                     "PHI " + str(fRotationAxisStart) + " " + str(fRotationAxisEnd))
            self.addListCommandExecution("GO")
            for xsDataImage in xsDataMOSFLMImageList:
                self.addListCommandExecution("MOSAIC ESTIMATE %d" % xsDataImage.getNumber().getValue())
                self.addListCommandExecution("GO")

#            strPrefix = strTemplate.split("#")[0][:-1]
#            strGenFileName = strPrefix + ".gen"
#            strSptFileName = strPrefix + ".spt"

        EDVerbose.DEBUG("Finished EDPluginMOSFLMIndexingv10.generateMOSFLMIndexingCommands")
    def generateMOSFLMCommands(self):
        """
        This method creates a list of MOSFLM integration commands given a valid
        XSDataMOSFLMIntegrationingInput as self.getDataInput()
        """
        EDPluginMOSFLMv10.generateMOSFLMCommands(self)
        EDVerbose.DEBUG("EDPluginMOSFLMIntegrationv10.generateMOSFLMCommands")

        xsDataMOSFLMInputIntegration = self.getDataInput()

        if xsDataMOSFLMInputIntegration is not None:

            iImageStart = xsDataMOSFLMInputIntegration.getImageStart().getValue()
            iImageEnd = xsDataMOSFLMInputIntegration.getImageEnd().getValue()
            fRotationAxisStart = xsDataMOSFLMInputIntegration.getRotationAxisStart().getValue()
            fOscillationWidth = xsDataMOSFLMInputIntegration.getOscillationWidth().getValue()

            self.addListCommandExecution("HKLOUT process_%d_%d.mtz" % (iImageStart, iImageEnd))
            self.addListCommandExecution(
                "PROCESS %d TO %d START %f ANGLE %f" % (iImageStart, iImageEnd, fRotationAxisStart, fOscillationWidth)
            )

            self.addListCommandExecution("BEST ON")
            self.addListCommandExecution("GO")
            self.addListCommandExecution("BEST OFF")

        EDVerbose.DEBUG("Finished EDPluginMOSFLMIntegrationv10.generateMOSFLMCommands")
    def generateMOSFLMCommands(self):
        """
        This method creates a list of MOSFLM integration commands given a valid
        XSDataMOSFLMInputGeneratePrediction as input to the plugin.
        """
        EDPluginMOSFLMv10.generateMOSFLMCommands(self)
        EDVerbose.DEBUG("EDPluginMOSFLMGeneratePredictionv10.generateMOSFLMCommands")

        xsDataMOSFLMInputGeneratePrediction = self.getDataInput()

        if (xsDataMOSFLMInputGeneratePrediction is not None):

            pyStrTemplate = xsDataMOSFLMInputGeneratePrediction.getTemplate().getValue()
            xsDataMOSFLMImage = xsDataMOSFLMInputGeneratePrediction.getImage()
            iImageNumber = xsDataMOSFLMImage.getNumber().getValue()

            pyStrImageFileName = self.getImageFileNameFromTemplate(pyStrTemplate, iImageNumber)
            if (pyStrImageFileName is not None):
                self.setPredictionImageFileName(pyStrImageFileName + "_pred.jpg")

            fRotationAxisStart = xsDataMOSFLMImage.getRotationAxisStart().getValue()
            fRotationAxisEnd = xsDataMOSFLMImage.getRotationAxisEnd().getValue()
            self.addListCommandExecution("XGUI ON")
            self.addListCommandExecution("IMAGE %d PHI %f TO %f" % (iImageNumber, fRotationAxisStart, fRotationAxisEnd))
            self.addListCommandExecution("GO")
            self.addListCommandExecution("PREDICT_SPOTS")
            self.addListCommandExecution("CREATE_IMAGE PREDICTION ON BINARY TRUE FILENAME %s" % (self.getPredictionImageFileName()))
            self.addListCommandExecution("RETURN")
            self.addListCommandExecution("EXIT")

            self.addListCommandPostExecution("chmod 644 %s" % self.getPredictionImageFileName())

        EDVerbose.DEBUG("Finished EDPluginMOSFLMGeneratePredictionv10.generateMOSFLMCommands")
 def configure(self):
     EDPluginMOSFLMv10.configure(self)
     EDVerbose.DEBUG("EDPluginMOSFLMGeneratePredictionv10.configure")
     xsPluginItem = self.getConfiguration()
     if (xsPluginItem == None):
         EDVerbose.DEBUG("EDPluginMOSFLMGeneratePredictionv10.configure: xsPluginItem is None")
     self.createPredictionImageFileName()
 def checkParameters(self):
     """
     Checks the mandatory parameters for MOSLFM indexing
     """
     EDPluginMOSFLMv10.checkParameters(self)
     EDVerbose.DEBUG("EDPluginMOSFLMGeneratePredictionv10.checkParameters")
     self.checkMandatoryParameters(self.getDataInput().getImage(), "image")
 def checkParameters(self):
     """
     Checks the mandatory parameters for MOSLFM indexing
     """
     EDPluginMOSFLMv10.checkParameters(self)
     self.DEBUG("EDPluginMOSFLMIndexingv10.checkParameters")
     self.checkMandatoryParameters(self.getDataInput().getImage(), "image")
    def generateMOSFLMCommands(self):
        """
        This method creates a list of MOSFLM integration commands given a valid
        XSDataMOSFLMIntegrationingInput as self.getDataInput()
        """
        EDPluginMOSFLMv10.generateMOSFLMCommands(self)
        self.DEBUG("EDPluginMOSFLMIntegrationv10.generateMOSFLMCommands")

        xsDataMOSFLMInputIntegration = self.getDataInput()

        if (xsDataMOSFLMInputIntegration is not None):


            iImageStart = xsDataMOSFLMInputIntegration.getImageStart().getValue()
            iImageEnd = xsDataMOSFLMInputIntegration.getImageEnd().getValue()
            fRotationAxisStart = xsDataMOSFLMInputIntegration.getRotationAxisStart().getValue()
            fOscillationWidth = xsDataMOSFLMInputIntegration.getOscillationWidth().getValue()

            self.addListCommandExecution("HKLOUT process_%d_%d.mtz" %
                                                       (iImageStart, iImageEnd))
            self.addListCommandExecution("PROCESS %d TO %d START %f ANGLE %f" %
                                                       (iImageStart, iImageEnd, fRotationAxisStart, fOscillationWidth))


            self.addListCommandExecution("BEST ON")
            self.addListCommandExecution("GO")
            self.addListCommandExecution("BEST OFF")

        # Force name of log file
        self.setScriptLogFileName(self.compactPluginName(self.getClassName())+".log")

        self.DEBUG("Finished EDPluginMOSFLMIntegrationv10.generateMOSFLMCommands")
 def checkParameters(self):
     """
     Checks the mandatory parameters for MOSLFM indexing
     """
     EDPluginMOSFLMv10.checkParameters(self)
     self.DEBUG("EDPluginMOSFLMIntegrationv10.checkParameters")
     self.checkMandatoryParameters(self.getDataInput().getImageEnd(), "imageEnd")
     self.checkMandatoryParameters(self.getDataInput().getImageStart(), "imageStart")
     self.checkMandatoryParameters(self.getDataInput().getOscillationWidth(), "oscillationWidth")
     self.checkMandatoryParameters(self.getDataInput().getRotationAxisStart(), "rotationAxisStart")
 def postProcess(self, _edObject=None):
     EDPluginMOSFLMv10.postProcess(self)
     self.DEBUG("EDPluginMOSFLMIntegrationv10.postProcess")
     xsDataMOSFLMOutputIntegration = self.createDataMOSFLMOutputIntegration()
     if (xsDataMOSFLMOutputIntegration is None):
         strError = "MOSFLM integration error : no integration results obtained."
         self.addExecutiveSummaryLine(strError)
         self.ERROR(strError)
         self.setFailure()
     else:
         self.setDataOutput(xsDataMOSFLMOutputIntegration)
 def __init__(self):
     EDPluginMOSFLMv10.__init__(self)
     self.setXSDataInputClass(XSDataMOSFLMInputIntegration)
    def generateExecutiveSummary(self, _edPlugin):
        """
        Generates a summary of the execution of the plugin.
        """
        EDPluginMOSFLMv10.generateExecutiveSummary(self, _edPlugin)
        self.DEBUG(
            "EDPluginMOSFLMIntegrationv10.createDataMOSFLMOutputIndexing")
        xsDataMOSFLMInputIntegration = self.getDataInput()
        xsDataMOSFLMOutputIntegration = self.getDataOutput()
        if (xsDataMOSFLMOutputIntegration is not None):
            self.addExecutiveSummaryLine(
                "Execution of MOSFLM integration successful.")
            self.addExecutiveSummaryLine(
                "Image directory     : %s" %
                xsDataMOSFLMInputIntegration.getDirectory().getValue())
            self.addExecutiveSummaryLine(
                "Image template      : %s" %
                xsDataMOSFLMInputIntegration.getTemplate().getValue())
            self.addExecutiveSummaryLine(
                "Image start         : %4d" %
                xsDataMOSFLMInputIntegration.getImageStart().getValue())
            self.addExecutiveSummaryLine(
                "Image end           : %4d" %
                xsDataMOSFLMInputIntegration.getImageEnd().getValue())
            fRotationAxisStart = xsDataMOSFLMInputIntegration.getRotationAxisStart(
            ).getValue()
            fOscillationWidth = xsDataMOSFLMInputIntegration.getOscillationWidth(
            ).getValue()
            self.addExecutiveSummaryLine(
                "Rotation axis start : %4.1f [degrees]" % fRotationAxisStart)
            self.addExecutiveSummaryLine(
                "Rotation axis end   : %4.1f [degrees]" %
                (fRotationAxisStart + fOscillationWidth))
            self.addExecutiveSummaryLine("")
            iNumberOfFullyRecordedReflections = xsDataMOSFLMOutputIntegration.getNumberOfFullyRecordedReflections(
            ).getValue()
            self.addExecutiveSummaryLine(
                "Number of fully recorded reflections          : %5d" %
                iNumberOfFullyRecordedReflections)
            self.addExecutiveSummaryLine(
                "Number of partials                            : %5d" %
                xsDataMOSFLMOutputIntegration.getNumberOfPartialReflections(
                ).getValue())
            self.addExecutiveSummaryLine(
                "Number of overlapped reflections              : %5d" %
                xsDataMOSFLMOutputIntegration.getNumberOfOverlappedReflections(
                ).getValue())
            self.addExecutiveSummaryLine(
                "Number of reflections with negative intensity : %5d" %
                xsDataMOSFLMOutputIntegration.getNumberOfNegativeReflections(
                ).getValue())
            self.addExecutiveSummaryLine(
                "Number of bad reflections                     : %5d" %
                xsDataMOSFLMOutputIntegration.getNumberOfBadReflections(
                ).getValue())
            self.addExecutiveSummaryLine("")
            self.addExecutiveSummaryLine(
                "RMS spot deviation                            : %5.3f [mm]" %
                xsDataMOSFLMOutputIntegration.getRMSSpotDeviation().getValue())
            self.addExecutiveSummaryLine(
                "Average I/sigma overall                       : %5.1f" %
                xsDataMOSFLMOutputIntegration.getOverallIOverSigma().getValue(
                ))
            self.addExecutiveSummaryLine(
                "Average I/sigma at highest resolution         : %5.1f" %
                xsDataMOSFLMOutputIntegration.getHighestResolutionIOverSigma(
                ).getValue())
            self.addExecutiveSummaryLine("")
            self.addExecutiveSummaryLine(
                "Analysis as a function of resolution:")
            strResolution = "Res (Ang) "

            strNumberProfileFittedFullyRecorded = "Number    "
            strAverageIntensityProfileFittedFullyRecorded = " <I>      "
            strAverageIOverSigmaProfileFittedFullyRecorded = " <I/sigma>"

            strNumberProfileFittedPartials = "Number    "
            strAverageIntensityProfileFittedPartials = " <I>      "
            strAverageIOverSigmaProfileFittedPartials = " <I/sigma>"

            for xsDataMOSFLMIntegrationStatisticsPerResolutionBin in xsDataMOSFLMOutputIntegration.getStatisticsPerResolutionBin(
            ):
                fMaxResolution = xsDataMOSFLMIntegrationStatisticsPerResolutionBin.getMaxResolution(
                ).getValue()
                strResolution += "%7.2f" % fMaxResolution
                xsDataMOSFLMIntegrationStatisticsProfileFitted = xsDataMOSFLMIntegrationStatisticsPerResolutionBin.getProfileFitted(
                )

                xsDataMOSFLMIntegrationStatisticsProfileFittedFullyRecorded = xsDataMOSFLMIntegrationStatisticsProfileFitted.getFullyRecorded(
                )
                strNumberProfileFittedFullyRecorded += "%7d" % xsDataMOSFLMIntegrationStatisticsProfileFittedFullyRecorded.getNumberOfReflections(
                ).getValue()
                strAverageIntensityProfileFittedFullyRecorded += "%7.0f" % xsDataMOSFLMIntegrationStatisticsProfileFittedFullyRecorded.getAverageIntensity(
                ).getValue()
                strAverageIOverSigmaProfileFittedFullyRecorded += "%7.1f" % xsDataMOSFLMIntegrationStatisticsProfileFittedFullyRecorded.getAverageIOverSigma(
                ).getValue()

                xsDataMOSFLMIntegrationStatisticsProfileFittedPartials = xsDataMOSFLMIntegrationStatisticsProfileFitted.getPartials(
                )
                strNumberProfileFittedPartials += "%7d" % xsDataMOSFLMIntegrationStatisticsProfileFittedPartials.getNumberOfReflections(
                ).getValue()
                strAverageIntensityProfileFittedPartials += "%7.0f" % xsDataMOSFLMIntegrationStatisticsProfileFittedPartials.getAverageIntensity(
                ).getValue()
                strAverageIOverSigmaProfileFittedPartials += "%7.1f" % xsDataMOSFLMIntegrationStatisticsProfileFittedPartials.getAverageIOverSigma(
                ).getValue()

            strResolution += " Overall"
            self.addExecutiveSummaryLine(strResolution)

            strNumberProfileFittedFullyRecorded += "%8d" % xsDataMOSFLMOutputIntegration.getOverallStatistics(
            ).getProfileFitted().getFullyRecorded().getNumberOfReflections(
            ).getValue()
            strAverageIntensityProfileFittedFullyRecorded += "%8.0f" % xsDataMOSFLMOutputIntegration.getOverallStatistics(
            ).getProfileFitted().getFullyRecorded().getAverageIntensity(
            ).getValue()
            strAverageIOverSigmaProfileFittedFullyRecorded += "%8.1f" % xsDataMOSFLMOutputIntegration.getOverallStatistics(
            ).getProfileFitted().getFullyRecorded().getAverageIOverSigma(
            ).getValue()

            strNumberProfileFittedPartials += "%8d" % xsDataMOSFLMOutputIntegration.getOverallStatistics(
            ).getProfileFitted().getPartials().getNumberOfReflections(
            ).getValue()
            strAverageIntensityProfileFittedPartials += "%8.0f" % xsDataMOSFLMOutputIntegration.getOverallStatistics(
            ).getProfileFitted().getPartials().getAverageIntensity().getValue(
            )
            strAverageIOverSigmaProfileFittedPartials += "%8.1f" % xsDataMOSFLMOutputIntegration.getOverallStatistics(
            ).getProfileFitted().getPartials().getAverageIOverSigma().getValue(
            )

            if (iNumberOfFullyRecordedReflections > 0):
                self.addExecutiveSummaryLine("Profile fitted fully recorded:")
                self.addExecutiveSummaryLine(
                    strNumberProfileFittedFullyRecorded)
                self.addExecutiveSummaryLine(
                    strAverageIntensityProfileFittedFullyRecorded)
                self.addExecutiveSummaryLine(
                    strAverageIOverSigmaProfileFittedFullyRecorded)

            self.addExecutiveSummaryLine("Profile fitted partials:")
            self.addExecutiveSummaryLine(strNumberProfileFittedPartials)
            self.addExecutiveSummaryLine(
                strAverageIntensityProfileFittedPartials)
            #self.addExecutiveSummaryLine( strAverageSigmaProfileFittedPartials )
            self.addExecutiveSummaryLine(
                strAverageIOverSigmaProfileFittedPartials)

            self.addExecutiveSummaryLine("")
            self.addExecutiveSummaryLine(
                "Path to MTZ file : %s" % xsDataMOSFLMOutputIntegration.
                getGeneratedMTZFile().getPath().getValue())
 def preProcess(self, _edObject=None):
     EDPluginMOSFLMv10.preProcess(self)
     EDVerbose.DEBUG("EDPluginMOSFLMGeneratePredictionv10.preProcess")
     self.generateMOSFLMCommands()
 def postProcess(self, _edObject=None):
     EDPluginMOSFLMv10.postProcess(self)
     EDVerbose.DEBUG("EDPluginMOSFLMGeneratePredictionv10.postProcess")
     xsDataMOSFLMOutputGeneratePrediction = self.createDataMOSFLMOutputGeneratePrediction()
     self.setDataOutput(xsDataMOSFLMOutputGeneratePrediction)
Beispiel #14
0
 def preProcess(self, _edObject=None):
     EDPluginMOSFLMv10.preProcess(self)
     self.DEBUG("EDPluginMOSFLMIndexingv10.preProcess")
     self.generateMOSFLMCommands()
 def __init__(self):
     EDPluginMOSFLMv10.__init__(self)
     self.setXSDataInputClass(XSDataMOSFLMInputGeneratePrediction)
     self.__strPredictionImageFileName = "EDPluginMOSFLMGeneratePredictionv10.jpg"
Beispiel #16
0
 def preProcess(self, _edObject=None):
     EDPluginMOSFLMv10.preProcess(self)
     self.DEBUG("EDPluginMOSFLMGeneratePredictionv10.preProcess")
     self.generateMOSFLMCommands()
 def preProcess(self, _edObject=None):
     EDPluginMOSFLMv10.preProcess(self)
     self.DEBUG("EDPluginMOSFLMIntegrationv10.preProcess")
     self.generateMOSFLMCommands()
Beispiel #18
0
 def finallyProcess(self, _edObject=None):
     EDPluginMOSFLMv10.finallyProcess(self)
     self.DEBUG("EDPluginMOSFLMIndexingv10.finallyProcess")
     xsDataMOSFLMOutputIndexing = self.createDataMOSFLMOutputIndexing()
     self.setDataOutput(xsDataMOSFLMOutputIndexing)
Beispiel #19
0
 def postProcess(self, _edObject=None):
     EDPluginMOSFLMv10.postProcess(self)
     self.DEBUG("EDPluginMOSFLMGeneratePredictionv10.postProcess")
     xsDataMOSFLMOutputGeneratePrediction = self.createDataMOSFLMOutputGeneratePrediction(
     )
     self.setDataOutput(xsDataMOSFLMOutputGeneratePrediction)
 def __init__(self):
     EDPluginMOSFLMv10.__init__(self)
     self.setXSDataInputClass(XSDataMOSFLMInputIndexing)
    def generateExecutiveSummary(self, _edPlugin):
        """
        Generates a summary of the execution of the plugin.
        """
        EDPluginMOSFLMv10.generateExecutiveSummary(self, _edPlugin)
        EDVerbose.DEBUG("EDPluginMOSFLMIndexingv10.createDataMOSFLMOutputIndexing")
        xsDataMOSFLMInputIndexing = self.getDataInput()
        xsDataMOSFLMOutputIndexing = self.getDataOutput()
        if not self.isFailure():
            self.addExecutiveSummaryLine("Execution of MOSFLM indexing successful.")
        self.addExecutiveSummaryLine("Image directory         : %s" % xsDataMOSFLMInputIndexing.getDirectory().getValue())
        self.addExecutiveSummaryLine("Image template          : %s" % xsDataMOSFLMInputIndexing.getTemplate().getValue())
        strImagesUsed = "Images used in indexing : "
        for xsDataMOSFLMImage in xsDataMOSFLMInputIndexing.getImage():
            strImagesUsed += "%3d" % xsDataMOSFLMImage.getNumber().getValue()
        self.addExecutiveSummaryLine(strImagesUsed)
        if (xsDataMOSFLMInputIndexing.getSymmetry() is not None):
            self.addExecutiveSummaryLine("Target symmetry     : %s" % xsDataMOSFLMInputIndexing.getSymmetry().getValue())
            self.addExecutiveSummaryLine("")
        if (xsDataMOSFLMOutputIndexing is not None):
            self.addExecutiveSummaryLine("")
            self.addExecutiveSummaryLine("List of possible solutions (index, penalty, lattice and cell):")
            iSelectedSolutionNumber = xsDataMOSFLMOutputIndexing.getSelectedSolutionNumber().getValue()
            # Add all solutions with penalty < 100 + 1 solution with penalty > 100
            bAddSolution = False
            listMOSFLMOutputIndexing = xsDataMOSFLMOutputIndexing.getPossibleSolutions()
            iNumberOfSolutions = len(listMOSFLMOutputIndexing)
            for i in range(iNumberOfSolutions):

                iPenalty = listMOSFLMOutputIndexing[i].getPenalty().getValue()
                if (i < (iNumberOfSolutions - 1)):
                    iPenaltyNext = listMOSFLMOutputIndexing[i + 1].getPenalty().getValue()
                    if ((iPenalty >= 100) and (iPenaltyNext <= 100)):
                        bAddSolution = True
                if (bAddSolution):
                    iIndex = listMOSFLMOutputIndexing[i].getIndex().getValue()
                    xsDataCell = listMOSFLMOutputIndexing[i].getCell()
                    strLattice = listMOSFLMOutputIndexing[i].getLattice().getValue()
                    strPossibleSolution = "%3d %4d %2s %6.2f %6.2f %6.2f %6.2f %6.2f %6.2f" % \
                                                (iIndex, iPenalty, strLattice, \
                                                  xsDataCell.getLength_a().getValue(),
                                                  xsDataCell.getLength_b().getValue(),
                                                  xsDataCell.getLength_c().getValue(),
                                                  xsDataCell.getAngle_alpha().getValue(),
                                                  xsDataCell.getAngle_beta().getValue(),
                                                  xsDataCell.getAngle_gamma().getValue(),
                                                 )
                    self.addExecutiveSummaryLine(strPossibleSolution)
                iPenaltyOld = iPenalty
            self.addExecutiveSummaryLine("")
            self.addExecutiveSummaryLine("Choosen solution number   : %14d" % iSelectedSolutionNumber)
            strSelectedSpaceGroup = xsDataMOSFLMOutputIndexing.getSelectedSolutionSpaceGroup().getValue()
            self.addExecutiveSummaryLine("Selected space group      : %14s" % (strSelectedSpaceGroup))
            xsDataCellRefined = xsDataMOSFLMOutputIndexing.getRefinedNewmat().getRefinedCell()
            self.addExecutiveSummaryLine("Refined cell              : %6.2f %7.2f %7.2f %5.1f %5.1f %5.1f" % (\
                                          xsDataCellRefined.getLength_a().getValue(),
                                          xsDataCellRefined.getLength_b().getValue(),
                                          xsDataCellRefined.getLength_c().getValue(),
                                          xsDataCellRefined.getAngle_alpha().getValue(),
                                          xsDataCellRefined.getAngle_beta().getValue(),
                                          xsDataCellRefined.getAngle_gamma().getValue()
                                          ))
            iSpotsTotal = xsDataMOSFLMOutputIndexing.getSpotsTotal().getValue()
            iSpotsUsed = xsDataMOSFLMOutputIndexing.getSpotsUsed().getValue()
            self.addExecutiveSummaryLine("Number of spots used      : %14d " % (iSpotsUsed))
            self.addExecutiveSummaryLine("Number of spots total     : %14d " % (iSpotsTotal))
            fDeviationPositional = xsDataMOSFLMOutputIndexing.getDeviationPositional().getValue()
            fDeviationAngular = xsDataMOSFLMOutputIndexing.getDeviationAngular().getValue()
            self.addExecutiveSummaryLine("Spot deviation positional : %14.2f [mm]" % (fDeviationPositional))
            self.addExecutiveSummaryLine("Spot deviation angular    : %14.2f [degrees]" % (fDeviationAngular))
            fBeamshiftX = xsDataMOSFLMOutputIndexing.getBeamShift().getX().getValue()
            fBeamshiftY = xsDataMOSFLMOutputIndexing.getBeamShift().getY().getValue()
            self.addExecutiveSummaryLine("Beam shift (X, Y)         : %6.3f, %6.3f [mm]" % \
                                          (fBeamshiftX, fBeamshiftY))
            fMosaicityEstimated = xsDataMOSFLMOutputIndexing.getMosaicityEstimation().getValue()
            self.addExecutiveSummaryLine("Estimated mosaicity       : %14.2f [degrees]" % fMosaicityEstimated)
Beispiel #22
0
    def generateExecutiveSummary(self, _edPlugin):
        """
        Generates a summary of the execution of the plugin.
        """
        EDPluginMOSFLMv10.generateExecutiveSummary(self, _edPlugin)
        self.DEBUG("EDPluginMOSFLMIndexingv10.createDataMOSFLMOutputIndexing")
        xsDataMOSFLMInputIndexing = self.getDataInput()
        xsDataMOSFLMOutputIndexing = self.getDataOutput()
        if not self.isFailure():
            self.addExecutiveSummaryLine(
                "Execution of MOSFLM indexing successful.")
        self.addExecutiveSummaryLine(
            "Image directory         : %s" %
            xsDataMOSFLMInputIndexing.getDirectory().getValue())
        self.addExecutiveSummaryLine(
            "Image template          : %s" %
            xsDataMOSFLMInputIndexing.getTemplate().getValue())
        strImagesUsed = "Images used in indexing : "
        for xsDataMOSFLMImage in xsDataMOSFLMInputIndexing.getImage():
            strImagesUsed += "%3d" % xsDataMOSFLMImage.getNumber().getValue()
        self.addExecutiveSummaryLine(strImagesUsed)
        if (xsDataMOSFLMInputIndexing.getSymmetry() is not None):
            self.addExecutiveSummaryLine(
                "Target symmetry     : %s" %
                xsDataMOSFLMInputIndexing.getSymmetry().getValue())
            self.addExecutiveSummaryLine("")
        if (xsDataMOSFLMOutputIndexing is not None):
            self.addExecutiveSummaryLine("")
            self.addExecutiveSummaryLine(
                "List of possible solutions (index, penalty, lattice and cell):"
            )
            iSelectedSolutionNumber = xsDataMOSFLMOutputIndexing.getSelectedSolutionNumber(
            ).getValue()
            # Add all solutions with penalty < 100 + 1 solution with penalty > 100
            bAddSolution = False
            listMOSFLMOutputIndexing = xsDataMOSFLMOutputIndexing.getPossibleSolutions(
            )
            iNumberOfSolutions = len(listMOSFLMOutputIndexing)
            for i in range(iNumberOfSolutions):

                iPenalty = listMOSFLMOutputIndexing[i].getPenalty().getValue()
                if (i < (iNumberOfSolutions - 1)):
                    iPenaltyNext = listMOSFLMOutputIndexing[
                        i + 1].getPenalty().getValue()
                    if ((iPenalty >= 100) and (iPenaltyNext <= 100)):
                        bAddSolution = True
                if (bAddSolution):
                    iIndex = listMOSFLMOutputIndexing[i].getIndex().getValue()
                    xsDataCell = listMOSFLMOutputIndexing[i].getCell()
                    strLattice = listMOSFLMOutputIndexing[i].getLattice(
                    ).getValue()
                    strPossibleSolution = "%3d %4d %2s %6.2f %6.2f %6.2f %6.2f %6.2f %6.2f" % \
                                                (iIndex, iPenalty, strLattice, \
                                                  xsDataCell.getLength_a().getValue(),
                                                  xsDataCell.getLength_b().getValue(),
                                                  xsDataCell.getLength_c().getValue(),
                                                  xsDataCell.getAngle_alpha().getValue(),
                                                  xsDataCell.getAngle_beta().getValue(),
                                                  xsDataCell.getAngle_gamma().getValue(),
                                                 )
                    self.addExecutiveSummaryLine(strPossibleSolution)
                iPenaltyOld = iPenalty
            self.addExecutiveSummaryLine("")
            self.addExecutiveSummaryLine("Choosen solution number   : %14d" %
                                         iSelectedSolutionNumber)
            strSelectedSpaceGroup = xsDataMOSFLMOutputIndexing.getSelectedSolutionSpaceGroup(
            ).getValue()
            self.addExecutiveSummaryLine("Selected space group      : %14s" %
                                         (strSelectedSpaceGroup))
            xsDataCellRefined = xsDataMOSFLMOutputIndexing.getRefinedNewmat(
            ).getRefinedCell()
            self.addExecutiveSummaryLine("Refined cell              : %6.2f %7.2f %7.2f %5.1f %5.1f %5.1f" % (\
                                          xsDataCellRefined.getLength_a().getValue(),
                                          xsDataCellRefined.getLength_b().getValue(),
                                          xsDataCellRefined.getLength_c().getValue(),
                                          xsDataCellRefined.getAngle_alpha().getValue(),
                                          xsDataCellRefined.getAngle_beta().getValue(),
                                          xsDataCellRefined.getAngle_gamma().getValue()
                                          ))
            iSpotsTotal = xsDataMOSFLMOutputIndexing.getSpotsTotal().getValue()
            iSpotsUsed = xsDataMOSFLMOutputIndexing.getSpotsUsed().getValue()
            self.addExecutiveSummaryLine("Number of spots used      : %14d " %
                                         (iSpotsUsed))
            self.addExecutiveSummaryLine("Number of spots total     : %14d " %
                                         (iSpotsTotal))
            fDeviationPositional = xsDataMOSFLMOutputIndexing.getDeviationPositional(
            ).getValue()
            fDeviationAngular = xsDataMOSFLMOutputIndexing.getDeviationAngular(
            ).getValue()
            self.addExecutiveSummaryLine(
                "Spot deviation positional : %14.2f [mm]" %
                (fDeviationPositional))
            self.addExecutiveSummaryLine(
                "Spot deviation angular    : %14.2f [degrees]" %
                (fDeviationAngular))
            fBeamshiftX = xsDataMOSFLMOutputIndexing.getBeamShift().getX(
            ).getValue()
            fBeamshiftY = xsDataMOSFLMOutputIndexing.getBeamShift().getY(
            ).getValue()
            self.addExecutiveSummaryLine("Beam shift (X, Y)         : %6.3f, %6.3f [mm]" % \
                                          (fBeamshiftX, fBeamshiftY))
            fMosaicityEstimated = xsDataMOSFLMOutputIndexing.getMosaicityEstimation(
            ).getValue()
            self.addExecutiveSummaryLine(
                "Estimated mosaicity       : %14.2f [degrees]" %
                fMosaicityEstimated)
    def generateExecutiveSummary(self, _edPlugin):
        """
        Generates a summary of the execution of the plugin.
        """
        EDPluginMOSFLMv10.generateExecutiveSummary(self, _edPlugin)
        self.DEBUG("EDPluginMOSFLMIntegrationv10.createDataMOSFLMOutputIndexing")
        xsDataMOSFLMInputIntegration = self.getDataInput()
        xsDataMOSFLMOutputIntegration = self.getDataOutput()
        if xsDataMOSFLMOutputIntegration.getNumberOfFullyRecordedReflections() is not None:
            self.addExecutiveSummaryLine("Execution of MOSFLM integration successful.")
            self.addExecutiveSummaryLine("Image directory     : %s" % xsDataMOSFLMInputIntegration.getDirectory().getValue())
            self.addExecutiveSummaryLine("Image template      : %s" % xsDataMOSFLMInputIntegration.getTemplate().getValue())
            self.addExecutiveSummaryLine("Image start         : %4d" % xsDataMOSFLMInputIntegration.getImageStart().getValue())
            self.addExecutiveSummaryLine("Image end           : %4d" % xsDataMOSFLMInputIntegration.getImageEnd().getValue())
            fRotationAxisStart = xsDataMOSFLMInputIntegration.getRotationAxisStart().getValue()
            fOscillationWidth = xsDataMOSFLMInputIntegration.getOscillationWidth().getValue()
            self.addExecutiveSummaryLine("Rotation axis start : %4.1f [degrees]" % fRotationAxisStart)
            self.addExecutiveSummaryLine("Rotation axis end   : %4.1f [degrees]" % (fRotationAxisStart + fOscillationWidth))
            self.addExecutiveSummaryLine("")
            iNumberOfFullyRecordedReflections = xsDataMOSFLMOutputIntegration.getNumberOfFullyRecordedReflections().getValue()
            self.addExecutiveSummaryLine("Number of fully recorded reflections          : %5d" % iNumberOfFullyRecordedReflections)
            self.addExecutiveSummaryLine("Number of partials                            : %5d" % xsDataMOSFLMOutputIntegration.getNumberOfPartialReflections().getValue())
            self.addExecutiveSummaryLine("Number of overlapped reflections              : %5d" % xsDataMOSFLMOutputIntegration.getNumberOfOverlappedReflections().getValue())
            self.addExecutiveSummaryLine("Number of reflections with negative intensity : %5d" % xsDataMOSFLMOutputIntegration.getNumberOfNegativeReflections().getValue())
            self.addExecutiveSummaryLine("Number of bad reflections                     : %5d" % xsDataMOSFLMOutputIntegration.getNumberOfBadReflections().getValue())
            self.addExecutiveSummaryLine("")
            self.addExecutiveSummaryLine("RMS spot deviation                            : %5.3f [mm]" % xsDataMOSFLMOutputIntegration.getRMSSpotDeviation().getValue())
            self.addExecutiveSummaryLine("Average I/sigma overall                       : %5.1f" % xsDataMOSFLMOutputIntegration.getOverallIOverSigma().getValue())
            self.addExecutiveSummaryLine("Average I/sigma at highest resolution         : %5.1f" % xsDataMOSFLMOutputIntegration.getHighestResolutionIOverSigma().getValue())
            self.addExecutiveSummaryLine("")
            self.addExecutiveSummaryLine("Analysis as a function of resolution:")
            strResolution = "Res (Ang) "

            strNumberProfileFittedFullyRecorded = "Number    "
            strAverageIntensityProfileFittedFullyRecorded = " <I>      "
            strAverageIOverSigmaProfileFittedFullyRecorded = " <I/sigma>"

            strNumberProfileFittedPartials = "Number    "
            strAverageIntensityProfileFittedPartials = " <I>      "
            strAverageIOverSigmaProfileFittedPartials = " <I/sigma>"

            for xsDataMOSFLMIntegrationStatisticsPerResolutionBin in xsDataMOSFLMOutputIntegration.getStatisticsPerResolutionBin():
                fMaxResolution = xsDataMOSFLMIntegrationStatisticsPerResolutionBin.getMaxResolution().getValue()
                strResolution += "%7.2f" % fMaxResolution
                xsDataMOSFLMIntegrationStatisticsProfileFitted = xsDataMOSFLMIntegrationStatisticsPerResolutionBin.getProfileFitted()

                xsDataMOSFLMIntegrationStatisticsProfileFittedFullyRecorded = xsDataMOSFLMIntegrationStatisticsProfileFitted.getFullyRecorded()
                strNumberProfileFittedFullyRecorded += "%7d" % xsDataMOSFLMIntegrationStatisticsProfileFittedFullyRecorded.getNumberOfReflections().getValue()
                strAverageIntensityProfileFittedFullyRecorded += "%7.0f" % xsDataMOSFLMIntegrationStatisticsProfileFittedFullyRecorded.getAverageIntensity().getValue()
                strAverageIOverSigmaProfileFittedFullyRecorded += "%7.1f" % xsDataMOSFLMIntegrationStatisticsProfileFittedFullyRecorded.getAverageIOverSigma().getValue()

                xsDataMOSFLMIntegrationStatisticsProfileFittedPartials = xsDataMOSFLMIntegrationStatisticsProfileFitted.getPartials()
                strNumberProfileFittedPartials += "%7d" % xsDataMOSFLMIntegrationStatisticsProfileFittedPartials.getNumberOfReflections().getValue()
                strAverageIntensityProfileFittedPartials += "%7.0f" % xsDataMOSFLMIntegrationStatisticsProfileFittedPartials.getAverageIntensity().getValue()
                strAverageIOverSigmaProfileFittedPartials += "%7.1f" % xsDataMOSFLMIntegrationStatisticsProfileFittedPartials.getAverageIOverSigma().getValue()

            strResolution += " Overall"
            self.addExecutiveSummaryLine(strResolution)

            strNumberProfileFittedFullyRecorded += "%8d" % xsDataMOSFLMOutputIntegration.getOverallStatistics().getProfileFitted().getFullyRecorded().getNumberOfReflections().getValue()
            strAverageIntensityProfileFittedFullyRecorded += "%8.0f" % xsDataMOSFLMOutputIntegration.getOverallStatistics().getProfileFitted().getFullyRecorded().getAverageIntensity().getValue()
            strAverageIOverSigmaProfileFittedFullyRecorded += "%8.1f" % xsDataMOSFLMOutputIntegration.getOverallStatistics().getProfileFitted().getFullyRecorded().getAverageIOverSigma().getValue()

            strNumberProfileFittedPartials += "%8d" % xsDataMOSFLMOutputIntegration.getOverallStatistics().getProfileFitted().getPartials().getNumberOfReflections().getValue()
            strAverageIntensityProfileFittedPartials += "%8.0f" % xsDataMOSFLMOutputIntegration.getOverallStatistics().getProfileFitted().getPartials().getAverageIntensity().getValue()
            strAverageIOverSigmaProfileFittedPartials += "%8.1f" % xsDataMOSFLMOutputIntegration.getOverallStatistics().getProfileFitted().getPartials().getAverageIOverSigma().getValue()

            if (iNumberOfFullyRecordedReflections > 0):
                self.addExecutiveSummaryLine("Profile fitted fully recorded:")
                self.addExecutiveSummaryLine(strNumberProfileFittedFullyRecorded)
                self.addExecutiveSummaryLine(strAverageIntensityProfileFittedFullyRecorded)
                self.addExecutiveSummaryLine(strAverageIOverSigmaProfileFittedFullyRecorded)

            self.addExecutiveSummaryLine("Profile fitted partials:")
            self.addExecutiveSummaryLine(strNumberProfileFittedPartials)
            self.addExecutiveSummaryLine(strAverageIntensityProfileFittedPartials)
            #self.addExecutiveSummaryLine( strAverageSigmaProfileFittedPartials )
            self.addExecutiveSummaryLine(strAverageIOverSigmaProfileFittedPartials)

            self.addExecutiveSummaryLine("")
            self.addExecutiveSummaryLine("Path to MTZ file : %s" % xsDataMOSFLMOutputIntegration.getGeneratedMTZFile().getPath().getValue())
 def configure(self):
     EDPluginMOSFLMv10.configure(self)
     self.DEBUG("EDPluginMOSFLMGeneratePredictionv10.configure")
     self.createPredictionImageFileName()
 def __init__(self):
     EDPluginMOSFLMv10.__init__(self)
     self.setXSDataInputClass(XSDataMOSFLMInputIntegration)
     self.setDataOutput(XSDataMOSFLMOutputIntegration())
Beispiel #26
0
 def __init__(self):
     EDPluginMOSFLMv10.__init__(self)
     self.setXSDataInputClass(XSDataMOSFLMInputGeneratePrediction)
     self.__strPredictionImageFileName = "EDPluginMOSFLMGeneratePredictionv10.jpg"
 def finallyProcess(self, _edObject=None):
     EDPluginMOSFLMv10.postProcess(self)
     EDVerbose.DEBUG("EDPluginMOSFLMIndexingv10.finallyProcess")
     xsDataMOSFLMOutputIndexing = self.createDataMOSFLMOutputIndexing()
     self.setDataOutput(xsDataMOSFLMOutputIndexing)
Beispiel #28
0
 def __init__(self):
     EDPluginMOSFLMv10.__init__(self)
     self.setXSDataInputClass(XSDataMOSFLMInputIndexing)
 def configure(self):
     EDPluginMOSFLMv10.configure(self)
     EDVerbose.DEBUG("EDPluginMOSFLMIndexingv10.configure")
     xsPluginItem = self.getConfiguration()
     if (xsPluginItem == None):
         EDVerbose.DEBUG("EDPluginMOSFLMIndexingv10.configure: xsPluginItem is None")
 def configure(self):
     EDPluginMOSFLMv10.configure(self)
     self.DEBUG("EDPluginMOSFLMIntegrationv10.configure")
     xsPluginItem = self.getConfiguration()
     if (xsPluginItem == None):
         self.DEBUG("EDPluginMOSFLMIntegrationv10.configure: xsPluginItem is None")