本文整理汇总了Python中XSDataMXv1.XSDataSampleCrystalMM.getChemicalComposition方法的典型用法代码示例。如果您正苦于以下问题:Python XSDataSampleCrystalMM.getChemicalComposition方法的具体用法?Python XSDataSampleCrystalMM.getChemicalComposition怎么用?Python XSDataSampleCrystalMM.getChemicalComposition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XSDataMXv1.XSDataSampleCrystalMM
的用法示例。
在下文中一共展示了XSDataSampleCrystalMM.getChemicalComposition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: EDPluginControlStrategyv1_2
# 需要导入模块: from XSDataMXv1 import XSDataSampleCrystalMM [as 别名]
# 或者: from XSDataMXv1.XSDataSampleCrystalMM import getChemicalComposition [as 别名]
#.........这里部分代码省略.........
self.addErrorMessage(strErrorMessage)
raise RuntimeError(strErrorMessage)
else:
# Prepare chemical composition calculation with the Space Group calculated by indexing (Space Group IT number)
iSpaceGroupITNumber = (
self._xsDataSampleCopy.getCrystal().getSpaceGroup().getITNumber().getValue()
)
self.DEBUG(
"EDPluginControlStrategyv1_2.preProcess: Space Group IT Number Found by indexing: %d"
% iSpaceGroupITNumber
)
try:
strNumOperators = EDUtilsSymmetry.getNumberOfSymmetryOperatorsFromSpaceGroupITNumber(
str(iSpaceGroupITNumber), strFileSymop
)
except Exception as detail:
strErrorMessage = "EDPluginControlStrategyv1_2: Problem to calculate Number of symmetry operators: {0}".format(
detail
)
self.error(strErrorMessage)
self.addErrorMessage(strErrorMessage)
raise RuntimeError(strErrorMessage)
if strNumOperators is not None:
iNumOperators = int(strNumOperators)
else:
strErrorMessage = "EDPluginControlStrategyv1_2: No symmetry operators found for Space Group: {0}".format(
strNumOperators
)
self.error(strErrorMessage)
self.addErrorMessage(strErrorMessage)
raise RuntimeError(strErrorMessage)
xsDataChemicalComposition = self._xsDataSampleCopy.getChemicalComposition()
if xsDataChemicalComposition is None:
# create a default chemical composition and assign it to the sample
xsDataDefaultChemicalComposition = self.getDefaultChemicalComposition(
self._xsDataSampleCopy, iNumOperators
)
self._xsDataSampleCopy.setChemicalComposition(xsDataDefaultChemicalComposition)
else:
# Check for Sulfur atoms, if none, add native sulfur atoms
xsDataUpdatedChemicalComposition = self.updateChemicalComposition(xsDataChemicalComposition)
self._xsDataSampleCopy.setChemicalComposition(xsDataUpdatedChemicalComposition)
# create Data Input for Raddose
from EDHandlerXSDataRaddosev10 import EDHandlerXSDataRaddosev10
self._edHandlerXSDataRaddose = EDHandlerXSDataRaddosev10()
xsDataBeam = self.getDataInput().getExperimentalCondition().getBeam()
# Calculate number of images (MXSUP-1616):
iNumberOfImages = None
xsDataCollection = self.dataInput.dataCollection
if xsDataCollection is not None:
iNumberOfImages = 0
for xsDataSubWedge in xsDataCollection.subWedge:
xsDataGoniostat = xsDataSubWedge.experimentalCondition.goniostat
iOscStart = xsDataGoniostat.rotationAxisStart.value
iOscEnd = xsDataGoniostat.rotationAxisEnd.value
iOscWidth = xsDataGoniostat.oscillationWidth.value
iNumberOfImages += int(round((iOscEnd - iOscStart) / iOscWidth, 0))
if iNumberOfImages is None:
iNumberOfImages = 1
self.WARNING("No goniostat information, number of images for RADDOSE set to 1")