当前位置: 首页>>代码示例>>Python>>正文


Python XSDataSampleCrystalMM.getChemicalComposition方法代码示例

本文整理汇总了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")
开发者ID:jordiandreu,项目名称:edna-mx,代码行数:70,代码来源:EDPluginControlStrategyv1_2.py


注:本文中的XSDataMXv1.XSDataSampleCrystalMM.getChemicalComposition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。