def testSetDataModelInput(self):
        """
        A test for whether we can obtain the expected XML by setting a certain input for the plugin. 
        """
        edPluginISPyB = self.createPlugin()
        xsPluginItemISPyB = self.getPluginConfiguration(os.path.join(self.getPluginTestsDataHome(), "XSConfiguration.xml"))
        edPluginISPyB.setConfiguration(xsPluginItemISPyB)
        edPluginISPyB.configure()

        # Create XSDataISPyB objects

        xsDataISPyBImage = XSDataISPyBImage()
        xsDataISPyBImage.setFileName(XSDataString("test.img"))
        xsDataISPyBImage.setFileLocation(XSDataString("/tmp"))

        xsDataISPyBScreening = XSDataISPyBScreening()
        xsDataISPyBScreening.setProgramVersion(XSDataString("EDNA Prototype"))

        xsDataISPyBScreeningInput = XSDataISPyBScreeningInput()
        xsDataISPyBScreeningInput.setBeamX(XSDataDouble(10.4))
        xsDataISPyBScreeningInput.setBeamY(XSDataDouble(2.31))
        xsDataISPyBScreeningInput.setRmsErrorLimits(XSDataDouble(0.8))
        xsDataISPyBScreeningInput.setMinimumFractionIndexed(XSDataDouble(0.4))
        xsDataISPyBScreeningInput.setMaximumFractionRejected(XSDataDouble(0.45))
        xsDataISPyBScreeningInput.setMinimumSignalToNoise(XSDataDouble(0.56))

        xsDataISPyBScreeningOutput = XSDataISPyBScreeningOutput()
        xsDataISPyBScreeningOutput.setStatusDescription(XSDataString("It's just fine."))
        xsDataISPyBScreeningOutput.setMosaicity(XSDataDouble(0.25))
        xsDataISPyBScreeningOutput.setBeamShiftX(XSDataDouble (0.141))
        xsDataISPyBScreeningOutput.setBeamShiftY(XSDataDouble (0.156))

        xsDataISPyBScreeningOutputLattice = XSDataISPyBScreeningOutputLattice()
        xsDataISPyBScreeningOutputLattice.setSpaceGroup(XSDataString("P222"))

        xsDataISPyBScreeningStrategy = XSDataISPyBScreeningStrategy()
        xsDataISPyBScreeningStrategy.setPhiStart(XSDataDouble(0))
        xsDataISPyBScreeningStrategy.setPhiEnd(XSDataDouble(20))
        xsDataISPyBScreeningStrategy.setRotation(XSDataDouble(1))
        xsDataISPyBScreeningStrategy.setProgram(XSDataString("EDNA"))
        xsDataISPyBScreeningStrategy.setAnomalous(XSDataBoolean(1))

        xsDataISPyBScreeningStrategyWedge = XSDataISPyBScreeningStrategyWedge()
        xsDataISPyBScreeningStrategyWedge.setWedgeNumber(XSDataInteger(1))
        xsDataISPyBScreeningStrategyWedge.setResolution(XSDataDouble(2.1))
        xsDataISPyBScreeningStrategyWedge.setCompleteness(XSDataDouble(90))
        xsDataISPyBScreeningStrategyWedge.setMultiplicity(XSDataDouble(1.5))
        xsDataISPyBScreeningStrategyWedge.setDoseTotal(XSDataDouble(40.5))
        xsDataISPyBScreeningStrategyWedge.setNumberOfImages(XSDataInteger(130))

        xsDataISPyBScreeningStrategySubWedge = XSDataISPyBScreeningStrategySubWedge()
        xsDataISPyBScreeningStrategySubWedge.setSubWedgeNumber(XSDataInteger(1))
        xsDataISPyBScreeningStrategySubWedge.setRotationAxis(XSDataString("Omega"))
        xsDataISPyBScreeningStrategySubWedge.setAxisStart(XSDataDouble(0.0))
        xsDataISPyBScreeningStrategySubWedge.setAxisEnd(XSDataDouble(90.0))
        xsDataISPyBScreeningStrategySubWedge.setExposureTime(XSDataDouble(0.5))
        xsDataISPyBScreeningStrategySubWedge.setTransmission(XSDataDouble(100.0))
        xsDataISPyBScreeningStrategySubWedge.setNumberOfImages(XSDataInteger(130))

        xsDataISPyBScreeningStrategyWedgeContainer = XSDataISPyBScreeningStrategyWedgeContainer()
        xsDataISPyBScreeningStrategyWedgeContainer.setScreeningStrategyWedge(xsDataISPyBScreeningStrategyWedge)
        xsDataISPyBScreeningStrategyWedgeContainer.getScreeningStrategySubWedge().append(xsDataISPyBScreeningStrategySubWedge)

        xsDataISPyBScreeningStrategyContainer = XSDataISPyBScreeningStrategyContainer()
        xsDataISPyBScreeningStrategyContainer.setScreeningStrategy(xsDataISPyBScreeningStrategy)
        xsDataISPyBScreeningStrategyContainer.getScreeningStrategyWedgeContainer().append(xsDataISPyBScreeningStrategyWedgeContainer)

        xsDataISPyBScreeningOutputContainer = XSDataISPyBScreeningOutputContainer()
        xsDataISPyBScreeningOutputContainer.setScreeningOutput(xsDataISPyBScreeningOutput)
        xsDataISPyBScreeningOutputContainer.getScreeningOutputLattice().append(xsDataISPyBScreeningOutputLattice)
        xsDataISPyBScreeningOutputContainer.getScreeningStrategyContainer().append(xsDataISPyBScreeningStrategyContainer)

        xsDataISPyBScreeningRank = XSDataISPyBScreeningRank()
        xsDataISPyBScreeningRank.setRankValue(XSDataDouble(1.4))
        xsDataISPyBScreeningRank.setRankInformation(XSDataString("This is the only one"))

        xsDataISPyBScreeningRankSet = XSDataISPyBScreeningRankSet()
        xsDataISPyBScreeningRankSet.setRankEngine(XSDataString("ISPyB"))

        xsDataISPyBScreeningFile = XSDataISPyBScreeningFile()
        xsDataISPyBScreeningFile.setFileType(XSDataString("log"))
        xsDataISPyBScreeningFile.setDescription(XSDataString("Output log file"))

        # Write XSDataISPyB objects to files
        xsDataISPyBScreening.outputFile(self.__strObtainedScreening)
        xsDataISPyBScreeningInput.outputFile(self.__strObtainedScreeningInput)
        xsDataISPyBScreeningOutputContainer.outputFile(self.__strObtainedScreeningOutputContainer)
        xsDataISPyBScreeningRank.outputFile(self.__strObtainedScreeningRank)
        xsDataISPyBScreeningRankSet.outputFile(self.__strObtainedScreeningRankSet)
        xsDataISPyBScreeningFile.outputFile(self.__strObtainedScreeningFile)

        # Compare screening
        strInputScreeningExpected = self.readAndParseFile(self.__strReferenceInputScreening)
        xsDataScreeningExpected = XSDataInputISPyB.parseString(strInputScreeningExpected)
        strXMLScreeningExpected = xsDataScreeningExpected.marshal()

        strScreeningObtained = self.readAndParseFile(self.__strObtainedScreening)
        xsDataScreeningObtained = XSDataInputISPyB.parseString(strScreeningObtained)
        strXMLScreeningObtained = xsDataScreeningObtained.marshal()

        EDAssert.equal(strXMLScreeningExpected, strXMLScreeningObtained)

        #Compare screeningInput
        strInputScreeningInputExpected = self.readAndParseFile(self.__strReferenceInputScreeningInput)
        xsDataScreeningInputExpected = XSDataInputISPyB.parseString(strInputScreeningInputExpected)
        strXMLScreeningInputExpected = xsDataScreeningInputExpected.marshal()

        strScreeningInputObtained = self.readAndParseFile(self.__strObtainedScreeningInput)
        xsDataScreeningInputObtained = XSDataInputISPyB.parseString(strScreeningInputObtained)
        strXMLScreeningInputObtained = xsDataScreeningInputObtained.marshal()

        EDAssert.equal(strXMLScreeningInputExpected, strXMLScreeningInputObtained)

        #Compare screeningOutputContainer
        strInputScreeningOutputContainerExpected = self.readAndParseFile(self.__strReferenceInputScreeningOutputContainer)
        xsDataScreeningOutputContainerExpected = XSDataInputISPyB.parseString(strInputScreeningOutputContainerExpected)
        strXMLScreeningOutputContainerExpected = xsDataScreeningOutputContainerExpected.marshal()

        strScreeningOutputContainerObtained = self.readAndParseFile(self.__strObtainedScreeningOutputContainer)
        xsDataScreeningOutputContainerObtained = XSDataInputISPyB.parseString(strScreeningOutputContainerObtained)
        strXMLScreeningOutputContainerObtained = xsDataScreeningOutputContainerObtained.marshal()

        EDAssert.equal(strXMLScreeningOutputContainerExpected, strXMLScreeningOutputContainerObtained)

        #Compare screeningRank
        strInputScreeningRankExpected = self.readAndParseFile(self.__strReferenceInputScreeningRank)
        xsDataScreeningRankExpected = XSDataInputISPyB.parseString(strInputScreeningRankExpected)
        strXMLScreeningRankExpected = xsDataScreeningRankExpected.marshal()

        strScreeningRankObtained = self.readAndParseFile(self.__strObtainedScreeningRank)
        xsDataScreeningRankObtained = XSDataInputISPyB.parseString(strScreeningRankObtained)
        strXMLScreeningRankObtained = xsDataScreeningRankObtained.marshal()

        EDAssert.equal(strXMLScreeningRankExpected, strXMLScreeningRankObtained)

        #Compare screeningRankSet
        strInputScreeningRankSetExpected = self.readAndParseFile(self.__strReferenceInputScreeningRankSet)
        xsDataScreeningRankSetExpected = XSDataInputISPyB.parseString(strInputScreeningRankSetExpected)
        strXMLScreeningRankSetExpected = xsDataScreeningRankSetExpected.marshal()

        strScreeningRankSetObtained = self.readAndParseFile(self.__strObtainedScreeningRankSet)
        xsDataScreeningRankSetObtained = XSDataInputISPyB.parseString(strScreeningRankSetObtained)
        strXMLScreeningRankSetObtained = xsDataScreeningRankSetObtained.marshal()

        EDAssert.equal(strXMLScreeningRankSetExpected, strXMLScreeningRankSetObtained)

        #Compare screeningFile
        strInputScreeningFileExpected = self.readAndParseFile(self.__strReferenceInputScreeningFile)
        xsDataScreeningFileExpected = XSDataInputISPyB.parseString(strInputScreeningFileExpected)
        strXMLScreeningFileExpected = xsDataScreeningFileExpected.marshal()

        strScreeningFileObtained = self.readAndParseFile(self.__strObtainedScreeningFile)
        xsDataScreeningFileObtained = XSDataInputISPyB.parseString(strScreeningFileObtained)
        strXMLScreeningFileObtained = xsDataScreeningFileObtained.marshal()

        EDAssert.equal(strXMLScreeningFileExpected, strXMLScreeningFileObtained)

        self.cleanUp(edPluginISPyB)
    def generateXSDataISPyBScreeningOutputContainer(_xsDataInputControlISPyB, _strStatusMessage=None):
        """
        """
        EDFactoryPluginStatic.loadModule("XSDataISPyBv1_2")
        from XSDataISPyBv1_2 import XSDataISPyBScreeningOutputContainer
        from XSDataISPyBv1_2 import XSDataISPyBScreeningOutput
        from XSDataISPyBv1_2 import XSDataISPyBScreeningOutputLattice
        from XSDataISPyBv1_2 import XSDataISPyBScreeningStrategyContainer
        from XSDataISPyBv1_2 import XSDataISPyBScreeningStrategyWedgeContainer
        from XSDataISPyBv1_2 import XSDataISPyBScreeningStrategy
        from XSDataISPyBv1_2 import XSDataISPyBScreeningStrategyWedge
        from XSDataISPyBv1_2 import XSDataISPyBScreeningStrategySubWedge
        from XSDataISPyBv1_2 import XSDataDouble
        from XSDataISPyBv1_2 import XSDataInteger
        from XSDataISPyBv1_2 import XSDataBoolean
        from XSDataISPyBv1_2 import XSDataString
        import math
        EDFactoryPluginStatic.loadModule("EDHandlerXSDataCommon") # Needed for getting kappa and phi 
        from EDHandlerXSDataCommon import EDHandlerXSDataCommon   #

        xsDataISPyBScreeningOutputContainer = XSDataISPyBScreeningOutputContainer()
        xsDataISPyBScreeningOutput = XSDataISPyBScreeningOutput()
        xsDataISPyBScreeningOutputContainer.setScreeningOutput(xsDataISPyBScreeningOutput)

        xsDataResultCharacterisationv2_0 = _xsDataInputControlISPyB.getCharacterisationResult()
        xsDataResultCharacterisation = xsDataResultCharacterisationv2_0.getMxv1ResultCharacterisation()
        xsDataResultStrategySuggested = xsDataResultCharacterisationv2_0.getSuggestedStrategy()

        # Determine whether anomalous data:
        bAnomalousData = None
        #xsDataCollection = xsDataResultCharacterisation.getDataCollection()
        xsDataCollection = EDHandlerXSDataISPyBv2_0.getDataCollectionFromSuggestedStrategy(xsDataResultCharacterisationv2_0)
        if (xsDataCollection is not None):
            xsDataDiffractionPlan = xsDataCollection.getDiffractionPlan()
            if (xsDataDiffractionPlan is not None):
                if (xsDataDiffractionPlan.getAnomalousData() is not None):
                    bAnomalousData = xsDataDiffractionPlan.getAnomalousData().getValue()


        # Indexing information (populate xsDataISPyBScreeningOutputContainer, xsDataIPSyBScreeningOutput and xsDataISPyBScreeningOutputLattice)
        bSuccessfulIndexing = False
        
        xsDataIndexingResult = xsDataResultCharacterisation.getIndexingResult()
        if (xsDataIndexingResult is not None):
            xsDataIndexingSolutionSelected = xsDataIndexingResult.getSelectedSolution()
            if (xsDataIndexingSolutionSelected is not None):
                bSuccessfulIndexing = True
                xsDataStatisticsIndexing = xsDataIndexingSolutionSelected.getStatistics()
                if (xsDataStatisticsIndexing is not None):
                    fBeamPositionShiftX = xsDataStatisticsIndexing.getBeamPositionShiftX().getValue()
                    fBeamPositionShiftY = xsDataStatisticsIndexing.getBeamPositionShiftY().getValue()
                    xsDataISPyBScreeningOutput.setBeamShiftX(XSDataDouble(fBeamPositionShiftX))
                    xsDataISPyBScreeningOutput.setBeamShiftY(XSDataDouble(fBeamPositionShiftY))
                    fSpotDeviationAngular = xsDataStatisticsIndexing.getSpotDeviationAngular().getValue()
                    fSpotDeviationPositional = xsDataStatisticsIndexing.getSpotDeviationPositional().getValue()
                    xsDataISPyBScreeningOutput.setSpotDeviationR(XSDataDouble(fSpotDeviationPositional))
                    xsDataISPyBScreeningOutput.setSpotDeviationTheta(XSDataDouble(fSpotDeviationAngular))
                    if ((xsDataStatisticsIndexing.getSpotsTotal() is not None) and (xsDataStatisticsIndexing.getSpotsUsed is not None)):
                        iSpotsTotal = xsDataStatisticsIndexing.getSpotsTotal().getValue()
                        iSpotsUsed = xsDataStatisticsIndexing.getSpotsUsed().getValue()
                        xsDataISPyBScreeningOutput.setNumSpotsFound(XSDataInteger(iSpotsTotal))
                        xsDataISPyBScreeningOutput.setNumSpotsUsed(XSDataInteger(iSpotsUsed))
                        xsDataISPyBScreeningOutput.setNumSpotsRejected(XSDataInteger(iSpotsTotal - iSpotsUsed))
                xsDataCrystal = xsDataIndexingSolutionSelected.getCrystal()
                xsDataISPyBScreeningOutput.setMosaicityEstimated(XSDataBoolean(False))
                if (xsDataCrystal is not None):
                    if (xsDataCrystal.getMosaicity() is not None):
                        fMosaicity = xsDataCrystal.getMosaicity().getValue()
                        xsDataISPyBScreeningOutput.setMosaicity(XSDataDouble(fMosaicity))
                        xsDataISPyBScreeningOutput.setMosaicityEstimated(XSDataBoolean(True))
                    xsDataCell = xsDataCrystal.getCell()
                    if (xsDataCell is not None):
                        fLength_a = xsDataCell.getLength_a().getValue()
                        fLength_b = xsDataCell.getLength_b().getValue()
                        fLength_c = xsDataCell.getLength_c().getValue()
                        fAngle_alpha = xsDataCell.getAngle_alpha().getValue()
                        fAngle_beta = xsDataCell.getAngle_beta().getValue()
                        fAngle_gamma = xsDataCell.getAngle_gamma().getValue()

                        xsDataISPyBScreeningOutputLattice = XSDataISPyBScreeningOutputLattice()
                        xsDataISPyBScreeningOutputContainer.getScreeningOutputLattice().append(xsDataISPyBScreeningOutputLattice)

                        xsDataISPyBScreeningOutputLattice.setUnitCell_a(XSDataDouble(fLength_a))
                        xsDataISPyBScreeningOutputLattice.setUnitCell_b(XSDataDouble(fLength_b))
                        xsDataISPyBScreeningOutputLattice.setUnitCell_c(XSDataDouble(fLength_c))
                        xsDataISPyBScreeningOutputLattice.setUnitCell_alpha(XSDataDouble(fAngle_alpha))
                        xsDataISPyBScreeningOutputLattice.setUnitCell_beta(XSDataDouble(fAngle_beta))
                        xsDataISPyBScreeningOutputLattice.setUnitCell_gamma(XSDataDouble(fAngle_gamma))
                    xsDataSpaceGroup = xsDataCrystal.getSpaceGroup()
                    if (xsDataSpaceGroup is not None):
                        pyStrSpaceGroupName = xsDataSpaceGroup.getName().getValue()
                        xsDataISPyBScreeningOutputLattice.setSpaceGroup(XSDataString(pyStrSpaceGroupName))
        if (bSuccessfulIndexing):
            if _strStatusMessage == None:
                xsDataISPyBScreeningOutput.setStatusDescription(XSDataString("Indexing successful"))
            else:
                xsDataISPyBScreeningOutput.setStatusDescription(XSDataString(_strStatusMessage))
            xsDataISPyBScreeningOutput.setScreeningSuccess(XSDataBoolean(True))
        else:
            if _strStatusMessage == None:
                xsDataISPyBScreeningOutput.setStatusDescription(XSDataString("Indexing failed"))
            else:
                xsDataISPyBScreeningOutput.setStatusDescription(XSDataString(_strStatusMessage))
            xsDataISPyBScreeningOutput.setScreeningSuccess(XSDataBoolean(False))



        # Strategy information (populate xsDataISPyBScreeningStrategyContainer, xsDataISPyBScreeningStrategyWedge, xsDataISPyBScreeningStrategySubWedge)
        xsDataResultStrategy = xsDataResultStrategySuggested # xsDataResultCharacterisation.getStrategyResult()

        xsDataISPyBScreeningStrategyContainer = XSDataISPyBScreeningStrategyContainer()
        xsDataISPyBScreeningStrategy = XSDataISPyBScreeningStrategy()
        xsDataISPyBScreeningStrategyContainer.setScreeningStrategy(xsDataISPyBScreeningStrategy)
        xsDataISPyBScreeningOutputContainer.getScreeningStrategyContainer().append(xsDataISPyBScreeningStrategyContainer)
        fAccumulatedExposureTime = 0.0

        if (bAnomalousData is not None):
            xsDataISPyBScreeningStrategy.setAnomalous(XSDataBoolean(bAnomalousData))
        else:
            xsDataISPyBScreeningStrategy.setAnomalous(XSDataBoolean(False))

        xsDataISPyBScreeningStrategy.setProgram(XSDataString("STAC"))

        if (xsDataResultStrategy is not None):
            lXSDataCollectionPlan = xsDataResultStrategy.getCollectionPlan()
            if (lXSDataCollectionPlan is not None):
                for xsDataCollectionPlan in lXSDataCollectionPlan:
                    iCollectionPlanNumber = xsDataCollectionPlan.getCollectionPlanNumber().getValue()

                    #strCollectionPlanComment = None
                    #if (xsDataCollectionPlan.getComment() is not None):
                    #    strCollectionPlanComment = xsDataCollectionPlan.getComment().getValue()
                    fCompleteness = None
                    fMultiplicity = None
                    fResolution = None
                    fRankingResolution = None
                    fTransmission = None
                    iWedgeNumberOfImages = 0
                    fWedgeDoseTotal = 0.0
                    xsDataStrategySummary = xsDataCollectionPlan.getStrategySummary()
                    if (xsDataStrategySummary is not None):
                        if (xsDataStrategySummary.getCompleteness() is not None):
                            fCompleteness = xsDataStrategySummary.getCompleteness().getValue()
                        if (xsDataStrategySummary.getRedundancy() is not None):
                            fMultiplicity = xsDataStrategySummary.getRedundancy().getValue()
                        if (xsDataStrategySummary.getResolution() is not None):
                            fResolution = xsDataStrategySummary.getResolution().getValue()
                        if (xsDataStrategySummary.getRankingResolution() is not None):
                            fRankingResolution = xsDataStrategySummary.getRankingResolution().getValue()
                            xsDataISPyBScreeningStrategy.setRankingResolution(XSDataDouble(fRankingResolution))

                    xsDataISPyBScreeningStrategyWedgeContainer = XSDataISPyBScreeningStrategyWedgeContainer()
                    xsDataISPyBScreeningStrategyWedge = XSDataISPyBScreeningStrategyWedge()
                    xsDataISPyBScreeningStrategyWedgeContainer.setScreeningStrategyWedge(xsDataISPyBScreeningStrategyWedge)
                    xsDataISPyBScreeningStrategyContainer.getScreeningStrategyWedgeContainer().append(xsDataISPyBScreeningStrategyWedgeContainer)

                    xsDataISPyBScreeningStrategyWedge.setWedgeNumber(XSDataInteger(iCollectionPlanNumber))
                    xsDataISPyBScreeningStrategyWedge.setCompleteness(XSDataDouble(fCompleteness))
                    xsDataISPyBScreeningStrategyWedge.setMultiplicity(XSDataDouble(fMultiplicity))
                    xsDataISPyBScreeningStrategyWedge.setResolution(XSDataDouble(fResolution))
                    
                    # Find kappa and phi
                    xsDataStringComment = xsDataCollectionPlan.getComment()
                    xsDataDoubleOmega = EDHandlerXSDataCommon.getElements(xsDataStringComment, "OMEGA=")
                    xsDataDoubleKappa = EDHandlerXSDataCommon.getElements(xsDataStringComment, "KAPPA=")
                    xsDataDoublePhi = EDHandlerXSDataCommon.getElements(xsDataStringComment, "PHI=")
                                        
                    xsDataISPyBScreeningStrategyWedge.setKappa(xsDataDoubleKappa)
                    xsDataISPyBScreeningStrategyWedge.setPhi(xsDataDoublePhi)

                    xsDataCollectionStrategy = xsDataCollectionPlan.getCollectionStrategy()
                    if (xsDataCollectionStrategy is not None):
                        lXSDataSubWedge = xsDataCollectionStrategy.getSubWedge()
                        if (lXSDataSubWedge is not None):
                            for xsDataSubWedge in lXSDataSubWedge:
                                iSubWedgeNumber = xsDataSubWedge.getSubWedgeNumber().getValue()
                                fPhiStart = xsDataSubWedge.getExperimentalCondition().getGoniostat().getRotationAxisStart().getValue()
                                fPhiEnd = xsDataSubWedge.getExperimentalCondition().getGoniostat().getRotationAxisEnd().getValue()
                                fRotation = xsDataSubWedge.getExperimentalCondition().getGoniostat().getOscillationWidth().getValue()
                                fExposureTime = xsDataSubWedge.getExperimentalCondition().getBeam().getExposureTime().getValue()
                                fAccumulatedExposureTime += fExposureTime
                                xsDataDoubleTransmission = xsDataSubWedge.getExperimentalCondition().getBeam().getTransmission()
                                if (xsDataDoubleTransmission is not None): 
                                    fTransmission = xsDataDoubleTransmission.getValue()
                                else:
                                    fTransmission = None
                                if (not xsDataSubWedge.getExperimentalCondition().getBeam().getFlux() is None):
                                    fFlux = xsDataSubWedge.getExperimentalCondition().getBeam().getFlux().getValue()
                                else:
                                    fFlux = None
                                iNumberOfImages = int(math.ceil((fPhiEnd - fPhiStart) / fRotation))

                                xsDataISPyBScreeningStrategySubWedge = XSDataISPyBScreeningStrategySubWedge()
                                xsDataISPyBScreeningStrategyWedgeContainer.getScreeningStrategySubWedge().append(xsDataISPyBScreeningStrategySubWedge)

                                xsDataISPyBScreeningStrategySubWedge.setSubWedgeNumber(XSDataInteger(iSubWedgeNumber))
                                xsDataISPyBScreeningStrategySubWedge.setAxisStart(XSDataDouble(fPhiStart))
                                xsDataISPyBScreeningStrategySubWedge.setAxisEnd(XSDataDouble(fPhiEnd))
                                xsDataISPyBScreeningStrategySubWedge.setRotationAxis(XSDataString("Omega"))
                                xsDataISPyBScreeningStrategySubWedge.setOscillationRange(XSDataDouble(fRotation))
                                xsDataISPyBScreeningStrategySubWedge.setExposureTime(XSDataDouble(fExposureTime))
                                if (fTransmission is not None):
                                    xsDataISPyBScreeningStrategySubWedge.setTransmission(XSDataDouble(fTransmission))
                                xsDataISPyBScreeningStrategySubWedge.setNumberOfImages(XSDataInteger(iNumberOfImages))
                                iWedgeNumberOfImages += iNumberOfImages

                                if (fFlux is not None):
                                    xsDataISPyBScreeningStrategySubWedge.setDoseTotal(XSDataDouble(fFlux))
                                    fWedgeDoseTotal += fFlux
                                if (fCompleteness is not None):
                                    xsDataISPyBScreeningStrategySubWedge.setCompleteness(XSDataDouble(fCompleteness))
                                if (fMultiplicity is not None):
                                    xsDataISPyBScreeningStrategySubWedge.setMultiplicity(XSDataDouble(fMultiplicity))
                                if (fResolution is not None):
                                    xsDataISPyBScreeningStrategySubWedge.setResolution(XSDataDouble(fResolution))

                    xsDataISPyBScreeningStrategyWedge.setNumberOfImages(XSDataInteger(iWedgeNumberOfImages))
                    xsDataISPyBScreeningStrategyWedge.setDoseTotal(XSDataDouble(fWedgeDoseTotal))

        xsDataISPyBScreeningStrategy.setExposureTime(XSDataDouble(fAccumulatedExposureTime))
        return xsDataISPyBScreeningOutputContainer
