本文整理匯總了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")