本文整理汇总了Python中Physics.arcmin2rad方法的典型用法代码示例。如果您正苦于以下问题:Python Physics.arcmin2rad方法的具体用法?Python Physics.arcmin2rad怎么用?Python Physics.arcmin2rad使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Physics
的用法示例。
在下文中一共展示了Physics.arcmin2rad方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getDelta
# 需要导入模块: import Physics [as 别名]
# 或者: from Physics import arcmin2rad [as 别名]
def getDelta(self, tB, OFFSET=0.):
"""Function to get the angle between the most probable planes and the
planes that scatter photons with a certain Bragg angle.
Contains the obvious answer for in axis photons and the more complex
calculatin when photons are off axis"""
if OFFSET==0.:
return pi/2-self.gtheta-tB
else:
ktheta=pi - Physics.arcmin2rad(OFFSET)
stk, ctk = math.sin(ktheta), math.cos(ktheta)
stB = math.sin(tB)
# All starts from a 2nd order equ
# A=1.
Bhalf=(math.cos(self.gphi)*stk)/(stB-ctk)
C=(stB+ctk)/(stB-ctk)
Delta = Bhalf**2-C
# In case there are non solutions (energy too low, return None)
# if Delta<0.: return None
sqrtDelta = math.sqrt(Delta)
Ts= (-Bhalf - sqrtDelta, -Bhalf + sqrtDelta)
Deltas = [abs(2.*math.atan(T) - self.gtheta) for T in Ts]
return min(Deltas)