Exemplo n.º 3
0
    def generateXSDataISPyBScreeningOutputContainer(_xsDataInputControlISPyB,
                                                    _strStatusMessage=None):
        """
        """
        EDFactoryPluginStatic.loadModule("XSDataISPyBv1_2")
        from XSDataISPyBv1_2 import XSDataISPyBScreeningOutputContainer
        from XSDataISPyBv1_2 import XSDataISPyBScreeningOutput
        from XSDataISPyBv1_2 import XSDataISPyBScreeningOutputLattice
        from XSDataISPyBv1_2 import XSDataISPyBScreeningStrategyContainer
        from XSDataISPyBv1_2 import XSDataISPyBScreeningStrategyWedgeContainer
        from XSDataISPyBv1_2 import XSDataISPyBScreeningStrategy
        from XSDataISPyBv1_2 import XSDataISPyBScreeningStrategyWedge
        from XSDataISPyBv1_2 import XSDataISPyBScreeningStrategySubWedge
        from XSDataISPyBv1_2 import XSDataDouble
        from XSDataISPyBv1_2 import XSDataInteger
        from XSDataISPyBv1_2 import XSDataBoolean
        from XSDataISPyBv1_2 import XSDataString
        import math

        xsDataISPyBScreeningOutputContainer = XSDataISPyBScreeningOutputContainer(
        )
        xsDataISPyBScreeningOutput = XSDataISPyBScreeningOutput()
        xsDataISPyBScreeningOutputContainer.setScreeningOutput(
            xsDataISPyBScreeningOutput)

        xsDataResultCharacterisation = _xsDataInputControlISPyB.getCharacterisationResult(
        )

        # Determine whether anomalous data:
        bAnomalousData = None
        xsDataCollection = xsDataResultCharacterisation.getDataCollection()
        if (xsDataCollection is not None):
            xsDataDiffractionPlan = xsDataCollection.getDiffractionPlan()
            if (xsDataDiffractionPlan is not None):
                if (xsDataDiffractionPlan.getAnomalousData() is not None):
                    bAnomalousData = xsDataDiffractionPlan.getAnomalousData(
                    ).getValue()

        # Indexing information (populate xsDataISPyBScreeningOutputContainer, xsDataIPSyBScreeningOutput and xsDataISPyBScreeningOutputLattice)
        bSuccessfulIndexing = False
        xsDataIndexingResult = xsDataResultCharacterisation.getIndexingResult()
        if (xsDataIndexingResult is not None):
            xsDataIndexingSolutionSelected = xsDataIndexingResult.getSelectedSolution(
            )
            if (xsDataIndexingSolutionSelected is not None):
                bSuccessfulIndexing = True
                xsDataStatisticsIndexing = xsDataIndexingSolutionSelected.getStatistics(
                )
                if (xsDataStatisticsIndexing is not None):
                    fBeamPositionShiftX = xsDataStatisticsIndexing.getBeamPositionShiftX(
                    ).getValue()
                    fBeamPositionShiftY = xsDataStatisticsIndexing.getBeamPositionShiftY(
                    ).getValue()
                    xsDataISPyBScreeningOutput.setBeamShiftX(
                        XSDataDouble(fBeamPositionShiftX))
                    xsDataISPyBScreeningOutput.setBeamShiftY(
                        XSDataDouble(fBeamPositionShiftY))
                    if xsDataStatisticsIndexing.getSpotDeviationAngular(
                    ) is not None:
                        fSpotDeviationAngular = xsDataStatisticsIndexing.getSpotDeviationAngular(
                        ).getValue()
                        xsDataISPyBScreeningOutput.setSpotDeviationTheta(
                            XSDataDouble(fSpotDeviationAngular))
                    if xsDataStatisticsIndexing.getSpotDeviationPositional(
                    ) is not None:
                        fSpotDeviationPositional = xsDataStatisticsIndexing.getSpotDeviationPositional(
                        ).getValue()
                        xsDataISPyBScreeningOutput.setSpotDeviationR(
                            XSDataDouble(fSpotDeviationPositional))
                    if ((xsDataStatisticsIndexing.getSpotsTotal() is not None)
                            and
                        (xsDataStatisticsIndexing.getSpotsUsed is not None)):
                        iSpotsTotal = xsDataStatisticsIndexing.getSpotsTotal(
                        ).getValue()
                        iSpotsUsed = xsDataStatisticsIndexing.getSpotsUsed(
                        ).getValue()
                        xsDataISPyBScreeningOutput.setNumSpotsFound(
                            XSDataInteger(iSpotsTotal))
                        xsDataISPyBScreeningOutput.setNumSpotsUsed(
                            XSDataInteger(iSpotsUsed))
                        xsDataISPyBScreeningOutput.setNumSpotsRejected(
                            XSDataInteger(iSpotsTotal - iSpotsUsed))
                xsDataCrystal = xsDataIndexingSolutionSelected.getCrystal()
                xsDataISPyBScreeningOutput.setMosaicityEstimated(
                    XSDataBoolean(False))
                if (xsDataCrystal is not None):
                    if (xsDataCrystal.getMosaicity() is not None):
                        fMosaicity = xsDataCrystal.getMosaicity().getValue()
                        xsDataISPyBScreeningOutput.setMosaicity(
                            XSDataDouble(fMosaicity))
                        xsDataISPyBScreeningOutput.setMosaicityEstimated(
                            XSDataBoolean(True))
                    xsDataCell = xsDataCrystal.getCell()
                    if (xsDataCell is not None):
                        fLength_a = xsDataCell.getLength_a().getValue()
                        fLength_b = xsDataCell.getLength_b().getValue()
                        fLength_c = xsDataCell.getLength_c().getValue()
                        fAngle_alpha = xsDataCell.getAngle_alpha().getValue()
                        fAngle_beta = xsDataCell.getAngle_beta().getValue()
                        fAngle_gamma = xsDataCell.getAngle_gamma().getValue()

                        xsDataISPyBScreeningOutputLattice = XSDataISPyBScreeningOutputLattice(
                        )
                        xsDataISPyBScreeningOutputContainer.getScreeningOutputLattice(
                        ).append(xsDataISPyBScreeningOutputLattice)

                        xsDataISPyBScreeningOutputLattice.setUnitCell_a(
                            XSDataDouble(fLength_a))
                        xsDataISPyBScreeningOutputLattice.setUnitCell_b(
                            XSDataDouble(fLength_b))
                        xsDataISPyBScreeningOutputLattice.setUnitCell_c(
                            XSDataDouble(fLength_c))
                        xsDataISPyBScreeningOutputLattice.setUnitCell_alpha(
                            XSDataDouble(fAngle_alpha))
                        xsDataISPyBScreeningOutputLattice.setUnitCell_beta(
                            XSDataDouble(fAngle_beta))
                        xsDataISPyBScreeningOutputLattice.setUnitCell_gamma(
                            XSDataDouble(fAngle_gamma))
                    xsDataSpaceGroup = xsDataCrystal.getSpaceGroup()
                    if (xsDataSpaceGroup is not None):
                        pyStrSpaceGroupName = xsDataSpaceGroup.getName(
                        ).getValue()
                        xsDataISPyBScreeningOutputLattice.setSpaceGroup(
                            XSDataString(pyStrSpaceGroupName))
        if (bSuccessfulIndexing):
            if _strStatusMessage == None:
                xsDataISPyBScreeningOutput.setStatusDescription(
                    XSDataString("Indexing successful"))
            else:
                xsDataISPyBScreeningOutput.setStatusDescription(
                    XSDataString(_strStatusMessage))
            xsDataISPyBScreeningOutput.setScreeningSuccess(XSDataBoolean(True))
        else:
            if _strStatusMessage == None:
                xsDataISPyBScreeningOutput.setStatusDescription(
                    XSDataString("Indexing failed"))
            else:
                xsDataISPyBScreeningOutput.setStatusDescription(
                    XSDataString(_strStatusMessage))
            xsDataISPyBScreeningOutput.setScreeningSuccess(
                XSDataBoolean(False))

        # Strategy information (populate xsDataISPyBScreeningStrategyContainer, xsDataISPyBScreeningStrategyWedge, xsDataISPyBScreeningStrategySubWedge)
        xsDataResultStrategy = xsDataResultCharacterisation.getStrategyResult()

        xsDataISPyBScreeningStrategyContainer = XSDataISPyBScreeningStrategyContainer(
        )
        xsDataISPyBScreeningStrategy = XSDataISPyBScreeningStrategy()
        xsDataISPyBScreeningStrategyContainer.setScreeningStrategy(
            xsDataISPyBScreeningStrategy)
        xsDataISPyBScreeningOutputContainer.getScreeningStrategyContainer(
        ).append(xsDataISPyBScreeningStrategyContainer)
        fAccumulatedExposureTime = 0.0

        if (bAnomalousData is not None):
            xsDataISPyBScreeningStrategy.setAnomalous(
                XSDataBoolean(bAnomalousData))
        else:
            xsDataISPyBScreeningStrategy.setAnomalous(XSDataBoolean(False))

        xsDataISPyBScreeningStrategy.setProgram(XSDataString("BEST"))

        if (xsDataResultStrategy is not None):
            lXSDataCollectionPlan = xsDataResultStrategy.getCollectionPlan()
            if (lXSDataCollectionPlan is not None):
                for xsDataCollectionPlan in lXSDataCollectionPlan:
                    iCollectionPlanNumber = xsDataCollectionPlan.getCollectionPlanNumber(
                    ).getValue()

                    #strCollectionPlanComment = None
                    #if (xsDataCollectionPlan.getComment() is not None):
                    #    strCollectionPlanComment = xsDataCollectionPlan.getComment().getValue()
                    fCompleteness = None
                    fMultiplicity = None
                    fResolution = None
                    fRankingResolution = None
                    fTransmission = None
                    iWedgeNumberOfImages = 0
                    fWedgeDoseTotal = 0.0
                    xsDataStrategySummary = xsDataCollectionPlan.getStrategySummary(
                    )
                    if (xsDataStrategySummary is not None):
                        if (xsDataStrategySummary.getCompleteness()
                                is not None):
                            fCompleteness = xsDataStrategySummary.getCompleteness(
                            ).getValue()
                        if (xsDataStrategySummary.getRedundancy() is not None):
                            fMultiplicity = xsDataStrategySummary.getRedundancy(
                            ).getValue()
                        if (xsDataStrategySummary.getResolution() is not None):
                            fResolution = xsDataStrategySummary.getResolution(
                            ).getValue()
                        if (xsDataStrategySummary.getRankingResolution()
                                is not None):
                            fRankingResolution = xsDataStrategySummary.getRankingResolution(
                            ).getValue()
                            xsDataISPyBScreeningStrategy.setRankingResolution(
                                XSDataDouble(fRankingResolution))

                    xsDataISPyBScreeningStrategyWedgeContainer = XSDataISPyBScreeningStrategyWedgeContainer(
                    )
                    xsDataISPyBScreeningStrategyWedge = XSDataISPyBScreeningStrategyWedge(
                    )
                    xsDataISPyBScreeningStrategyWedgeContainer.setScreeningStrategyWedge(
                        xsDataISPyBScreeningStrategyWedge)
                    xsDataISPyBScreeningStrategyContainer.getScreeningStrategyWedgeContainer(
                    ).append(xsDataISPyBScreeningStrategyWedgeContainer)

                    xsDataISPyBScreeningStrategyWedge.setWedgeNumber(
                        XSDataInteger(iCollectionPlanNumber))
                    xsDataISPyBScreeningStrategyWedge.setCompleteness(
                        XSDataDouble(fCompleteness))
                    xsDataISPyBScreeningStrategyWedge.setMultiplicity(
                        XSDataDouble(fMultiplicity))
                    xsDataISPyBScreeningStrategyWedge.setResolution(
                        XSDataDouble(fResolution))

                    xsDataCollectionStrategy = xsDataCollectionPlan.getCollectionStrategy(
                    )
                    if (xsDataCollectionStrategy is not None):
                        lXSDataSubWedge = xsDataCollectionStrategy.getSubWedge(
                        )
                        if (lXSDataSubWedge is not None):
                            for xsDataSubWedge in lXSDataSubWedge:
                                iSubWedgeNumber = xsDataSubWedge.getSubWedgeNumber(
                                ).getValue()
                                fPhiStart = xsDataSubWedge.getExperimentalCondition(
                                ).getGoniostat().getRotationAxisStart(
                                ).getValue()
                                fPhiEnd = xsDataSubWedge.getExperimentalCondition(
                                ).getGoniostat().getRotationAxisEnd().getValue(
                                )
                                fRotation = xsDataSubWedge.getExperimentalCondition(
                                ).getGoniostat().getOscillationWidth(
                                ).getValue()
                                fExposureTime = xsDataSubWedge.getExperimentalCondition(
                                ).getBeam().getExposureTime().getValue()
                                fAccumulatedExposureTime += fExposureTime
                                fTransmission = xsDataSubWedge.getExperimentalCondition(
                                ).getBeam().getTransmission().getValue()

                                if (not xsDataSubWedge.
                                        getExperimentalCondition().getBeam(
                                        ).getFlux() is None):
                                    fFlux = xsDataSubWedge.getExperimentalCondition(
                                    ).getBeam().getFlux().getValue()
                                else:
                                    fFlux = None
                                iNumberOfImages = int(
                                    math.ceil(
                                        (fPhiEnd - fPhiStart) / fRotation))

                                xsDataISPyBScreeningStrategySubWedge = XSDataISPyBScreeningStrategySubWedge(
                                )
                                xsDataISPyBScreeningStrategyWedgeContainer.getScreeningStrategySubWedge(
                                ).append(xsDataISPyBScreeningStrategySubWedge)

                                xsDataISPyBScreeningStrategySubWedge.setSubWedgeNumber(
                                    XSDataInteger(iSubWedgeNumber))
                                xsDataISPyBScreeningStrategySubWedge.setAxisStart(
                                    XSDataDouble(fPhiStart))
                                xsDataISPyBScreeningStrategySubWedge.setAxisEnd(
                                    XSDataDouble(fPhiEnd))
                                xsDataISPyBScreeningStrategySubWedge.setRotationAxis(
                                    XSDataString("Omega"))
                                xsDataISPyBScreeningStrategySubWedge.setOscillationRange(
                                    XSDataDouble(fRotation))
                                xsDataISPyBScreeningStrategySubWedge.setExposureTime(
                                    XSDataDouble(fExposureTime))
                                xsDataISPyBScreeningStrategySubWedge.setTransmission(
                                    XSDataDouble(fTransmission))
                                xsDataISPyBScreeningStrategySubWedge.setNumberOfImages(
                                    XSDataInteger(iNumberOfImages))
                                iWedgeNumberOfImages += iNumberOfImages

                                if (fFlux is not None):
                                    xsDataISPyBScreeningStrategySubWedge.setDoseTotal(
                                        XSDataDouble(fFlux))
                                    fWedgeDoseTotal += fFlux
                                if (fCompleteness is not None):
                                    xsDataISPyBScreeningStrategySubWedge.setCompleteness(
                                        XSDataDouble(fCompleteness))
                                if (fMultiplicity is not None):
                                    xsDataISPyBScreeningStrategySubWedge.setMultiplicity(
                                        XSDataDouble(fMultiplicity))
                                if (fResolution is not None):
                                    xsDataISPyBScreeningStrategySubWedge.setResolution(
                                        XSDataDouble(fResolution))

                    xsDataISPyBScreeningStrategyWedge.setNumberOfImages(
                        XSDataInteger(iWedgeNumberOfImages))
                    xsDataISPyBScreeningStrategyWedge.setDoseTotal(
                        XSDataDouble(fWedgeDoseTotal))

        xsDataISPyBScreeningStrategy.setExposureTime(
            XSDataDouble(fAccumulatedExposureTime))
        return xsDataISPyBScreeningOutputContainer
