Changeset 1636
 Timestamp:
 Feb 5, 2015 3:11:52 PM (7 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIIspc.py
r1635 r1636 1540 1540 mst = ssopinv[3][:3] 1541 1541 epsinv = ssopinv[3][3] 1542 sdet = nl.det(sop[0]) 1543 ssdet = nl.det(ssop[0]) 1544 dtau = mst*(XYZsop[1])epsinv*ssop[1][3] 1545 dT = 1.0 1546 if np.any(dtau%.5): 1547 dT = np.tan(np.pi*np.sum(dtau)) 1548 print sdet,ssdet,dtau,np.sum(dtau),dT 1542 1549 tauT = np.inner(mst,XYZsop[1])+epsinv*(taussop[1][3]) 1543 1550 if waveType == 'Fourier': … … 1549 1556 dXT = np.inner(sop[0],dXT.T) 1550 1557 dXT = np.swapaxes(dXT,1,2) 1551 # dXT = dXT[:,:,np.argsort(tauT)] 1558 dXT[:,:3,:] *= ssdet 1552 1559 dXTP.append(dXT) 1553 1560 if waveType == 'Fourier': 1554 for i in range(3): 1555 if np.allclose(dX[i,i,:],dXT[i,i,:]): 1556 xsc[i] = 1 1557 else: 1558 xsc[i] = 0 1559 if np.allclose(dX[i,i+3,:],dXT[i,i+3,:]): 1560 xsc[i+3] = 1 1561 else: 1562 xsc[i+3] = 0 1561 if np.any(dtau%.5) and ('1/2' in SSGData['modSymb'] or '1' in SSGData['modSymb']): 1562 dt = sdet*dT**sdet 1563 CSI['Spos'] = [[[1,0,0],[2,0,0],[3,0,0], [1,0,0],[2,0,0],[3,0,0]], 1564 [[1.,0.,0.],[1.,0.,0.],[1.,0.,0.], [1.,0.,0.],[1.,0.,0.],[1.,0.,0.]]] 1565 if '(x)' in siteSym: 1566 CSI['Spos'][1][3:] = [1./dt,0.,0.],[dt,0.,0.],[dt,0.,0.] 1567 elif '(y)' in siteSym: 1568 CSI['Spos'][1][3:] = [dt,0.,0.],[1./dt,0.,0.],[dt,0.,0.] 1569 elif '(z)' in siteSym: 1570 CSI['Spos'][1][3:] = [dt,0.,0.],[dt,0.,0.],[1./dt,0.,0.] 1571 else: 1572 for i in range(3): 1573 if np.allclose(dX[i,i,:],dXT[i,i,:]*sdet): 1574 xsc[i] = 1 1575 else: 1576 xsc[i] = 0 1577 if np.allclose(dX[i,i+3,:],dXT[i,i+3,:]): 1578 xsc[i+3] = 1 1579 else: 1580 xsc[i+3] = 0 1563 1581 XSC &= xsc 1564 1582 1565 1583 fsc = np.ones(2,dtype='i') 1566 vfsc = np.ones(2)1567 1584 if 'Crenel' in waveType: 1568 1585 dFT = fracCrenel(tauT,delt2[:1],delt2[1:]).squeeze() 1586 fsc = [1,1] 1569 1587 else: 1570 1588 dFT = fracFourier(tauT,nH,delt2[:1],delt2[1:]).squeeze() 1571 dFT = nl.det(sop[0])*dFT 1572 dFT = dFT[:,np.argsort(tauT)] 1573 dFTP.append(dFT) 1574 for i in range(2): 1575 if np.allclose(dF[i,:],dFT[i,:],atol=1.e6): 1576 fsc[i] = 1 1577 vfsc[i] = 1.0 1589 dFT = nl.det(sop[0])*dFT 1590 dFT = dFT[:,np.argsort(tauT)] 1591 dFT[0] *= ssdet 1592 dFT[1] *= sdet 1593 dFTP.append(dFT) 1594 1595 if np.any(dtau%.5) and ('1/2' in SSGData['modSymb'] or '1' in SSGData['modSymb']): 1596 dt = dT #**sdet 1597 fsc = [1,1] 1598 CSI['Sfrac'] = [[[1,0],[1,0]],[[1.,0.],[1/dt,0.]]] 1578 1599 else: 1579 fsc[i] = 0 1580 vfsc[i] = 0. 1600 for i in range(2): 1601 if np.allclose(dF[i,:],dFT[i,:],atol=1.e6): 1602 fsc[i] = 1 1603 else: 1604 fsc[i] = 0 1581 1605 FSC &= fsc 1582 VFSC = vfsc1583 1606 1584 1607 usc = np.ones(12,dtype='i') … … 1589 1612 dUT = np.array(U2Uij(dUijT)) 1590 1613 dUT = dUT[:,:,np.argsort(tauT)] 1614 dUT[:,:6,:] *= ssdet*sdet 1591 1615 dUTP.append(dUT) 1592 for i in range(6): 1593 if np.allclose(dU[i,i,:],dUT[i,i,:]): 1594 usc[i] = 1 1616 if np.any(dtau%.5) and ('1/2' in SSGData['modSymb'] or '1' in SSGData['modSymb']): 1617 dt = dT #**sdet 1618 CSI['Sadp'] = [[[1,0,0],[2,0,0],[3,0,0],[4,0,0],[5,0,0],[6,0,0], 1619 [1,0,0],[2,0,0],[3,0,0],[4,0,0],[5,0,0],[6,0,0]], 1620 [[1.,0.,0.],[1.,0.,0.],[1.,0.,0.], [1.,0.,0.],[1.,0.,0.],[1.,0.,0.], 1621 [1./dt,0.,0.],[1./dt,0.,0.],[1./dt,0.,0.], [1.,0.,0.],[1.,0.,0.],[1.,0.,0.]]] 1622 if '(x)' in siteSym: 1623 CSI['Sadp'][1][9:] = [dt,0.,0.],[dt,0.,0.],[1./dt,0.,0.] 1624 elif '(y)' in siteSym: 1625 CSI['Sadp'][1][9:] = [dt,0.,0.],[1./dt,0.,0.],[dt,0.,0.] 1626 elif '(z)' in siteSym: 1627 CSI['Sadp'][1][9:] = [1./dt,0.,0.],[dt,0.,0.],[dt,0.,0.] 1628 else: 1629 for i in range(6): 1630 if np.allclose(dU[i,i,:],dUT[i,i,:]): 1631 usc[i] = 1 1632 else: 1633 usc[i] = 0 1634 if np.allclose(dU[i,i+6,:],dUT[i,i+6,:]): 1635 usc[i+6] = 1 1636 else: 1637 usc[i+6] = 0 1638 USC &= usc 1639 if not np.any(dtau%.5): 1640 n = 1 1641 for i,U in enumerate(USC): 1642 if U: 1643 n += 1 1644 CSI['Sadp'][0][i][0] = n+1 1645 CSI['Sadp'][1][i][0] = 1.0 1646 if waveType == 'Fourier': 1647 n = 1 1648 for i,X in enumerate(XSC): 1649 if X: 1650 n += 1 1651 CSI['Spos'][0][i][0] = n+1 1652 CSI['Spos'][1][i][0] = 1.0 1653 n = 1 1654 for i,F in enumerate(FSC): 1655 if F: 1656 n += 1 1657 CSI['Sfrac'][0][i] = n+1 1658 CSI['Sfrac'][1][i] = 1.0 1595 1659 else: 1596 usc[i] = 0 1597 if np.allclose(dU[i,i+6,:],dUT[i,i+6,:]): 1598 usc[i+6] = 1 1599 else: 1600 usc[i+6] = 0 1601 USC &= usc 1602 n = 1 1603 for i,U in enumerate(USC): 1604 if U: 1605 n += 1 1606 CSI['Sadp'][0][i][0] = n+1 1607 CSI['Sadp'][1][i][0] = 1.0 1608 if waveType == 'Fourier': 1609 n = 1 1610 for i,X in enumerate(XSC): 1611 if X: 1612 n += 1 1613 CSI['Spos'][0][i][0] = n+1 1614 CSI['Spos'][1][i][0] = 1.0 1615 n = 1 1616 for i,[F,VF] in enumerate(zip(FSC,VFSC)): 1617 if F: 1618 n += 1 1619 CSI['Sfrac'][0][i] = n+1 1620 CSI['Sfrac'][1][i] = VF 1621 else: 1622 CSI['Sfrac'][0][i] = 0 1623 CSI['Sfrac'][1][i] = 0. 1660 CSI['Sfrac'][0][i] = 0 1661 CSI['Sfrac'][1][i] = 0. 1624 1662 if debug: 1625 1663 return CSI,[tau,tauT],[dF,dFTP],[dX,dXTP],[dU,dUTP]
Note: See TracChangeset
for help on using the changeset viewer.