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


Python Physics.gaussian方法代码示例

本文整理汇总了Python中Physics.gaussian方法的典型用法代码示例。如果您正苦于以下问题:Python Physics.gaussian方法的具体用法?Python Physics.gaussian怎么用?Python Physics.gaussian使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Physics的用法示例。


在下文中一共展示了Physics.gaussian方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: sigma

# 需要导入模块: import Physics [as 别名]
# 或者: from Physics import gaussian [as 别名]
    def sigma(self, G=False, order=1, distribution="gaussian"):
    
        local_xtal_g = self.change_the_g(self.xtal.g)

        #print "g", self.xtal.g,  local_xtal_g
        
        #lgn=Physics.normalize(local_xtal_g)
        local_xtal_gphi = Physics.atan2(local_xtal_g[1], local_xtal_g[0])
        #local_xtal_gtheta = math.acos(lgn[2])
        tB = self.xtal.keV2Bragg(self.photon.e)
        factor = 2.5 
        ang_fac = Physics.angular_factor(tB)
        cosine = abs(self.photon.k[2]/self.photon.knorm)
        Q = self.xtal.mat_facs[order]*ang_fac
        if G is None: G=self.g_needed(order)
        if distribution=="hat":
            Dtheta = Physics.anglebetween(G, local_xtal_g) # - 2.0 * Physics.anglebetween(self.xtal.g, local_xtal_g)
            eta = 2.4e-6 + (self.xtal.dim[2] * self.xtal.curvature) / factor
            weight=Physics.hat1(Dtheta, eta)*cosine/Q 
        elif distribution=="gaussian":      
           
            Dtheta = Physics.anglebetween(G, local_xtal_g) # - 2.0 * Physics.anglebetween(self.xtal.g, local_xtal_g)
            weight=Physics.gaussian(Dtheta, self.xtal.eta)
        else: return 0.

        return Q*weight/cosine
开发者ID:enricovirgilli,项目名称:lll,代码行数:28,代码来源:Source.py

示例2: sigma

# 需要导入模块: import Physics [as 别名]
# 或者: from Physics import gaussian [as 别名]
 def sigma(self, keV, OFFSET=0., order=1, distribution="gaussian"):
     """Replacement for Physics.sigma function."""
     tB = self.keV2Bragg(keV, order)
     Q = self.mat_facs[order]*Physics.angular_factor(tB)
     Dtheta = self.getDelta(tB, OFFSET)
     if distribution=="hat":
         weight=Physics.hat(Dtheta, Physics.eta2fwhm(self.eta))
     elif distribution=="gaussian":
         weight=Physics.gaussian(Dtheta, self.eta)
     else: return 0.
     return Q*weight/math.cos(tB)
开发者ID:enricovirgilli,项目名称:lll,代码行数:13,代码来源:Xtal.py

示例3: sigma

# 需要导入模块: import Physics [as 别名]
# 或者: from Physics import gaussian [as 别名]
 def sigma(self, G=False, order=1, distribution="gaussian"):
     """Interface to the sigma function from Physics."""
     tB = self.xtal.keV2Bragg(self.photon.e)
     ang_fac = Physics.angular_factor(tB)
     Q = self.xtal.mat_facs[order]*ang_fac
     if G is None: G=self.g_needed(order)
     Dtheta = Physics.anglebetween(G, self.xtal.g)
     if distribution=="hat":
         weight=Physics.hat(Dtheta, Physics.eta2fwhm(self.xtal.eta))
     elif distribution=="gaussian":
         weight=Physics.gaussian(Dtheta, self.xtal.eta)
     else: return 0.
     cosine = abs(self.photon.k[2]/self.photon.knorm)
     return Q*weight/cosine
开发者ID:enricovirgilli,项目名称:lll,代码行数:16,代码来源:Source.py


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