Exemplo n.º 4
0
    def testSetDataModelInput(self):
        """
        A test for whether we can obtain the expected XML by setting a certain input for the plugin. 
        """
        edPluginISPyB = self.createPlugin()
        xsPluginItemISPyB = self.getPluginConfiguration(
            os.path.join(self.getPluginTestsDataHome(), "XSConfiguration.xml"))
        edPluginISPyB.setConfiguration(xsPluginItemISPyB)
        edPluginISPyB.configure()

        # Create XSDataISPyB objects

        xsDataISPyBImage = XSDataISPyBImage()
        xsDataISPyBImage.setFileName(XSDataString("test.img"))
        xsDataISPyBImage.setFileLocation(XSDataString("/tmp"))

        xsDataISPyBScreening = XSDataISPyBScreening()
        xsDataISPyBScreening.setProgramVersion(XSDataString("EDNA Prototype"))

        xsDataISPyBScreeningInput = XSDataISPyBScreeningInput()
        xsDataISPyBScreeningInput.setBeamX(XSDataDouble(10.4))
        xsDataISPyBScreeningInput.setBeamY(XSDataDouble(2.31))
        xsDataISPyBScreeningInput.setRmsErrorLimits(XSDataDouble(0.8))
        xsDataISPyBScreeningInput.setMinimumFractionIndexed(XSDataDouble(0.4))
        xsDataISPyBScreeningInput.setMaximumFractionRejected(
            XSDataDouble(0.45))
        xsDataISPyBScreeningInput.setMinimumSignalToNoise(XSDataDouble(0.56))

        xsDataISPyBScreeningOutput = XSDataISPyBScreeningOutput()
        xsDataISPyBScreeningOutput.setStatusDescription(
            XSDataString("It's just fine."))
        xsDataISPyBScreeningOutput.setMosaicity(XSDataDouble(0.25))
        xsDataISPyBScreeningOutput.setBeamShiftX(XSDataDouble(0.141))
        xsDataISPyBScreeningOutput.setBeamShiftY(XSDataDouble(0.156))

        xsDataISPyBScreeningOutputLattice = XSDataISPyBScreeningOutputLattice()
        xsDataISPyBScreeningOutputLattice.setSpaceGroup(XSDataString("P222"))

        xsDataISPyBScreeningStrategy = XSDataISPyBScreeningStrategy()
        xsDataISPyBScreeningStrategy.setPhiStart(XSDataDouble(0))
        xsDataISPyBScreeningStrategy.setPhiEnd(XSDataDouble(20))
        xsDataISPyBScreeningStrategy.setRotation(XSDataDouble(1))
        xsDataISPyBScreeningStrategy.setProgram(XSDataString("EDNA"))
        xsDataISPyBScreeningStrategy.setAnomalous(XSDataBoolean(1))

        xsDataISPyBScreeningStrategyWedge = XSDataISPyBScreeningStrategyWedge()
        xsDataISPyBScreeningStrategyWedge.setWedgeNumber(XSDataInteger(1))
        xsDataISPyBScreeningStrategyWedge.setResolution(XSDataDouble(2.1))
        xsDataISPyBScreeningStrategyWedge.setCompleteness(XSDataDouble(90))
        xsDataISPyBScreeningStrategyWedge.setMultiplicity(XSDataDouble(1.5))
        xsDataISPyBScreeningStrategyWedge.setDoseTotal(XSDataDouble(40.5))
        xsDataISPyBScreeningStrategyWedge.setNumberOfImages(XSDataInteger(130))

        xsDataISPyBScreeningStrategySubWedge = XSDataISPyBScreeningStrategySubWedge(
        )
        xsDataISPyBScreeningStrategySubWedge.setSubWedgeNumber(
            XSDataInteger(1))
        xsDataISPyBScreeningStrategySubWedge.setRotationAxis(
            XSDataString("Omega"))
        xsDataISPyBScreeningStrategySubWedge.setAxisStart(XSDataDouble(0.0))
        xsDataISPyBScreeningStrategySubWedge.setAxisEnd(XSDataDouble(90.0))
        xsDataISPyBScreeningStrategySubWedge.setExposureTime(XSDataDouble(0.5))
        xsDataISPyBScreeningStrategySubWedge.setTransmission(
            XSDataDouble(100.0))
        xsDataISPyBScreeningStrategySubWedge.setNumberOfImages(
            XSDataInteger(130))

        xsDataISPyBScreeningStrategyWedgeContainer = XSDataISPyBScreeningStrategyWedgeContainer(
        )
        xsDataISPyBScreeningStrategyWedgeContainer.setScreeningStrategyWedge(
            xsDataISPyBScreeningStrategyWedge)
        xsDataISPyBScreeningStrategyWedgeContainer.getScreeningStrategySubWedge(
        ).append(xsDataISPyBScreeningStrategySubWedge)

        xsDataISPyBScreeningStrategyContainer = XSDataISPyBScreeningStrategyContainer(
        )
        xsDataISPyBScreeningStrategyContainer.setScreeningStrategy(
            xsDataISPyBScreeningStrategy)
        xsDataISPyBScreeningStrategyContainer.getScreeningStrategyWedgeContainer(
        ).append(xsDataISPyBScreeningStrategyWedgeContainer)

        xsDataISPyBScreeningOutputContainer = XSDataISPyBScreeningOutputContainer(
        )
        xsDataISPyBScreeningOutputContainer.setScreeningOutput(
            xsDataISPyBScreeningOutput)
        xsDataISPyBScreeningOutputContainer.getScreeningOutputLattice().append(
            xsDataISPyBScreeningOutputLattice)
        xsDataISPyBScreeningOutputContainer.getScreeningStrategyContainer(
        ).append(xsDataISPyBScreeningStrategyContainer)

        xsDataISPyBScreeningRank = XSDataISPyBScreeningRank()
        xsDataISPyBScreeningRank.setRankValue(XSDataDouble(1.4))
        xsDataISPyBScreeningRank.setRankInformation(
            XSDataString("This is the only one"))

        xsDataISPyBScreeningRankSet = XSDataISPyBScreeningRankSet()
        xsDataISPyBScreeningRankSet.setRankEngine(XSDataString("ISPyB"))

        xsDataISPyBScreeningFile = XSDataISPyBScreeningFile()
        xsDataISPyBScreeningFile.setFileType(XSDataString("log"))
        xsDataISPyBScreeningFile.setDescription(
            XSDataString("Output log file"))

        # Write XSDataISPyB objects to files
        xsDataISPyBScreening.outputFile(self.__strObtainedScreening)
        xsDataISPyBScreeningInput.outputFile(self.__strObtainedScreeningInput)
        xsDataISPyBScreeningOutputContainer.outputFile(
            self.__strObtainedScreeningOutputContainer)
        xsDataISPyBScreeningRank.outputFile(self.__strObtainedScreeningRank)
        xsDataISPyBScreeningRankSet.outputFile(
            self.__strObtainedScreeningRankSet)
        xsDataISPyBScreeningFile.outputFile(self.__strObtainedScreeningFile)

        # Compare screening
        strInputScreeningExpected = self.readAndParseFile(
            self.__strReferenceInputScreening)
        xsDataScreeningExpected = XSDataInputISPyB.parseString(
            strInputScreeningExpected)
        strXMLScreeningExpected = xsDataScreeningExpected.marshal()

        strScreeningObtained = self.readAndParseFile(
            self.__strObtainedScreening)
        xsDataScreeningObtained = XSDataInputISPyB.parseString(
            strScreeningObtained)
        strXMLScreeningObtained = xsDataScreeningObtained.marshal()

        EDAssert.equal(strXMLScreeningExpected, strXMLScreeningObtained)

        #Compare screeningInput
        strInputScreeningInputExpected = self.readAndParseFile(
            self.__strReferenceInputScreeningInput)
        xsDataScreeningInputExpected = XSDataInputISPyB.parseString(
            strInputScreeningInputExpected)
        strXMLScreeningInputExpected = xsDataScreeningInputExpected.marshal()

        strScreeningInputObtained = self.readAndParseFile(
            self.__strObtainedScreeningInput)
        xsDataScreeningInputObtained = XSDataInputISPyB.parseString(
            strScreeningInputObtained)
        strXMLScreeningInputObtained = xsDataScreeningInputObtained.marshal()

        EDAssert.equal(strXMLScreeningInputExpected,
                       strXMLScreeningInputObtained)

        #Compare screeningOutputContainer
        strInputScreeningOutputContainerExpected = self.readAndParseFile(
            self.__strReferenceInputScreeningOutputContainer)
        xsDataScreeningOutputContainerExpected = XSDataInputISPyB.parseString(
            strInputScreeningOutputContainerExpected)
        strXMLScreeningOutputContainerExpected = xsDataScreeningOutputContainerExpected.marshal(
        )

        strScreeningOutputContainerObtained = self.readAndParseFile(
            self.__strObtainedScreeningOutputContainer)
        xsDataScreeningOutputContainerObtained = XSDataInputISPyB.parseString(
            strScreeningOutputContainerObtained)
        strXMLScreeningOutputContainerObtained = xsDataScreeningOutputContainerObtained.marshal(
        )

        EDAssert.equal(strXMLScreeningOutputContainerExpected,
                       strXMLScreeningOutputContainerObtained)

        #Compare screeningRank
        strInputScreeningRankExpected = self.readAndParseFile(
            self.__strReferenceInputScreeningRank)
        xsDataScreeningRankExpected = XSDataInputISPyB.parseString(
            strInputScreeningRankExpected)
        strXMLScreeningRankExpected = xsDataScreeningRankExpected.marshal()

        strScreeningRankObtained = self.readAndParseFile(
            self.__strObtainedScreeningRank)
        xsDataScreeningRankObtained = XSDataInputISPyB.parseString(
            strScreeningRankObtained)
        strXMLScreeningRankObtained = xsDataScreeningRankObtained.marshal()

        EDAssert.equal(strXMLScreeningRankExpected,
                       strXMLScreeningRankObtained)

        #Compare screeningRankSet
        strInputScreeningRankSetExpected = self.readAndParseFile(
            self.__strReferenceInputScreeningRankSet)
        xsDataScreeningRankSetExpected = XSDataInputISPyB.parseString(
            strInputScreeningRankSetExpected)
        strXMLScreeningRankSetExpected = xsDataScreeningRankSetExpected.marshal(
        )

        strScreeningRankSetObtained = self.readAndParseFile(
            self.__strObtainedScreeningRankSet)
        xsDataScreeningRankSetObtained = XSDataInputISPyB.parseString(
            strScreeningRankSetObtained)
        strXMLScreeningRankSetObtained = xsDataScreeningRankSetObtained.marshal(
        )

        EDAssert.equal(strXMLScreeningRankSetExpected,
                       strXMLScreeningRankSetObtained)

        #Compare screeningFile
        strInputScreeningFileExpected = self.readAndParseFile(
            self.__strReferenceInputScreeningFile)
        xsDataScreeningFileExpected = XSDataInputISPyB.parseString(
            strInputScreeningFileExpected)
        strXMLScreeningFileExpected = xsDataScreeningFileExpected.marshal()

        strScreeningFileObtained = self.readAndParseFile(
            self.__strObtainedScreeningFile)
        xsDataScreeningFileObtained = XSDataInputISPyB.parseString(
            strScreeningFileObtained)
        strXMLScreeningFileObtained = xsDataScreeningFileObtained.marshal()

        EDAssert.equal(strXMLScreeningFileExpected,
                       strXMLScreeningFileObtained)

        self.cleanUp(edPluginISPyB)