Пример #1
0
 def _getDiffrationAnglesHkl(self,hkl,crystal=None):
   if not crystal:
     crystal = self.Xtal
   Q = crystal.getQhkl(hkl)
   phi,phiE = self._getPhiRotation(Q)
   Q = rotmat3D(np.array([0,0,1]),(phi+phiE))*np.asmatrix(Q).ravel().transpose()
   Q = rotmat3D(self.etaRotationAxis,self.eta)*np.asmatrix(Q).ravel().transpose()
   kout = self.Kvec+np.asarray(Q).ravel().transpose()
   el = np.arcsin(kout[2]/self.K)
   az = -1*np.arctan2(kout[0],kout[1])
   return az,el
Пример #2
0
def gamdel2Qfib(gamma,delta,alpha,lam):
  gamma = np.array(iterfy(gamma))
  delta = np.array(iterfy(delta))

  shpgam = np.shape(gamma)
  shpdel = np.shape(delta)
  if not shpgam==shpdel:
    logbook("gamma and delta array must have same shape!")
    return
  gamma = gamma.ravel()
  delta = delta.ravel()
  Qs =  2*np.pi/lam * np.array((-rotmat3D([0,1,0],-alpha))*np.mat([
    np.cos(delta)*np.cos(gamma)-1,
    -np.cos(delta)*np.sin(gamma),
    -np.sin(delta)]))
  Qip = np.sign(Qs[1,:])*np.sqrt(Qs[0,:]**2+Qs[1,:]**2);
  Qop = Qs[2,:]
  Qip = Qip.reshape(shpgam)
  Qop = Qop.reshape(shpgam)
  return Qip,Qop
Пример #3
0
 def _setIncidenceAngle(self,eta=0):
   self.incAngrotmat = rotmat3D(self.etaRotationAxis,eta)
   self.phiRotationAxis = rotmat3D(self.etaRotationAxis,eta)*np.asmatrix(self.phiRotationAxis).ravel().transpose()
   self.phiRotationAxis = np.array(self.phiRotationAxis).ravel()
   self.eta = eta