當前位置: 首頁>>代碼示例>>Python>>正文


Python Transform.getMaxTwoTheta方法代碼示例

本文整理匯總了Python中Transform.getMaxTwoTheta方法的典型用法代碼示例。如果您正苦於以下問題:Python Transform.getMaxTwoTheta方法的具體用法?Python Transform.getMaxTwoTheta怎麽用?Python Transform.getMaxTwoTheta使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Transform的用法示例。


在下文中一共展示了Transform.getMaxTwoTheta方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: cake

# 需要導入模塊: import Transform [as 別名]
# 或者: from Transform import getMaxTwoTheta [as 別名]
    def cake(self,diffractionData,calibrationData,qOrTwoThetaLower,
            qOrTwoThetaUpper,numQOrTwoTheta,chiLower,chiUpper,numChi,
            doPolarizationCorrection,P,maskedPixelInfo,type):

        if chiLower >= chiUpper:
            raise Exception("Unable to cake. The lower chi value must be \
less then the upper chi value.")

        if (chiUpper - chiLower) > 360:
            raise Exception("The chi values must have a range no larger \
then 360 degrees.")

        if type == 'Q':
            if qOrTwoThetaLower >= qOrTwoThetaUpper:
                raise Exception("Unable to cake. The lower Q value must be \
less then the upper Q value")

            if qOrTwoThetaLower < 0: 
                raise Exception("Unable to cake. The lower Q value must be \
larger then 0.")

            if qOrTwoThetaUpper > Transform.getMaxQ(calibrationData):
                raise Exception("Unable to cake. The upper Q value must be \
less then the largest possible Q value.")

            if numQOrTwoTheta < 1:
                raise Exception("Unable to cake. The number of Q must be at \
least 1.")

        elif type == '2theta':
            if qOrTwoThetaLower >= qOrTwoThetaUpper:
                raise Exception("Unable to cake. The lower 2theta value must \
be less then the upper 2theta value")

            if qOrTwoThetaLower < 0: 
                raise Exception("Unable to cake. The lower 2theta value must \
be larger then 0.")

            if qOrTwoThetaUpper > Transform.getMaxTwoTheta():
                raise Exception("Unable to cake. The upper 2theta value must \
be smaller then 90.")

            if numQOrTwoTheta < 1:
                raise Exception("Unable to cake. The number of 2theta must \
be at least 1.")
        else:
            raise Exception("Unable to cake. The function must be passed \
for the parameter type either 'Q', or '2theta'")


        if maskedPixelInfo.doLessThanMask:
            lessThanMask = maskedPixelInfo.lessThanMask
        else:
            # We can just send the function a bunch of junk since 
            # it won't be used
            lessThanMask = -1

        if maskedPixelInfo.doGreaterThanMask:
            greaterThanMask = maskedPixelInfo.greaterThanMask
        else:
            greaterThanMask = -1

        if maskedPixelInfo.doPolygonMask:
            polygonsX = maskedPixelInfo.polygonsX
            polygonsY = maskedPixelInfo.polygonsY
            polygonBeginningsIndex = maskedPixelInfo.polygonBeginningsIndex
            polygonNumberOfItems = maskedPixelInfo.polygonNumberOfItems
        else:
            polygonsX = Numeric.array([])
            polygonsY = Numeric.array([])
            polygonBeginningsIndex = Numeric.array([])
            polygonNumberOfItems = Numeric.array([])

        # use the wraped C code to do the caking
        self.cakeData = DiffractionAnalysisWrap.cake(
                diffractionData,
                calibrationData.getCenterX()['val'],
                calibrationData.getCenterY()['val'],
                calibrationData.getDistance()['val'],
                calibrationData.getEnergy()['val'],
                calibrationData.getAlpha()['val'], 
                calibrationData.getBeta()['val'],
                calibrationData.getRotation()['val'],
                qOrTwoThetaLower, qOrTwoThetaUpper,
                numQOrTwoTheta,
                chiLower, chiUpper,
                numChi,
                doPolarizationCorrection, P,
                maskedPixelInfo.doGreaterThanMask, greaterThanMask,
                maskedPixelInfo.doLessThanMask, lessThanMask,
                maskedPixelInfo.doPolygonMask,
                polygonsX, polygonsY,
                polygonBeginningsIndex,
                polygonNumberOfItems,
                calibrationData.getPixelLength()['val'],
                calibrationData.getPixelHeight()['val'],
                type)

        # store the values for later
        self.qOrTwoThetaLower=qOrTwoThetaLower
#.........這裏部分代碼省略.........
開發者ID:joshualande,項目名稱:AreaDiffractionMachine,代碼行數:103,代碼來源:Cake.py


注:本文中的Transform.getMaxTwoTheta方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。