コード例 #1
0
 def createDataInputCharacterisationFromDataSets(self,
                                                 _pyListXSDataCCP4iDataSet):
     """
     This method takes as input a list of ccp4i data sets. Each data set can contain several
     paths to image files. It runs the EDPluginControlSubWedgeAssemble plugin to read the
     experimental information from the image headers and then creates a single XSDataInputCharacterisation object.
     """
     EDVerbose.DEBUG(
         "EDPluginControlCCP4iv1_1.createDataInputCharacterisationFromDataSets"
     )
     xsDataInputCharacterisation = None
     # We might have to run the plugin several times
     edActionCluster = EDActionCluster()
     pyListPluginControlSubWedgeAssemble = []
     # Prepare the action cluster
     iIndex = 1
     for xsDataCCP4iDataSet in _pyListXSDataCCP4iDataSet:
         edPluginControlSubWedgeAssemble = self.loadPlugin(
             self.__strPluginControlSubWedgeAssembleName,
             "SubWedgeAssemble-%02d" % iIndex)
         edPluginControlSubWedgeAssemble.connectSUCCESS(
             self.doSuccessActionSubWedgeAssemble)
         edPluginControlSubWedgeAssemble.connectFAILURE(
             self.doFailureActionSubWedgeAssemble)
         # Prepare the input for the sub wedge assemble plugin
         xsDataInputSubWedgeAssemble = XSDataInputSubWedgeAssemble()
         for xsDataImageFile in xsDataCCP4iDataSet.getImageFile():
             xsDataInputSubWedgeAssemble.addFile(xsDataImageFile)
         edPluginControlSubWedgeAssemble.setDataInput(
             xsDataInputSubWedgeAssemble)
         pyListPluginControlSubWedgeAssemble.append(
             edPluginControlSubWedgeAssemble)
         self.addPluginToActionCluster(edPluginControlSubWedgeAssemble)
         iIndex += 1
     # Run the action cluster synchronously
     self.executeActionCluster()
     self.synchronizeActionCluster()
     # Recuperate the output
     for edPluginControlSubWedgeAssemble in pyListPluginControlSubWedgeAssemble:
         if (edPluginControlSubWedgeAssemble.isFailure()):
             self.setFailure()
         else:
             xsDataResultSubWedgeAssemble = edPluginControlSubWedgeAssemble.getDataOutput(
             )
             for xsDataSubWedge in xsDataResultSubWedgeAssemble.getSubWedge(
             ):
                 # Instantiate the xsDataInputCharacterisation object if it's not already done.
                 xsDataCollection = None
                 if (xsDataInputCharacterisation is None):
                     xsDataInputCharacterisation = XSDataInputCharacterisation(
                     )
                 else:
                     xsDataCollection = xsDataInputCharacterisation.getDataCollection(
                     )
                 if (xsDataCollection is None):
                     xsDataCollection = XSDataCollection()
                 xsDataCollection.addSubWedge(xsDataSubWedge)
                 xsDataInputCharacterisation.setDataCollection(
                     xsDataCollection)
     return xsDataInputCharacterisation
コード例 #2
0
 def createDataInputCharacterisationFromDataFiles(self, _pyListXSDataFile):
     """
     This method takes as input a list of paths to XML data files. It parses
     these files and create a single XSDataInputCharacterisation object.
     """
     EDVerbose.DEBUG(
         "EDPluginControlCCP4iv1_1.createDataInputCharacterisationFromDataFiles"
     )
     xsDataInputCharacterisation = None
     for xsDataInputFile in _pyListXSDataFile:
         try:
             pyStrInputFileContent = EDUtilsFile.readFile(
                 xsDataInputFile.getPath().getValue())
             xsDataInputCharacterisationCurrent = XSDataInputCharacterisation.parseString(
                 pyStrInputFileContent)
         except Exception, detail:
             errorMessage = EDMessage.ERROR_EXECUTION_03 % (
                 'EDPluginControlCCP4iv1_1.preProcess',
                 'EDPluginControlCCP4iv1_1', detail)
             EDVerbose.error(errorMessage)
             self.addErrorMessage(errorMessage)
             raise RuntimeError, errorMessage
         if (xsDataInputCharacterisationCurrent is None):
             errorMessage = EDMessage.ERROR_EXECUTION_03 % (
                 'EDPluginControlCCP4iv1_1.preProcess',
                 'EDPluginControlCCP4iv1_1', "None data collection")
             EDVerbose.error(errorMessage)
             self.addErrorMessage(errorMessage)
             raise RuntimeError, errorMessage
         else:
             # Instantiate the xsDataInputCharacterisation object if it's not already done.
             if (xsDataInputCharacterisation is None):
                 xsDataInputCharacterisation = XSDataInputCharacterisation()
             xsDataInputCharacterisation.setDataCollection(
                 xsDataInputCharacterisationCurrent.getDataCollection())
コード例 #3
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)
コード例 #4
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)
コード例 #5
0
ファイル: XSDataInterfacev2_2.py プロジェクト: kif/edna
 def buildChildren(self, child_, nodeName_):
     if child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'mxv1InputCharacterisation':
         obj_ = XSDataInputCharacterisation()
         obj_.build(child_)
         self.setMxv1InputCharacterisation(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'mxv1ResultCharacterisation_Reference':
         obj_ = XSDataResultCharacterisation()
         obj_.build(child_)
         self.setMxv1ResultCharacterisation_Reference(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'mxv2DataCollection':
         obj_ = XSDataCollection()
         obj_.build(child_)
         self.setMxv2DataCollection(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'mxv2DataCollection_Reference':
         obj_ = XSDataCollection()
         obj_.build(child_)
         self.setMxv2DataCollection_Reference(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'possibleOrientations':
         obj_ = kappa_alignment_response()
         obj_.build(child_)
         self.setPossibleOrientations(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'omega':
         obj_ = XSDataAngle()
         obj_.build(child_)
         self.setOmega(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'kappa':
         obj_ = XSDataAngle()
         obj_.build(child_)
         self.setKappa(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'phi':
         obj_ = XSDataAngle()
         obj_.build(child_)
         self.setPhi(obj_)
     XSDataInputInterface.buildChildren(self, child_, nodeName_)
コード例 #6
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_)