예제 #1
0
def functionXMLin(_strFilename):
    """Here we create the XML string to be passed to the EDNA plugin from the input strFilename
    This can / should be modified by the final user
    
    @param _strFilename: full path of the input file
    @type _strFilename: python string representing the path
    @return: string  
    """
    EDVerbose.screen("Starting processing of image %s" % (_strFilename))
    # First check if the filename end with .img or .mccd:
    strXML = None
    if (_strFilename.endswith(".img") or _strFilename.endswith(".mccd") or _strFilename.endswith(".cbf")):
        xsDataInputGridScreening = XSDataInputGridScreening()
        xsDataDiffractionPlan = XSDataDiffractionPlan()
        xsDataDiffractionPlan.setMaxExposureTimePerDataCollection(XSDataTime(EDParallelExecuteGridScreening.fMaxExposureTime))
        xsDataInputGridScreening.setDiffractionPlan(xsDataDiffractionPlan)
        xsDataFile = XSDataFile()
        xsDataFile.setPath(XSDataString(_strFilename))
        xsDataInputGridScreening.setImageFile(xsDataFile)
        if EDParallelExecuteGridScreening.bOnlyImageQualityIndicators:
            xsDataInputGridScreening.setDoOnlyImageQualityIndicators(XSDataBoolean(True))
        if EDParallelExecuteGridScreening.bStoreInISPyB:
            xsDataInputGridScreening.setStoreImageQualityIndicatorsInISPyB(XSDataBoolean(True))
        if EDParallelExecuteGridScreening.bDoOnlyIntegrationWithXMLOutput:
            xsDataInputGridScreening.setDoOnlyIntegrationWithXMLOutput(XSDataBoolean(True))
        strXML = xsDataInputGridScreening.marshal()
    else:
        EDVerbose.screen("File name not ending with .img or .mccd - ignored : %s" % _strFilename)
    return strXML
