本文整理汇总了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
#.........这里部分代码省略.........