本文整理汇总了Python中XSDataMXv1.XSDataDiffractionPlan类的典型用法代码示例。如果您正苦于以下问题:Python XSDataDiffractionPlan类的具体用法?Python XSDataDiffractionPlan怎么用?Python XSDataDiffractionPlan使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XSDataDiffractionPlan类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: functionXMLin
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: preProcess
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")
# 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.bStoreImageQualityIndicatorsInISPyB:
self.edPluginISPyBStoreImageQualityIndicators = self.loadPlugin(self.strISPyBStoreImageQualityIndicatorsPluginName, \
"ISPyBStoreImageQualityIndicators")
示例3: functionXMLin
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
示例4: createInputCharacterisationFromSubWedges
def createInputCharacterisationFromSubWedges(self):
self.DEBUG("EDPluginControlInterfacev1_3.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.fApertureSize is not None):
xsDataSubWedge.getExperimentalCondition().getBeam().setApertureSize(XSDataLength(self.fApertureSize))
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)
示例5: EDPluginControlInterfacev1_3
class EDPluginControlInterfacev1_3(EDPluginControl):
"""
This is the common class to all plugins managing user interfaces
"""
def __init__ (self):
"""
"""
EDPluginControl.__init__(self)
self.setXSDataInputClass(XSDataInputInterface)
self.setXSDataInputClass(XSDataExperimentalCondition, "experimentalCondition")
self.setXSDataInputClass(XSDataDiffractionPlan, "diffractionPlan")
self.setXSDataInputClass(XSDataSampleCrystalMM, "sample")
self.setXSDataInputClass(XSDataString, "imagePaths")
self.setXSDataInputClass(XSDataFloat, "flux")
self.setXSDataInputClass(XSDataFloat, "minExposureTimePerImage")
self.setXSDataInputClass(XSDataFloat, "beamSize")
self.setXSDataInputClass(XSDataFloat, "beamSizeX")
self.setXSDataInputClass(XSDataFloat, "beamSizeY")
self.setXSDataInputClass(XSDataBoolean, "templateMode")
self.setXSDataInputClass(XSDataString, "generatedTemplateFile")
self.setXSDataInputClass(XSDataString, "resultsFilePath")
self.setXSDataInputClass(XSDataFloat, "beamPosX")
self.setXSDataInputClass(XSDataFloat, "beamPosY")
self.setXSDataInputClass(XSDataDouble, "wavelength")
self.setXSDataInputClass(XSDataDouble, "transmission")
self.setXSDataInputClass(XSDataInteger, "dataCollectionId")
self.setXSDataInputClass(XSDataString, "shortComments")
self.setXSDataInputClass(XSDataString, "comments")
self.setXSDataInputClass(XSDataInputCharacterisation, "inputCharacterisation")
self.strEDPluginControlSubWedgeAssembleName = "EDPluginControlSubWedgeAssemblev1_1"
self.strEDPluginControlCharacterisationName = "EDPluginControlCharacterisationv1_5"
self.strEDPluginControlISPyBName = "EDPluginControlISPyBv1_1"
self.edPluginControlSubWedgeAssemble = None
self.edPluginControlCharacterisation = None
self.edPluginControlISPyB = None
self.pyListImagePaths = None
self.xsDataInputCharacterisation = None
self.strComplexity = "none"
self.listImagePaths = []
self.fFlux = None
self.fMaxExposureTimePerDataCollection = 10000 # s, default prototype value
self.fMinExposureTimePerImage = None
self.fBeamSizeX = None
self.fBeamSizeY = None
self.fApertureSize = None
self.bTemplateMode = False
self.strGeneratedTemplateFile = None
self.strResultsFilePath = None
self.strForcedSpaceGroup = None
self.bAnomalousData = False
self.fBeamPosX = None
self.fBeamPosY = None
self.fMinOscillationWidth = None
self.fMaxOscillationSpeed = None
self.fWavelength = None
self.fTransmission = None
self.strStrategyOption = None
self.iDataCollectionId = None
self.strShortComments = None
self.strComments = None
self.strStatusMessage = None
self.xsDataExperimentalCodition = None
self.xsDataSample = None
self.xsDataDiffractionPlan = None
def configure(self):
"""
Gets the configuration parameters (if any).
"""
EDPluginControl.configure(self)
self.DEBUG("EDPluginControlInterfacev1_3.configure")
if (self.getControlledPluginName("subWedgeAssemblePlugin") is not None):
self.strEDPluginControlSubWedgeAssembleName = self.getControlledPluginName("subWedgeAssemblePlugin")
if (self.getControlledPluginName("characterisationPlugin") is not None):
self.strEDPluginControlCharacterisationName = self.getControlledPluginName("characterisationPlugin")
if (self.getControlledPluginName("ispybPlugin") is not None):
self.strEDPluginControlISPyBName = self.getControlledPluginName("ispybPlugin")
bUseISPyBPlugin = self.config.get("useISPyBPlugin")
if not bUseISPyBPlugin:
self.DEBUG("EDPluginControlInterfacev1_3 configured to not use ISPyB")
self.strEDPluginControlISPyBName = None
def preProcess(self, _edPlugin=None):
"""
Gets the Configuration Parameters, if found, overrides default parameters
"""
EDPluginControl.preProcess(self, _edPlugin)
self.DEBUG("EDPluginControlInterfacev1_3.preProcess...")
#.........这里部分代码省略.........
示例6: preProcess
#.........这里部分代码省略.........
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:
示例7: createInputCharacterisationFromSubWedges
def createInputCharacterisationFromSubWedges(self):
self.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)
示例8: preProcess
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")
示例9: diffractionPlan
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<br>distance (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<br>(optimized)"
else:
strAimedMultiplicity = "%.2f" % xsDataDiffractionPlan.getAimedMultiplicity().getValue()
listRow.append(strAimedMultiplicity)
# Aimed completeness
if xsDataDiffractionPlan.getAimedCompleteness() is None:
strAimedCompleteness = "Default<br>(>= 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<br>(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"])
示例10: diffractionPlan
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 (Å)")
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()
示例11: setPluginInput
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")
示例12: EDPluginControlGridScreeningv1_0
class EDPluginControlGridScreeningv1_0(EDPluginControl):
"""
This plugin is a "light-weight" characterisation to be used for processing
images from grid scans.
"""
def __init__(self):
EDPluginControl.__init__(self)
self.setXSDataInputClass(XSDataInputGridScreening)
self.strControlReadImageHeaderPluginName = "EDPluginControlReadImageHeaderv10"
self.edPluginControlReadImageHeader = None
self.strControlledIndicatorsPluginName = "EDPluginControlImageQualityIndicatorsv1_4"
self.edPluginControlIndicators = None
self.strISPyBStoreImageQualityIndicatorsPluginName = "EDPluginISPyBStoreImageQualityIndicatorsv1_4"
self.edPluginISPyBStoreImageQualityIndicators = None
self.strIndexingMOSFLMPluginName = "EDPluginMOSFLMIndexingv10"
self.edPluginMOSFLMIndexing = None
self.strPluginControlIntegration = "EDPluginControlIntegrationv10"
self.edPluginControlIntegration = None
self.strPluginControlStrategy = "EDPluginControlStrategyv1_2"
self.edPluginControlStrategy = None
self.strPluginExecMtz2Various = "EDPluginExecMtz2Variousv1_0"
self.edPluginExecMtz2Various = None
self.strImageFile = None
self.xsDataIndexingResultMOSFLM = None
self.xsDataCrystal = None
self.strCharacterisationShortSummary = ""
self.strStatusMessage = ""
self.xsDataDiffractionPlan = None
self.xsDataCollection = None
self.xsDataIndexingResult = None
self.xsDataStrategyResult = None
self.xsDataImageQualityIndicators = None
self.bStoreImageQualityIndicatorsInISPyB = False
self.bDoOnlyImageQualityIndicators = False
self.bDoOnlyIntegrationWithXMLOutput = False
self.iImageQualityIndicatorsId = None
self.xsDataGridScreeningResultIntegration = None
def checkParameters(self):
"""
Checks the mandatory parameters.
"""
self.DEBUG("EDPluginControlGridScreeningv1_0.checkParameters")
self.checkMandatoryParameters(self.getDataInput(), "Data Input is None")
self.checkMandatoryParameters(self.getDataInput().getImageFile(), "imageFile")
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 process(self, _edObject=None):
EDPluginControl.process(self)
self.DEBUG("EDPluginControlGridScreeningv1_0.process")
xsDataInputReadImageHeader = XSDataInputReadImageHeader()
xsDataInputReadImageHeader.setImage(image=XSDataFile(path=XSDataString(self.strImageFile)))
self.edPluginControlReadImageHeader.setDataInput(xsDataInputReadImageHeader)
self.edPluginControlReadImageHeader.connectSUCCESS(self.doSuccessReadImageHeader)
self.edPluginControlReadImageHeader.connectFAILURE(self.doFailureReadImageHeader)
self.executePluginSynchronous(self.edPluginControlReadImageHeader)
#.........这里部分代码省略.........
示例13: testSetDataModelInput
#.........这里部分代码省略.........
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)
示例14: EDPluginControlInterfacev1_2
class EDPluginControlInterfacev1_2(EDPluginControl):
"""
This is the common class to all plugins managing user interfaces
"""
def __init__ (self):
"""
"""
EDPluginControl.__init__(self)
self.setXSDataInputClass(XSDataInputInterface)
self.setXSDataInputClass(XSDataExperimentalCondition, "experimentalCondition")
self.setXSDataInputClass(XSDataDiffractionPlan, "diffractionPlan")
self.setXSDataInputClass(XSDataSampleCrystalMM, "sample")
self.setXSDataInputClass(XSDataString, "imagePaths")
self.setXSDataInputClass(XSDataFloat, "flux")
self.setXSDataInputClass(XSDataFloat, "minExposureTimePerImage")
self.setXSDataInputClass(XSDataFloat, "beamSize")
self.setXSDataInputClass(XSDataFloat, "beamSizeX")
self.setXSDataInputClass(XSDataFloat, "beamSizeY")
self.setXSDataInputClass(XSDataBoolean, "templateMode")
self.setXSDataInputClass(XSDataString, "generatedTemplateFile")
self.setXSDataInputClass(XSDataString, "resultsFilePath")
self.setXSDataInputClass(XSDataFloat, "beamPosX")
self.setXSDataInputClass(XSDataFloat, "beamPosY")
self.setXSDataInputClass(XSDataDouble, "wavelength")
self.setXSDataInputClass(XSDataDouble, "transmission")
self.setXSDataInputClass(XSDataInteger, "dataCollectionId")
self.setXSDataInputClass(XSDataString, "shortComments")
self.setXSDataInputClass(XSDataString, "comments")
self.setXSDataInputClass(XSDataInputCharacterisation, "inputCharacterisation")
self.strEDPluginControlSubWedgeAssembleName = "EDPluginControlSubWedgeAssemblev1_1"
self.strEDPluginControlCharacterisationName = "EDPluginControlCharacterisationv1_1"
self.strEDPluginControlISPyBName = "EDPluginControlISPyBv1_1"
self.edPluginControlSubWedgeAssemble = None
self.edPluginControlCharacterisation = None
self.edPluginControlISPyB = None
self.pyListImagePaths = None
self.xsDataInputCharacterisation = None
self.strComplexity = "none"
self.listImagePaths = []
self.fFlux = None
self.fMaxExposureTimePerDataCollection = 10000 # s, default prototype value
self.fMinExposureTimePerImage = None
self.fBeamSizeX = None
self.fBeamSizeY = None
self.bTemplateMode = False
self.strGeneratedTemplateFile = None
self.strResultsFilePath = None
self.strForcedSpaceGroup = None
self.bAnomalousData = False
self.fBeamPosX = None
self.fBeamPosY = None
self.fMinOscillationWidth = None
self.fMaxOscillationSpeed = None
self.fWavelength = None
self.fTransmission = None
self.strStrategyOption = None
self.iDataCollectionId = None
self.strShortComments = None
self.strComments = None
self.strStatusMessage = None
self.xsDataExperimentalCodition = None
self.xsDataSample = None
self.xsDataDiffractionPlan = None
def configure(self):
"""
Gets the configuration parameters (if any).
"""
EDPluginControl.configure(self)
EDVerbose.DEBUG("EDPluginControlInterfacev1_2.configure")
pluginConfiguration = self.getConfiguration()
if (pluginConfiguration is None):
EDVerbose.DEBUG("No plugin configuration found for EDPluginControlInterfacev1_2.")
else:
if (self.getControlledPluginName("subWedgeAssemblePlugin") is not None):
self.strEDPluginControlSubWedgeAssembleName = self.getControlledPluginName("subWedgeAssemblePlugin")
if (self.getControlledPluginName("characterisationPlugin") is not None):
self.strEDPluginControlCharacterisationName = self.getControlledPluginName("characterisationPlugin")
if (self.getControlledPluginName("ispybPlugin") is not None):
self.strEDPluginControlISPyBName = self.getControlledPluginName("ispybPlugin")
bUseISPyBPlugin = EDConfiguration.getStringParamValue(pluginConfiguration, "useISPyBPlugin")
if (bUseISPyBPlugin.lower() != "true"):
self.strEDPluginControlISPyBName = None
def preProcess(self, _edPlugin=None):
"""
Gets the Configuration Parameters, if found, overrides default parameters
"""
#.........这里部分代码省略.........