Changeset 5060
- Timestamp:
- Oct 31, 2021 8:44:30 AM (2 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIImath.py
r5058 r5060 2073 2073 ''' Applies ISODISTORT mode displacements to drawing atoms 2074 2074 ''' 2075 return 2076 # generalData = data['General'] 2077 # cell = generalData['Cell'][1:7] 2078 # G,g = G2lat.cell2Gmat(cell) 2079 # SGData = generalData['SGData'] 2080 # cx,ct,cs,cia = getAtomPtrs(data) 2081 # drawingData = data['Drawing'] 2082 # dcx,dct,dcs,dci = getAtomPtrs(data,True) 2083 # atoms = data['Atoms'] 2084 # drawAtoms = drawingData['Atoms'] 2085 # for atom in atoms: 2086 # atxyz = np.array(atom[cx:cx+3]) 2087 # indx = FindAtomIndexByIDs(drawAtoms,dci,[atom[cia+8],],True) 2088 # for ind in indx: 2089 # drawatom = drawAtoms[ind] 2090 # opr = drawatom[dcs-1] 2091 # X = G2spc.ApplyStringOps(opr,SGData,atxyz+wave) 2092 # drawatom[dcx:dcx+3] = X 2075 generalData = data['General'] 2076 Atoms= data['Atoms'] 2077 ISOdata = data['ISODISTORT'] 2078 modeDisp = np.array(ISOdata['modeDispl']) 2079 mode2var = np.array(ISOdata['Mode2VarMatrix']) 2080 varDisp = np.sum(mode2var*modeDisp,axis=1) 2081 vardict = dict(zip(ISOdata['IsoVarList'],varDisp)) 2082 cell = generalData['Cell'][1:7] 2083 G,g = G2lat.cell2Gmat(cell) 2084 SGData = generalData['SGData'] 2085 cx,ct,cs,cia = getAtomPtrs(data) 2086 atNames = [atm[ct-1] for atm in Atoms] 2087 parNames = [[atName+'_dx',atName+'_dy',atName+'_dz',] for atName in atNames] 2088 if data['Drawing']: 2089 drawingData = data['Drawing'] 2090 dcx,dct,dcs,dci = getAtomPtrs(data,True) 2091 atoms = data['Atoms'] 2092 drawAtoms = drawingData['Atoms'] 2093 for iat,atom in enumerate(atoms): 2094 atxyz = np.array(atom[cx:cx+3]) 2095 displ = np.zeros(3) 2096 for ip,parm in enumerate(parNames[iat]): 2097 if parm in vardict: 2098 displ[ip] = vardict[parm] 2099 indx = FindAtomIndexByIDs(drawAtoms,dci,[atom[cia+8],],True) 2100 for ind in indx: 2101 drawatom = drawAtoms[ind] 2102 opr = drawatom[dcs-1] 2103 X = G2spc.ApplyStringOps(opr,SGData,atxyz+displ) 2104 drawatom[dcx:dcx+3] = X 2105 return None 2106 else: 2107 return 'Draw structure first' 2093 2108 2094 2109 -
trunk/GSASIIphsGUI.py
r5059 r5060 6652 6652 modeDisp[idsp] = (Obj.GetValue()-100)/1000. 6653 6653 dispVal.SetValue(modeDisp[idsp]) 6654 G2mth.ApplyModeDisp(data) 6654 err = G2mth.ApplyModeDisp(data) 6655 if err: 6656 G2G.G2MessageBox(G2frame,'Do Draw atoms first') 6655 6657 G2plt.PlotStructure(G2frame,data) 6656 6658 … … 6658 6660 idsp,displ = Indx[tc.GetId()] 6659 6661 displ.SetValue(int(value*1000)+100) 6660 G2mth.ApplyModeDisp(data) 6662 err = G2mth.ApplyModeDisp(data) 6663 if err: 6664 G2G.G2MessageBox(G2frame,'Do Draw atoms first') 6661 6665 G2plt.PlotStructure(G2frame,data) 6662 6666 6663 6667 def OnReset(event): 6664 6668 data['ISODISTORT']['modeDispl'] = np.zeros(len(data['ISODISTORT']['G2ModeList'])) 6665 G2mth.ApplyModeDisp(data) 6669 err = G2mth.ApplyModeDisp(data) 6670 if err: 6671 G2G.G2MessageBox(G2frame,'Do Draw atoms first') 6666 6672 G2plt.PlotStructure(G2frame,data) 6667 6673 UpdateISODISTORT() … … 6678 6684 data['ISODISTORT']['modeDispl'] = np.zeros(len(data['ISODISTORT']['G2ModeList'])) 6679 6685 #end patch 6686 if ISODIST.GetSizer(): 6687 ISODIST.GetSizer().Clear(True) 6680 6688 mainSizer = wx.BoxSizer(wx.VERTICAL) 6681 6689 topSizer = wx.BoxSizer(wx.VERTICAL)
Note: See TracChangeset
for help on using the changeset viewer.