예제 #2
0
 def buildChildren(self, child_, nodeName_):
     if child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'imageFile':
         obj_ = XSDataFile()
         obj_.build(child_)
         self.setImageFile(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'diffractionPlan':
         obj_ = XSDataDiffractionPlan()
         obj_.build(child_)
         self.setDiffractionPlan(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'storeImageQualityIndicatorsInISPyB':
         obj_ = XSDataBoolean()
         obj_.build(child_)
         self.setStoreImageQualityIndicatorsInISPyB(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'doOnlyImageQualityIndicators':
         obj_ = XSDataBoolean()
         obj_.build(child_)
         self.setDoOnlyImageQualityIndicators(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'doOnlyIntegrationWithXMLOutput':
         obj_ = XSDataBoolean()
         obj_.build(child_)
         self.setDoOnlyIntegrationWithXMLOutput(obj_)
     XSDataInput.buildChildren(self, child_, nodeName_)
예제 #3
0
 def diffractionPlan(self):
     # Do we have a diffracionPlan?
     xsDataDiffractionPlan = self.xsDataResultCharacterisation.getDataCollection().getDiffractionPlan()
     if xsDataDiffractionPlan is None:
         xsDataDiffractionPlan = XSDataDiffractionPlan()
     self.page.h2( "Diffraction Plan" )
     self.page.table( class_='diffractionPlan', border_="1", cellpadding_="0")
     self.page.tr( align_="CENTER", bgcolor_=self.strTableColourTitle2)
     self.page.th("Forced<br>space group")
     self.page.th("Anomalous<br>data")
     self.page.th("Aimed<br>multiplicity")
     self.page.th("Aimed<br>completeness")
     self.page.th("Aimed I/sigma<br>at highest res.")
     self.page.th("Aimed<br>resolution (&Aring;)")
     self.page.tr.close()
     self.page.tr( align_="CENTER", bgcolor_=self.strTableColourRows)
     # Forced space group               
     if xsDataDiffractionPlan.getForcedSpaceGroup() is None:
         strForcedSpaceGroup = "None"
     else:
         strForcedSpaceGroup = xsDataDiffractionPlan.getForcedSpaceGroup().getValue()
     self.page.th(strForcedSpaceGroup)
     # Anomalous data
     if xsDataDiffractionPlan.getAnomalousData() is None or xsDataDiffractionPlan.getAnomalousData().getValue() == False:
         strAnomalousData = "False"
     else:
         strAnomalousData = "True"
     self.page.th(strAnomalousData)
     # Aimed multiplicity
     if xsDataDiffractionPlan.getAimedMultiplicity() is None:
         strAimedMultiplicity = "Default<br>(optimized)"
     else:
         strAimedMultiplicity = "%.2f" % xsDataDiffractionPlan.getAimedMultiplicity().getValue()
     self.page.th(strAimedMultiplicity)
     # Aimed completeness
     if xsDataDiffractionPlan.getAimedCompleteness() is None:
         strAimedCompleteness = "Default<br>(>= 0.99)"
     else:
         strAimedCompleteness = "%.2f" % xsDataDiffractionPlan.getAimedCompleteness().getValue()
     self.page.th(strAimedCompleteness)
     # Aimed aimedIOverSigmaAtHighestResolution
     if xsDataDiffractionPlan.getAimedIOverSigmaAtHighestResolution() is None:
         strAimedIOverSigmaAtHighestResolution = "BEST Default"
     else:
         strAimedIOverSigmaAtHighestResolution = "%.2f" % xsDataDiffractionPlan.getAimedIOverSigmaAtHighestResolution().getValue()
     self.page.th(strAimedIOverSigmaAtHighestResolution)
     # Aimed resolution              
     if xsDataDiffractionPlan.getAimedResolution() is None:
         strAimedResolution = "Default<br>(highest possible)"
     else:
         strAimedResolution = "%0.2f" % xsDataDiffractionPlan.getAimedResolution().getValue()
     self.page.th(strAimedResolution)
     # Close the table
     self.page.tr.close()
     self.page.table.close()     
예제 #4
0
 def createInputCharacterisationFromSubWedges(self):
     EDVerbose.DEBUG(
         "EDPluginControlInterfacev2_0.createInputCharacterisationFromSubWedges"
     )
     xsDataResultSubWedgeAssemble = self.edPluginControlSubWedgeAssemble.getDataOutput(
     )
     self.xsDataInputCharacterisation = XSDataInputCharacterisation()
     xsDataCollection = XSDataCollection()
     # Default exposure time (for the moment, this value should be
     # possible to read from the command line)
     xsDataDiffractionPlan = XSDataDiffractionPlan()
     if (not xsDataResultSubWedgeAssemble is None):
         pyListSubWedge = xsDataResultSubWedgeAssemble.getSubWedge()
         xsDataCollection.setSubWedge(pyListSubWedge)
         for xsDataSubWedge in pyListSubWedge:
             if (self.strComplexity is not None):
                 xsDataDiffractionPlan.setComplexity(
                     XSDataString(self.strComplexity))
             if (self.fFlux is not None):
                 xsDataSubWedge.getExperimentalCondition().getBeam(
                 ).setFlux(XSDataFloat(self.fFlux))
             if (self.fBeamSize is not None):
                 xsDataSize = XSDataSize()
                 xsDataSize.setX(XSDataLength(self.fBeamSize))
                 xsDataSize.setY(XSDataLength(self.fBeamSize))
                 xsDataSubWedge.getExperimentalCondition().getBeam(
                 ).setSize(xsDataSize)
             if (self.fBeamPosX is not None):
                 xsDataSubWedge.getExperimentalCondition().getDetector(
                 ).setBeamPositionX(XSDataLength(self.fBeamPosX))
             if (self.fBeamPosY is not None):
                 xsDataSubWedge.getExperimentalCondition().getDetector(
                 ).setBeamPositionY(XSDataLength(self.fBeamPosY))
             if (self.fMinExposureTimePerImage is not None):
                 xsDataSubWedge.getExperimentalCondition().getBeam(
                 ).setMinExposureTimePerImage(
                     XSDataFloat(self.fMinExposureTimePerImage))
             if (self.fTransmission is not None):
                 xsDataSubWedge.getExperimentalCondition().getBeam(
                 ).setTransmission(XSDataDouble(self.fTransmission))
     if (self.strForcedSpaceGroup is not None):
         xsDataDiffractionPlan.setForcedSpaceGroup(
             XSDataString(self.strForcedSpaceGroup))
     xsDataDiffractionPlan.setAnomalousData(
         XSDataBoolean(self.bAnomalousData))
     xsDataDiffractionPlan.setMaxExposureTimePerDataCollection(
         XSDataTime(self.fMaxExposureTimePerDataCollection))
     if (self.strStrategyOption is not None):
         xsDataDiffractionPlan.setStrategyOption(
             XSDataString(self.strStrategyOption))
     xsDataCollection.setDiffractionPlan(xsDataDiffractionPlan)
     self.xsDataInputCharacterisation.setDataCollection(xsDataCollection)
예제 #5
0
 def createInputCharacterisationFromSubWedges(self):
     self.DEBUG("EDPluginControlInterfacev1_2.createInputCharacterisationFromSubWedges")
     xsDataResultSubWedgeAssemble = self.edPluginControlSubWedgeAssemble.getDataOutput()
     self.xsDataInputCharacterisation = XSDataInputCharacterisation()
     xsDataCollection = XSDataCollection()
     # Default exposure time (for the moment, this value should be
     # possible to read from the command line)
     if self.xsDataDiffractionPlan is None:
         self.xsDataDiffractionPlan = XSDataDiffractionPlan()
     if (not xsDataResultSubWedgeAssemble is None):
         pyListSubWedge = xsDataResultSubWedgeAssemble.getSubWedge()
         xsDataCollection.setSubWedge(pyListSubWedge)
         for xsDataSubWedge in pyListSubWedge:
             if (self.strComplexity is not None):
                 self.xsDataDiffractionPlan.setComplexity(XSDataString(self.strComplexity))
             if (self.fFlux is not None):
                 xsDataSubWedge.getExperimentalCondition().getBeam().setFlux(XSDataFlux(self.fFlux))
             if (self.fBeamSizeX is not None) and (self.fBeamSizeY is not None):
                 xsDataSize = XSDataSize()
                 xsDataSize.setX(XSDataLength(self.fBeamSizeX))
                 xsDataSize.setY(XSDataLength(self.fBeamSizeY))
                 xsDataSubWedge.getExperimentalCondition().getBeam().setSize(xsDataSize)
             if (self.fBeamPosX is not None):
                 xsDataSubWedge.getExperimentalCondition().getDetector().setBeamPositionX(XSDataLength(self.fBeamPosX))
             if (self.fBeamPosY is not None):
                 xsDataSubWedge.getExperimentalCondition().getDetector().setBeamPositionY(XSDataLength(self.fBeamPosY))
             if (self.fMinExposureTimePerImage is not None):
                 xsDataSubWedge.getExperimentalCondition().getBeam().setMinExposureTimePerImage(XSDataTime(self.fMinExposureTimePerImage))
             if (self.fTransmission is not None):
                 xsDataSubWedge.getExperimentalCondition().getBeam().setTransmission(XSDataDouble(self.fTransmission))
             if (self.fWavelength is not None):
                 xsDataSubWedge.getExperimentalCondition().getBeam().setWavelength(XSDataWavelength(self.fWavelength))
             if self.fMinOscillationWidth != None:
                 xsDataSubWedge.getExperimentalCondition().getGoniostat().setMinOscillationWidth(XSDataAngle(self.fMinOscillationWidth))
             if self.fMaxOscillationSpeed != None:
                 xsDataSubWedge.getExperimentalCondition().getGoniostat().setMaxOscillationSpeed(XSDataAngularSpeed(self.fMaxOscillationSpeed))
     if (self.strForcedSpaceGroup is not None):
         self.xsDataDiffractionPlan.setForcedSpaceGroup(XSDataString(self.strForcedSpaceGroup))
     self.xsDataDiffractionPlan.setAnomalousData(XSDataBoolean(self.bAnomalousData))
     self.xsDataDiffractionPlan.setMaxExposureTimePerDataCollection(XSDataTime(self.fMaxExposureTimePerDataCollection))
     if (self.strStrategyOption is not None):
         self.xsDataDiffractionPlan.setStrategyOption(XSDataString(self.strStrategyOption))
     xsDataCollection.setDiffractionPlan(self.xsDataDiffractionPlan)
     if self.xsDataSample is not None:
         xsDataCollection.setSample(XSDataSampleCrystalMM.parseString(self.xsDataSample.marshal()))
     self.xsDataInputCharacterisation.setDataCollection(xsDataCollection)
     self.xsDataInputCharacterisation.setToken(self.xsDataToken)
예제 #6
0
    def setPluginInput(self, _edPlugin):
        xsDataDiffractionPlan = XSDataDiffractionPlan()
        if (not self.__fMaxExposureTimePerDataCollection is None):
            xsDataDiffractionPlan.setMaxExposureTimePerDataCollection(XSDataTime(self.__fMaxExposureTimePerDataCollection))
        if (not self.__strForcedSpaceGroup is None):
            xsDataDiffractionPlan.setForcedSpaceGroup(XSDataString(self.__strForcedSpaceGroup))
        if (not self.__bAnomalousData is None):
            xsDataDiffractionPlan.setAnomalousData(XSDataBoolean(self.__bAnomalousData))
        if (not self.__strStrategyOption is None):
            xsDataDiffractionPlan.setStrategyOption(XSDataString(self.__strStrategyOption))
        if (not self.__strComplexity is None):
            xsDataDiffractionPlan.setComplexity(XSDataString(self.__strComplexity))
        _edPlugin.setDataInput(xsDataDiffractionPlan, "diffractionPlan")

        if (not self.__listImagePaths is None):
            for strImagePath in self.__listImagePaths:
                _edPlugin.setDataInput(XSDataString(strImagePath), "imagePaths")

        if (not self.__xsDataInputCharacterisation is None):
            _edPlugin.setDataInput(self.__xsDataInputCharacterisation, "inputCharacterisation")
        if (not self.__fFlux is None):
            _edPlugin.setDataInput(XSDataFloat(self.__fFlux), "flux")
        if (not self.__fMinExposureTimePerImage is None):
            _edPlugin.setDataInput(XSDataFloat(self.__fMinExposureTimePerImage), "minExposureTimePerImage")
        if (not self.__fBeamSize is None):
            _edPlugin.setDataInput(XSDataFloat(self.__fBeamSize), "beamSize")
        if (not self.__bTemplateMode is None):
            _edPlugin.setDataInput(XSDataBoolean(self.__bTemplateMode), "templateMode")
        if (not self.__strGeneratedTemplateFile is None):
            _edPlugin.setDataInput(XSDataString(self.__strGeneratedTemplateFile), "generatedTemplateFile")
        if (not self.__strResultsFilePath is None):
            _edPlugin.setDataInput(XSDataString(self.__strResultsFilePath), "resultsFilePath")
        if (not self.__fBeamPosX is None):
            _edPlugin.setDataInput(XSDataFloat(self.__fBeamPosX), "beamPosX")
        if (not self.__fBeamPosY is None):
            _edPlugin.setDataInput(XSDataFloat(self.__fBeamPosY), "beamPosY")
        if (not self.__iDataCollectionId is None):
            _edPlugin.setDataInput(XSDataInteger(self.__iDataCollectionId), "dataCollectionId")
        if (not self.__strShortComments is None):
            _edPlugin.setDataInput(XSDataString(self.__strShortComments), "shortComments")
        if (not self.__strComments is None):
            _edPlugin.setDataInput(XSDataString(self.__strComments), "comments")
        if (not self.__fTransmission is None):
            _edPlugin.setDataInput(XSDataDouble(self.__fTransmission), "transmission")
예제 #7
0
 def preProcess(self, _edObject=None):
     EDPluginControl.preProcess(self)
     self.DEBUG("EDPluginControlGridScreeningv1_0.preProcess")
     # Load the plugins
     self.edPluginControlReadImageHeader = self.loadPlugin(self.strControlReadImageHeaderPluginName, \
                                                                "ReadImageHeader")
     self.edPluginControlIndicators = self.loadPlugin(self.strControlledIndicatorsPluginName, \
                                                                "ControlIndicators")
     self.edPluginMOSFLMIndexing = self.loadPlugin(self.strIndexingMOSFLMPluginName, \
                                                                "IndexingMOSFLM")
     self.edPluginControlIntegration = self.loadPlugin(self.strPluginControlIntegration, \
                                                         "Integration")
     self.edPluginControlStrategy = self.loadPlugin(self.strPluginControlStrategy, \
                                                      "Strategy")
     self.edPluginExecMtz2Various = self.loadPlugin(self.strPluginExecMtz2Various, \
                                                      "Mtz2Various")
     # Input data
     self.strImageFile = self.getDataInput().getImageFile().getPath(
     ).getValue()
     self.xsDataGridScreeningFileNameParameters = self.getFileNameParameters(
         self.strImageFile)
     self.xsDataDiffractionPlan = self.getDataInput().getDiffractionPlan()
     if self.xsDataDiffractionPlan is None:
         self.xsDataDiffractionPlan = XSDataDiffractionPlan()
     if self.xsDataDiffractionPlan.getMaxExposureTimePerDataCollection(
     ) is None:
         # Default max esposure time: 10000s
         self.xsDataDiffractionPlan.setMaxExposureTimePerDataCollection(
             XSDataTime(10000))
     self.xsDataDiffractionPlan.setEstimateRadiationDamage(
         XSDataBoolean(False))
     # Image quality indicators
     if self.getDataInput().getStoreImageQualityIndicatorsInISPyB():
         self.bStoreImageQualityIndicatorsInISPyB = self.getDataInput(
         ).getStoreImageQualityIndicatorsInISPyB().getValue()
     if self.getDataInput().getDoOnlyImageQualityIndicators():
         self.bDoOnlyImageQualityIndicators = self.getDataInput(
         ).getDoOnlyImageQualityIndicators().getValue()
     if self.getDataInput().getDoOnlyIntegrationWithXMLOutput():
         self.bDoOnlyIntegrationWithXMLOutput = self.getDataInput(
         ).getDoOnlyIntegrationWithXMLOutput().getValue()
     if self.bStoreImageQualityIndicatorsInISPyB:
         self.edPluginISPyBStoreImageQualityIndicators = self.loadPlugin(self.strISPyBStoreImageQualityIndicatorsPluginName, \
                                                      "ISPyBStoreImageQualityIndicators")
def functionXMLin(_strFilename):
    """Here we create the XML string to be passed to the EDNA plugin from the input strFilename
    This can / should be modified by the final user
    
    @param _strFilename: full path of the input file
    @type _strFilename: python string representing the path
    @return: string  
    """
    EDVerbose.screen("Starting processing of image %s" % (_strFilename))
    # First check if the filename end with .img or .mccd:
    strXML = None
    if (_strFilename.endswith(".img") or _strFilename.endswith(".mccd") or _strFilename.endswith(".cbf")):
        xsDataInputInterface = XSDataInputInterface()
        xsDataDiffractionPlan = XSDataDiffractionPlan()
        xsDataDiffractionPlan.setMaxExposureTimePerDataCollection(XSDataTime(EDParallelExecuteMXv1Characterisation.m_fMaxExposureTime))
        xsDataInputInterface.setDiffractionPlan(xsDataDiffractionPlan)
        xsDataFile = XSDataFile()
        xsDataFile.setPath(XSDataString(_strFilename))
        xsDataInputInterface.addImagePath(xsDataFile)
        strXML = xsDataInputInterface.marshal()
    else:
        EDVerbose.screen("File name not ending with .img or .mccd - ignored : %s" % _strFilename)
    return strXML
예제 #9
0
    def preProcess(self, _edPlugin=None):
        """
        Gets the Configuration Parameters, if found, overrides default parameters
        """
        EDPluginControl.preProcess(self, _edPlugin)
        self.DEBUG("EDPluginControlInterfacev1_3.preProcess...")

        self.listImagePaths = []

        # Check if XSDataInputInterface is given as input
        if self.hasDataInput():
            xsDataInputInterface = self.getDataInput()

            if xsDataInputInterface.getExperimentalCondition():
                self.xsDataExperimentalCodition = xsDataInputInterface.getExperimentalCondition(
                )
                if self.xsDataExperimentalCodition.getGoniostat():
                    if self.xsDataExperimentalCodition.getGoniostat(
                    ).getMinOscillationWidth():
                        self.fMinOscillationWidth = self.xsDataExperimentalCodition.getGoniostat(
                        ).getMinOscillationWidth().getValue()
                    if self.xsDataExperimentalCodition.getGoniostat(
                    ).getMaxOscillationSpeed():
                        self.fMaxOscillationSpeed = self.xsDataExperimentalCodition.getGoniostat(
                        ).getMaxOscillationSpeed().getValue()

            self.xsDataSample = xsDataInputInterface.getSample()

            self.xsDataDiffractionPlan = self.getDataInput(
            ).getDiffractionPlan()
            if self.xsDataDiffractionPlan:
                if self.xsDataDiffractionPlan.getForcedSpaceGroup():
                    self.strForcedSpaceGroup = self.xsDataDiffractionPlan.getForcedSpaceGroup(
                    ).getValue()
                if self.xsDataDiffractionPlan.getMaxExposureTimePerDataCollection(
                ):
                    self.fMaxExposureTimePerDataCollection = self.xsDataDiffractionPlan.getMaxExposureTimePerDataCollection(
                    ).getValue()
                if self.xsDataDiffractionPlan.getAnomalousData():
                    self.bAnomalousData = self.xsDataDiffractionPlan.getAnomalousData(
                    ).getValue()
                if self.xsDataDiffractionPlan.getStrategyOption():
                    self.strStrategyOption = self.xsDataDiffractionPlan.getStrategyOption(
                    ).getValue()
                if self.xsDataDiffractionPlan.getComplexity():
                    self.strComplexity = self.xsDataDiffractionPlan.getComplexity(
                    ).getValue()
                if self.fMinOscillationWidth == None:
                    if self.xsDataDiffractionPlan.getGoniostatMinOscillationWidth(
                    ):
                        self.fMinOscillationWidth = self.xsDataDiffractionPlan.getGoniostatMinOscillationWidth(
                        ).getValue()
                if self.fMaxOscillationSpeed == None:
                    if self.xsDataDiffractionPlan.getGoniostatMaxOscillationSpeed(
                    ):
                        self.fMaxOscillationSpeed = self.xsDataDiffractionPlan.getGoniostatMaxOscillationSpeed(
                        ).getValue()

            self.xsDataSample = xsDataInputInterface.getSample()

            if xsDataInputInterface.getImagePath():
                for xsDataFile in xsDataInputInterface.getImagePath():
                    self.listImagePaths.append(xsDataFile.getPath())

            if xsDataInputInterface.getFlux():
                self.fFlux = xsDataInputInterface.getFlux().getValue()
            elif self.xsDataExperimentalCodition != None:
                if self.xsDataExperimentalCodition.getBeam() != None:
                    if self.xsDataExperimentalCodition.getBeam().getFlux(
                    ) != None:
                        self.fFlux = self.xsDataExperimentalCodition.getBeam(
                        ).getFlux().getValue()

            if xsDataInputInterface.getMinExposureTimePerImage():
                self.fMinExposureTimePerImage = xsDataInputInterface.getMinExposureTimePerImage(
                ).getValue()
            elif self.xsDataExperimentalCodition != None:
                if self.xsDataExperimentalCodition.getBeam() != None:
                    if self.xsDataExperimentalCodition.getBeam(
                    ).getMinExposureTimePerImage() != None:
                        self.fMinExposureTimePerImage = self.xsDataExperimentalCodition.getBeam(
                        ).getMinExposureTimePerImage().getValue()
            if self.fMinExposureTimePerImage == None and xsDataInputInterface.getDiffractionPlan(
            ):
                if xsDataInputInterface.getDiffractionPlan(
                ).getMinExposureTimePerImage() != None:
                    self.fMinExposureTimePerImage = xsDataInputInterface.getDiffractionPlan(
                    ).getMinExposureTimePerImage().getValue()

            if self.xsDataExperimentalCodition != None:
                if self.xsDataExperimentalCodition.getBeam() != None:
                    if self.xsDataExperimentalCodition.getBeam().getSize(
                    ) != None:
                        self.fBeamSizeX = self.xsDataExperimentalCodition.getBeam(
                        ).getSize().getX().getValue()
                        self.fBeamSizeY = self.xsDataExperimentalCodition.getBeam(
                        ).getSize().getY().getValue()
                    if self.xsDataExperimentalCodition.getBeam(
                    ).getApertureSize() != None:
                        self.fApertureSize = self.xsDataExperimentalCodition.getBeam(
                        ).getApertureSize().getValue()

            if xsDataInputInterface.getBeamSize():
                self.fBeamSizeX = xsDataInputInterface.getBeamSize().getValue()
                self.fBeamSizeY = xsDataInputInterface.getBeamSize().getValue()

            if xsDataInputInterface.getApertureSize():
                self.fApertureSize = xsDataInputInterface.getApertureSize(
                ).getValue()

            if xsDataInputInterface.getBeamSizeX():
                self.fBeamSizeX = xsDataInputInterface.getBeamSizeX().getValue(
                )

            if xsDataInputInterface.getBeamSizeY():
                self.fBeamSizeY = xsDataInputInterface.getBeamSizeY().getValue(
                )

            if xsDataInputInterface.getApertureSize():
                self.fApertureSize = xsDataInputInterface.getApertureSize(
                ).getValue()

            if xsDataInputInterface.getTemplateMode():
                self.bTemplateMode = xsDataInputInterface.getTemplateMode(
                ).getValue()

            if xsDataInputInterface.getBeamPosX():
                self.fBeamPosX = xsDataInputInterface.getBeamPosX().getValue()
            elif self.xsDataExperimentalCodition != None:
                if self.xsDataExperimentalCodition.getDetector() != None:
                    if self.xsDataExperimentalCodition.getDetector(
                    ).getBeamPositionX() != None:
                        self.fBeamPosX = self.xsDataExperimentalCodition.getDetector(
                        ).getBeamPositionX().getValue()

            if xsDataInputInterface.getBeamPosY():
                self.fBeamPosY = xsDataInputInterface.getBeamPosY().getValue()
            elif self.xsDataExperimentalCodition != None:
                if self.xsDataExperimentalCodition.getDetector() != None:
                    if self.xsDataExperimentalCodition.getDetector(
                    ).getBeamPositionY() != None:
                        self.fBeamPosY = self.xsDataExperimentalCodition.getDetector(
                        ).getBeamPositionY().getValue()

            if xsDataInputInterface.getWavelength():
                self.fWavelength = xsDataInputInterface.getWavelength(
                ).getValue()
            elif self.xsDataExperimentalCodition != None:
                if self.xsDataExperimentalCodition.getBeam() != None:
                    if self.xsDataExperimentalCodition.getBeam().getWavelength(
                    ) != None:
                        self.fWavelength = self.xsDataExperimentalCodition.getBeam(
                        ).getWavelength().getValue()

            if xsDataInputInterface.getTransmission():
                self.fTransmission = xsDataInputInterface.getTransmission(
                ).getValue()
            elif self.xsDataExperimentalCodition != None:
                if self.xsDataExperimentalCodition.getBeam() != None:
                    if self.xsDataExperimentalCodition.getBeam(
                    ).getTransmission() != None:
                        self.fTransmission = self.xsDataExperimentalCodition.getBeam(
                        ).getTransmission().getValue()

            if xsDataInputInterface.getGeneratedTemplateFile():
                self.strGeneratedTemplateFile = xsDataInputInterface.getGeneratedTemplateFile(
                ).getPath().getValue()

            if xsDataInputInterface.getResultsFilePath():
                self.strResultsFilePath = xsDataInputInterface.getResultsFilePath(
                ).getPath().getValue()

            if xsDataInputInterface.getDataCollectionId():
                self.iDataCollectionId = xsDataInputInterface.getDataCollectionId(
                ).getValue()

            if xsDataInputInterface.getShortComments():
                self.strShortComments = xsDataInputInterface.getShortComments(
                ).getValue()

            if xsDataInputInterface.getComments():
                self.strComments = xsDataInputInterface.getComments().getValue(
                )

            if xsDataInputInterface.getInputCharacterisation():
                self.xsDataInputCharacterisation = xsDataInputInterface.getInputCharacterisation(
                )

            if xsDataInputInterface.getDataCollectionId():
                self.iDataCollectionId = xsDataInputInterface.getDataCollectionId(
                ).getValue()

        else:

            if self.hasDataInput("experimentalCondition"):
                self.xsDataExperimentalCodition = self.getDataInput(
                    "experimentalCondition")[0]
                if self.xsDataExperimentalCodition.getGoniostat():
                    if self.xsDataExperimentalCodition.getGoniostat(
                    ).getMinOscillationWidth():
                        self.fMinOscillationWidth = self.xsDataExperimentalCodition.getGoniostat(
                        ).getMinOscillationWidth().getValue()
                    if self.xsDataExperimentalCodition.getGoniostat(
                    ).getMaxOscillationSpeed():
                        self.fMaxOscillationSpeed = self.xsDataExperimentalCodition.getGoniostat(
                        ).getMaxOscillationSpeed().getValue()

            if self.hasDataInput("sample"):
                self.xsDataSample = self.getDataInput("sample")[0]

            if (self.hasDataInput("diffractionPlan")):
                if self.xsDataDiffractionPlan is None:
                    self.xsDataDiffractionPlan = XSDataDiffractionPlan()
                xsDataDiffractionPlans = self.getDataInput("diffractionPlan")
                if (not xsDataDiffractionPlans[0] is None):
                    self.xsDataDiffractionPlan = xsDataDiffractionPlans[0]
                    if self.xsDataDiffractionPlan.getForcedSpaceGroup():
                        self.strForcedSpaceGroup = self.xsDataDiffractionPlan.getForcedSpaceGroup(
                        ).getValue()
                    if self.xsDataDiffractionPlan.getMaxExposureTimePerDataCollection(
                    ):
                        self.fMaxExposureTimePerDataCollection = self.xsDataDiffractionPlan.getMaxExposureTimePerDataCollection(
                        ).getValue()
                    if self.xsDataDiffractionPlan.getAnomalousData():
                        self.bAnomalousData = self.xsDataDiffractionPlan.getAnomalousData(
                        ).getValue()
                    if self.xsDataDiffractionPlan.getStrategyOption():
                        self.strStrategyOption = self.xsDataDiffractionPlan.getStrategyOption(
                        ).getValue()
                    if self.xsDataDiffractionPlan.getComplexity():
                        self.strComplexity = self.xsDataDiffractionPlan.getComplexity(
                        ).getValue()
                    if self.fMinOscillationWidth == None:
                        if self.xsDataDiffractionPlan.getGoniostatMinOscillationWidth(
                        ):
                            self.fMinOscillationWidth = self.xsDataDiffractionPlan.getGoniostatMinOscillationWidth(
                            ).getValue()
                    if self.fMaxOscillationSpeed == None:
                        if self.xsDataDiffractionPlan.getGoniostatMaxOscillationSpeed(
                        ):
                            self.fMaxOscillationSpeed = self.xsDataDiffractionPlan.getGoniostatMaxOscillationSpeed(
                            ).getValue()

            if self.hasDataInput("sample"):
                self.xsDataSample = self.getDataInput("sample")[0]

            if self.hasDataInput("imagePaths"):
                for strImagePath in self.getDataInput("imagePaths"):
                    self.listImagePaths.append(strImagePath)

            if self.hasDataInput("flux"):
                self.fFlux = self.getDataInput("flux")[0].getValue()
            elif self.xsDataExperimentalCodition != None:
                if self.xsDataExperimentalCodition.getBeam() != None:
                    if self.xsDataExperimentalCodition.getBeam().getFlux(
                    ) != None:
                        self.fFlux = self.xsDataExperimentalCodition.getBeam(
                        ).getFlux().getValue()

            if self.hasDataInput("minExposureTimePerImage"):
                self.fMinExposureTimePerImage = self.getDataInput(
                    "minExposureTimePerImage")[0].getValue()
            elif self.xsDataExperimentalCodition != None:
                if self.xsDataExperimentalCodition.getBeam() != None:
                    if self.xsDataExperimentalCodition.getBeam(
                    ).getMinExposureTimePerImage() != None:
                        self.fMinExposureTimePerImage = self.xsDataExperimentalCodition.getBeam(
                        ).getMinExposureTimePerImage().getValue()
            if self.fMinExposureTimePerImage == None and self.hasDataInput(
                    "diffractionPlan"):
                if self.getDataInput("diffractionPlan"
                                     )[0].getMinExposureTimePerImage() != None:
                    self.fMinExposureTimePerImage = self.getDataInput(
                        "diffractionPlan")[0].getMinExposureTimePerImage(
                        ).getValue()

            if self.xsDataExperimentalCodition != None:
                if self.xsDataExperimentalCodition.getBeam() != None:
                    if self.xsDataExperimentalCodition.getBeam().getSize(
                    ) != None:
                        self.fBeamSizeX = self.xsDataExperimentalCodition.getBeam(
                        ).getSize().getX().getValue()
                        self.fBeamSizeY = self.xsDataExperimentalCodition.getBeam(
                        ).getSize().getY().getValue()
                    if self.xsDataExperimentalCodition.getBeam(
                    ).getApertureSize() != None:
                        self.fApertureSize = self.xsDataExperimentalCodition.getBeam(
                        ).getApertureSize().getValue()

            if self.hasDataInput("beamSize"):
                self.fBeamSizeX = self.getDataInput("beamSize")[0].getValue()
                self.fBeamSizeY = self.getDataInput("beamSize")[0].getValue()

            if self.hasDataInput("apertureSize"):
                self.fApertureSize = self.getDataInput(
                    "apertureSize")[0].getValue()

            if self.hasDataInput("beamSizeX"):
                self.fBeamSizeX = self.getDataInput("beamSizeX")[0].getValue()

            if self.hasDataInput("beamSizeY"):
                self.fBeamSizeY = self.getDataInput("beamSizeY")[0].getValue()

            if self.hasDataInput("templateMode"):
                self.bTemplateMode = self.getDataInput(
                    "templateMode")[0].getValue()

            if (self.hasDataInput("beamPosX")):
                self.fBeamPosX = self.getDataInput("beamPosX")[0].getValue()
            elif self.xsDataExperimentalCodition != None:
                if self.xsDataExperimentalCodition.getDetector() != None:
                    if self.xsDataExperimentalCodition.getDetector(
                    ).getBeamPositionX() != None:
                        self.fBeamPosX = self.xsDataExperimentalCodition.getDetector(
                        ).getBeamPositionX().getValue()

            if (self.hasDataInput("beamPosY")):
                self.fBeamPosY = self.getDataInput("beamPosY")[0].getValue()
            elif self.xsDataExperimentalCodition != None:
                if self.xsDataExperimentalCodition.getDetector() != None:
                    if self.xsDataExperimentalCodition.getDetector(
                    ).getBeamPositionY() != None:
                        self.fBeamPosY = self.xsDataExperimentalCodition.getDetector(
                        ).getBeamPositionY().getValue()

            if (self.hasDataInput("wavelength")):
                self.fWavelength = self.getDataInput(
                    "wavelength")[0].getValue()
            elif self.xsDataExperimentalCodition != None:
                if self.xsDataExperimentalCodition.getBeam() != None:
                    if self.xsDataExperimentalCodition.getBeam().getWavelength(
                    ) != None:
                        self.fWavelength = self.xsDataExperimentalCodition.getBeam(
                        ).getWavelength().getValue()

            if (self.hasDataInput("transmission")):
                self.fTransmission = self.getDataInput(
                    "transmission")[0].getValue()
            elif self.xsDataExperimentalCodition != None:
                if self.xsDataExperimentalCodition.getBeam() != None:
                    if self.xsDataExperimentalCodition.getBeam(
                    ).getTransmission() != None:
                        self.fTransmission = self.xsDataExperimentalCodition.getBeam(
                        ).getTransmission().getValue()

            if self.hasDataInput("generatedTemplateFile"):
                self.strGeneratedTemplateFile = self.getDataInput(
                    "generatedTemplateFile")[0].getValue()

            if self.hasDataInput("resultsFilePath"):
                self.strResultsFilePath = self.getDataInput(
                    "resultsFilePath")[0].getValue()

            if self.hasDataInput("dataCollectionId"):
                self.iDataCollectionId = self.getDataInput(
                    "dataCollectionId")[0].getValue()

            if self.hasDataInput("shortComments"):
                self.strShortComments = self.getDataInput(
                    "shortComments")[0].getValue()

            if self.hasDataInput("comments"):
                self.strComments = self.getDataInput("comments")[0].getValue()

            if self.hasDataInput("inputCharacterisation"):
                self.xsDataInputCharacterisation = self.getDataInput(
                    "inputCharacterisation")[0]

        # Check if XML data is given as input :
        if (self.xsDataInputCharacterisation is None):
            self.edPluginControlSubWedgeAssemble = self.loadPlugin(
                self.strEDPluginControlSubWedgeAssembleName,
                "SubWedgeAssemble")

        self.edPluginControlCharacterisation = self.loadPlugin(
            self.strEDPluginControlCharacterisationName, "Characterisation")

        if (self.strEDPluginControlISPyBName is not None):
            self.edPluginControlISPyB = self.loadPlugin(
                self.strEDPluginControlISPyBName, "ISPyB")
예제 #10
0
 def diffractionPlan(self):
     # Do we have a diffracionPlan?
     xsDataDiffractionPlan = self.xsDataResultCharacterisation.getDataCollection(
     ).getDiffractionPlan()
     if xsDataDiffractionPlan is None:
         xsDataDiffractionPlan = XSDataDiffractionPlan()
     strTitle = "Diffraction Plan"
     strExtraColumnTitle = None
     strExtraColumnValue = None
     if xsDataDiffractionPlan.strategyOption is not None:
         strStrategyOption = xsDataDiffractionPlan.strategyOption.value
         if strStrategyOption.find("-helic") != -1:
             strTitle = "Helical Diffraction Plan"
             self.bIsHelical = True
             strExtraColumnTitle = "Helical\ndistance (mm)"
             if self.dataInput.helicalDistance is not None:
                 fHelicalDistance = self.dataInput.helicalDistance.value
                 strExtraColumnValue = "%.3f" % fHelicalDistance
             else:
                 strExtraColumnValue = "Unknown"
         elif strStrategyOption.find("-Npos") != -1:
             strTitle = "Multi-positional Diffraction Plan"
             self.bIsMultiPositional = True
     dictTable = {
         "type": "table",
         "title": "Diffraction Plan",
         "columns": [],
         "data": []
     }
     dictTable["columns"].append("Forced\nspace group")
     dictTable["columns"].append("Anomalous\ndata")
     dictTable["columns"].append("Aimed\nmultiplicity")
     dictTable["columns"].append("Aimed\ncompleteness")
     dictTable["columns"].append("Aimed I/sigma\nat highest res.")
     dictTable["columns"].append("Aimed\nresolution (Å)")
     dictTable["columns"].append("Min osc.\nwidth")
     if strExtraColumnTitle is not None:
         dictTable["columns"].append(strExtraColumnTitle)
     listRow = []
     # Forced space group
     if xsDataDiffractionPlan.getForcedSpaceGroup() is None:
         strForcedSpaceGroup = "None"
     else:
         strForcedSpaceGroup = xsDataDiffractionPlan.getForcedSpaceGroup(
         ).getValue()
     listRow.append(strForcedSpaceGroup)
     # Anomalous data
     if xsDataDiffractionPlan.getAnomalousData(
     ) is None or xsDataDiffractionPlan.getAnomalousData().getValue(
     ) == False:
         strAnomalousData = "False"
     else:
         strAnomalousData = "True"
     listRow.append(strAnomalousData)
     # Aimed multiplicity
     if xsDataDiffractionPlan.getAimedMultiplicity() is None:
         strAimedMultiplicity = "Default\n(optimized)"
     else:
         strAimedMultiplicity = "%.2f" % xsDataDiffractionPlan.getAimedMultiplicity(
         ).getValue()
     listRow.append(strAimedMultiplicity)
     # Aimed completeness
     if xsDataDiffractionPlan.getAimedCompleteness() is None:
         strAimedCompleteness = "Default\n(>= 0.99)"
     else:
         strAimedCompleteness = "%.2f" % xsDataDiffractionPlan.getAimedCompleteness(
         ).getValue()
     listRow.append(strAimedCompleteness)
     # Aimed aimedIOverSigmaAtHighestResolution
     if xsDataDiffractionPlan.getAimedIOverSigmaAtHighestResolution(
     ) is None:
         strAimedIOverSigmaAtHighestResolution = "BEST Default"
     else:
         strAimedIOverSigmaAtHighestResolution = "%.2f" % xsDataDiffractionPlan.getAimedIOverSigmaAtHighestResolution(
         ).getValue()
     listRow.append(strAimedIOverSigmaAtHighestResolution)
     # Aimed resolution
     if xsDataDiffractionPlan.getAimedResolution() is None:
         strAimedResolution = "Default\n(highest possible)"
     else:
         strAimedResolution = "%0.2f" % xsDataDiffractionPlan.getAimedResolution(
         ).getValue()
     listRow.append(strAimedResolution)
     # Min osc width
     if xsDataDiffractionPlan.goniostatMinOscillationWidth is None:
         strMinOscWidth = "Default"
     else:
         strMinOscWidth = "%0.2f" % xsDataDiffractionPlan.goniostatMinOscillationWidth.value
     listRow.append(strMinOscWidth)
     if strExtraColumnValue is not None:
         listRow.append(strExtraColumnValue)
     #
     dictTable["data"].append(listRow)
     self.workflowStepReport.addTable(strTitle, dictTable["columns"],
                                      dictTable["data"])
    def preProcess(self, _edPlugin=None):
        """
        Gets the Configuration Parameters, if found, overrides default parameters
        """
        EDPluginControl.preProcess(self, _edPlugin)
        self.DEBUG("EDPluginControlInterfacev2_0.preProcess...")

        self.listImagePaths = []

        if (self.hasDataInput("diffractionPlan")):
            xsDataDiffractionPlan = XSDataDiffractionPlan()
            xsDataDiffractionPlans = self.getDataInput("diffractionPlan")
            if (not xsDataDiffractionPlans[0] is None):
                xsDataDiffractionPlan = xsDataDiffractionPlans[0]
                if (not xsDataDiffractionPlan.getForcedSpaceGroup() is None):
                    self.strForcedSpaceGroup = xsDataDiffractionPlan.getForcedSpaceGroup().getValue()
                if (not xsDataDiffractionPlan.getMaxExposureTimePerDataCollection() is None):
                    self.fMaxExposureTimePerDataCollection = xsDataDiffractionPlan.getMaxExposureTimePerDataCollection().getValue()
                if (not xsDataDiffractionPlan.getAnomalousData() is None):
                    self.bAnomalousData = xsDataDiffractionPlan.getAnomalousData().getValue()
                if (not xsDataDiffractionPlan.getStrategyOption() is None):
                    self.strStrategyOption = xsDataDiffractionPlan.getStrategyOption().getValue()
                if (not xsDataDiffractionPlan.getComplexity() is None):
                    self.strComplexity = xsDataDiffractionPlan.getComplexity().getValue()

        if (self.hasDataInput("imagePaths")):
            for strImagePath in self.getDataInput("imagePaths"):
                self.listImagePaths.append(strImagePath)
        if (self.hasDataInput("flux")):
            self.fFlux = self.getDataInput("flux")[0].getValue()
        if (self.hasDataInput("minExposureTimePerImage")):
            self.fMinExposureTimePerImage = self.getDataInput("minExposureTimePerImage")[0].getValue()
        if (self.hasDataInput("beamSize")):
            self.fBeamSize = self.getDataInput("beamSize")[0].getValue()
        if (self.hasDataInput("templateMode")):
            self.bTemplateMode = self.getDataInput("templateMode")[0].getValue()
        if (self.hasDataInput("generatedTemplateFile")):
            self.strGeneratedTemplateFile = self.getDataInput("generatedTemplateFile")[0].getValue()
        if (self.hasDataInput("generatedTemplateFileMXv2")):
            self.strGeneratedTemplateFileMXv2 = self.getDataInput("generatedTemplateFileMXv2")[0].getValue()
        if (self.hasDataInput("resultsFilePath")):
            self.strResultsFilePath = self.getDataInput("resultsFilePath")[0].getValue()
        if (self.hasDataInput("beamPosX")):
            self.fBeamPosX = self.getDataInput("beamPosX")[0].getValue()
        if (self.hasDataInput("beamPosY")):
            self.fBeamPosY = self.getDataInput("beamPosY")[0].getValue()
        if (self.hasDataInput("transmission")):
            self.fTransmission = self.getDataInput("transmission")[0].getValue()
        if (self.hasDataInput("dataCollectionId")):
            self.iDataCollectionId = self.getDataInput("dataCollectionId")[0].getValue()
        if (self.hasDataInput("shortComments")):
            self.strShortComments = self.getDataInput("shortComments")[0].getValue()
        if (self.hasDataInput("comments")):
            self.strComments = self.getDataInput("comments")[0].getValue()
        if (self.hasDataInput("inputCharacterisation")):
            self.xsDataInputCharacterisation = self.getDataInput("inputCharacterisation")[0]
        if (self.hasDataInput("mxv2DataCollection")):
            self.xsDataCollectionMXv2 = self.getDataInput("mxv2DataCollection")[0]

        # Check if XML data is given as input :
        if (self.xsDataInputCharacterisation is None):
            self.edPluginControlSubWedgeAssemble = self.loadPlugin(self.strEDPluginControlSubWedgeAssembleName, "SubWedgeAssemble")

        self.edPluginControlCharacterisation = self.loadPlugin(self.strEDPluginControlCharacterisationName, "Characterisation")

        if (self.strEDPluginControlISPyBName is not None):
            self.edPluginControlISPyB = self.loadPlugin(self.strEDPluginControlISPyBName, "ISPyB")
예제 #12
0
 def buildChildren(self, child_, nodeName_):
     if child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'experimentalCondition':
         obj_ = XSDataExperimentalCondition()
         obj_.build(child_)
         self.setExperimentalCondition(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'diffractionPlan':
         obj_ = XSDataDiffractionPlan()
         obj_.build(child_)
         self.setDiffractionPlan(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'sample':
         obj_ = XSDataSampleCrystalMM()
         obj_.build(child_)
         self.setSample(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'imagePath':
         obj_ = XSDataFile()
         obj_.build(child_)
         self.imagePath.append(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'flux':
         obj_ = XSDataFloat()
         obj_.build(child_)
         self.setFlux(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'minExposureTimePerImage':
         obj_ = XSDataTime()
         obj_.build(child_)
         self.setMinExposureTimePerImage(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'beamSize':
         obj_ = XSDataLength()
         obj_.build(child_)
         self.setBeamSize(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'beamSizeX':
         obj_ = XSDataLength()
         obj_.build(child_)
         self.setBeamSizeX(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'beamSizeY':
         obj_ = XSDataLength()
         obj_.build(child_)
         self.setBeamSizeY(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'apertureSize':
         obj_ = XSDataLength()
         obj_.build(child_)
         self.setApertureSize(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'templateMode':
         obj_ = XSDataBoolean()
         obj_.build(child_)
         self.setTemplateMode(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'generatedTemplateFile':
         obj_ = XSDataFile()
         obj_.build(child_)
         self.setGeneratedTemplateFile(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'resultsFilePath':
         obj_ = XSDataFile()
         obj_.build(child_)
         self.setResultsFilePath(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'beamPosX':
         obj_ = XSDataFloat()
         obj_.build(child_)
         self.setBeamPosX(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'beamPosY':
         obj_ = XSDataFloat()
         obj_.build(child_)
         self.setBeamPosY(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'wavelength':
         obj_ = XSDataWavelength()
         obj_.build(child_)
         self.setWavelength(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'transmission':
         obj_ = XSDataDouble()
         obj_.build(child_)
         self.setTransmission(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'dataCollectionId':
         obj_ = XSDataInteger()
         obj_.build(child_)
         self.setDataCollectionId(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'shortComments':
         obj_ = XSDataString()
         obj_.build(child_)
         self.setShortComments(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'comments':
         obj_ = XSDataString()
         obj_.build(child_)
         self.setComments(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'inputCharacterisation':
         obj_ = XSDataInputCharacterisation()
         obj_.build(child_)
         self.setInputCharacterisation(obj_)
    def testSetDataModelInput(self):
        from XSDataCCP4iv1_1 import XSDataInputCCP4i
        xsDataInputCCP4i = XSDataInputCCP4i()

        # Beam
        from XSDataCommon import XSDataFlux
        from XSDataCommon import XSDataSize
        from XSDataCommon import XSDataLength
        from XSDataCommon import XSDataFloat

        from XSDataMXv1 import XSDataBeam
        from XSDataMXv1 import XSDataExperimentalCondition

        xsExperimentalCondition = XSDataExperimentalCondition()

        xsBeam = XSDataBeam()
        xsBeam.setFlux(XSDataFlux(1e+12))
        xsBeam.setSize(XSDataSize(XSDataLength(0.1), XSDataLength(0.1)))
        xsBeam.setMinExposureTimePerImage(XSDataFloat(0.1))
        xsExperimentalCondition.setBeam(xsBeam)

        # Goniostat
        from XSDataCommon import XSDataSpeed
        from XSDataCommon import XSDataAngle

        from XSDataMXv1 import XSDataGoniostat

        xsDataGoniostat = XSDataGoniostat()
        xsDataGoniostat.setMaxOscillationSpeed(XSDataSpeed(0.2))
        xsDataGoniostat.setMinOscillationWidth(XSDataAngle(0.1))
        xsExperimentalCondition.setGoniostat(xsDataGoniostat)
        xsDataInputCCP4i.setExperimentalCondition(xsExperimentalCondition)

        # Sample
        from XSDataCommon import XSDataString
        from XSDataCommon import XSDataFloat
        from XSDataCommon import XSDataString

        from XSDataMXv1 import XSDataStructure
        from XSDataMXv1 import XSDataChain
        from XSDataMXv1 import XSDataAtom
        from XSDataMXv1 import XSDataLigand
        from XSDataMXv1 import XSDataSampleCrystalMM
        from XSDataMXv1 import XSDataChemicalCompositionMM
        from XSDataMXv1 import XSDataAtomicComposition
        from XSDataMXv1 import XSDataSolvent

        xsDataSampleCrystalMM = XSDataSampleCrystalMM()
        xsDataStructure = XSDataStructure()
        xsDataComposition = XSDataChemicalCompositionMM()

        xsDataChain = XSDataChain()
        xsDataChain.setType(XSDataString("protein"))
        xsDataChain.setNumberOfCopies(XSDataFloat(2))
        xsDataAtomicComposition = XSDataAtomicComposition()
        xsDataAtom1 = XSDataAtom()
        xsDataAtom1.setSymbol(XSDataString("Se"))
        xsDataAtom1.setNumberOf(XSDataFloat(4))
        xsDataAtomicComposition.addAtom(xsDataAtom1)

        xsDataChain.setHeavyAtoms(xsDataAtomicComposition)
        xsDataChain.setNumberOfMonomers(XSDataFloat(100))
        xsDataStructure.addChain(xsDataChain)

        xsDataChain2 = XSDataChain()
        xsDataChain2.setType(XSDataString("rna"))
        xsDataChain2.setNumberOfCopies(XSDataFloat(1))
        xsDataChain2.setNumberOfMonomers(XSDataFloat(60))
        xsDataStructure.addChain(xsDataChain2)

        xsDataLigand = XSDataLigand()
        xsDataLigand.setNumberOfCopies(XSDataFloat(2))
        xsDataLigand.setNumberOfLightAtoms(XSDataFloat(42))
        xsDataAtomicComposition = XSDataAtomicComposition()
        xsDataAtom2 = XSDataAtom()
        xsDataAtom2.setSymbol(XSDataString("Fe"))
        xsDataAtom2.setNumberOf(XSDataFloat(1))
        xsDataAtomicComposition.addAtom(xsDataAtom2)
        xsDataLigand.setHeavyAtoms(xsDataAtomicComposition)
        xsDataStructure.addLigand(xsDataLigand)
        xsDataStructure.setNumberOfCopiesInAsymmetricUnit(XSDataFloat(0.25))

        xsDataSolvent = XSDataSolvent()
        xsDataAtomicComposition = XSDataAtomicComposition()

        xsDataAtom3 = XSDataAtom()
        xsDataAtom3.setSymbol(XSDataString("Na"))
        xsDataAtom3.setConcentration(XSDataFloat(1000))
        xsDataAtom4 = XSDataAtom()
        xsDataAtom4.setSymbol(XSDataString("Cl"))
        xsDataAtom4.setConcentration(XSDataFloat(1000))

        xsDataAtomicComposition.addAtom(xsDataAtom3)
        xsDataAtomicComposition.addAtom(xsDataAtom4)
        xsDataSolvent.setAtoms(xsDataAtomicComposition)

        xsDataComposition.setStructure(xsDataStructure)
        xsDataComposition.setSolvent(xsDataSolvent)
        xsDataSampleCrystalMM.setChemicalComposition(xsDataComposition)

        xsDataSampleCrystalMM.setSize(XSDataSize(XSDataLength(0.2), XSDataLength(0.2), XSDataLength(0.2)))
        xsDataSampleCrystalMM.setSusceptibility(XSDataFloat(1.5))
        xsDataSampleCrystalMM.setShape(XSDataFloat(2))

        xsDataInputCCP4i.setSample(xsDataSampleCrystalMM)

        from XSDataMXv1 import XSDataDiffractionPlan

        xsDataDiffractionPlan = XSDataDiffractionPlan()

        xsDataDiffractionPlan.setAimedCompleteness(XSDataFloat(95.5))
        xsDataDiffractionPlan.setAimedIOverSigmaAtHighestResolution(XSDataFloat(2.5))
        xsDataDiffractionPlan.setAimedMultiplicity(XSDataFloat(95.5))
        xsDataDiffractionPlan.setAimedResolution(XSDataFloat(3))
        xsDataDiffractionPlan.setComplexity(XSDataString("full"))
        xsDataDiffractionPlan.setForcedSpaceGroup(XSDataString("P222"))
        xsDataDiffractionPlan.setMaxExposureTimePerDataCollection(XSDataFloat(10000))

        xsDataInputCCP4i.setDiffractionPlan(xsDataDiffractionPlan)

        from XSDataCommon import XSDataFile

        listInputDataFile = []
        xsDataFile = XSDataFile(XSDataString(self.strXSDataGenerateTemplateFile))
        listInputDataFile.append(xsDataFile)
        xsDataInputCCP4i.setDataFile(listInputDataFile)