CoreShell.py 文件源码

python
阅读 54 收藏 0 点赞 0 评论 0

项目:PyMieScatt 作者: bsumlin 项目源码 文件源码
def CoreShellScatteringFunction(mCore,mShell,wavelength,dCore,dShell,minAngle=0, maxAngle=180, angularResolution=0.5, normed=False):
#  http://pymiescatt.readthedocs.io/en/latest/forwardCS.html#CoreShellScatteringFunction
  xCore = np.pi*dCore/wavelength
  xShell = np.pi*dShell/wavelength
  theta = np.linspace(minAngle,maxAngle,int((maxAngle-minAngle)/angularResolution))*np.pi/180
  thetaSteps = len(theta)
  SL = np.zeros(thetaSteps)
  SR = np.zeros(thetaSteps)
  SU = np.zeros(thetaSteps)
  for j in range(thetaSteps):
    u = np.cos(theta[j])
    S1,S2 = CoreShellS1S2(mCore,mShell,xCore,xShell,u)
    SL[j] = (np.sum((np.conjugate(S1)*S1))).real
    SR[j] = (np.sum((np.conjugate(S2)*S2))).real
    SU[j] = (SR[j]+SL[j])/2
  if normed:
    SL /= np.max(SL)
    SR /= np.max(SR)
    SU /= np.max(SU)
  return theta,SL,SR,SU
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号