Changeset 5362
- Timestamp:
- Nov 3, 2022 8:16:02 PM (11 months ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIdataGUI.py
r5342 r5362 6544 6544 'Make new phase from selected unit cell') 6545 6545 self.ExportCells = self.IndexEdit.Append(G2G.wxID_EXPORTCELLS,'Export cell list','Export cell list to csv file') 6546 G2G.Define_wxId('wxID_SHOWGENHKLS') 6547 self.IndexEdit.Append(G2G.wxID_SHOWGENHKLS,'Show reflections','Show generated reflection positions on console') 6546 6548 self.PostfillDataMenu() 6547 6549 self.LoadCell.Enable(False) -
trunk/GSASIIpwd.py
r5361 r5362 2127 2127 def getHeaderInfo(dataType): 2128 2128 '''Provide parameter name, label name and formatting information for the 2129 contents of the peak table and where used in DoPeakFit2129 contents of the Peak Table and where used in DoPeakFit 2130 2130 ''' 2131 2131 names = ['pos','int'] 2132 2132 lnames = ['position','intensity'] 2133 2133 if 'LF' in dataType: 2134 names = ['int','sig','gam','damp','asym','l'] 2135 lnames = ['intensity','sigma','gamma','satellite\ndamping','satellite\nasym','00l'] 2136 fmt = ["%10.2f","%10.3f","%10.3f","%10.3f","%10.3f","%4d"] 2134 names = ['int','sig','gam','damp','asym','l','ttheta'] 2135 lnames = ['intensity','sigma','gamma','satellite\ndamping', 2136 'satellite\nasym','00l', 2137 #'2theta ' 2138 '2\u03B8' 2139 ] 2140 fmt = ["%10.2f","%10.3f","%10.3f","%10.3f","%10.3f","%4d","%7.3f"] 2137 2141 elif 'C' in dataType: 2138 2142 names += ['sig','gam'] … … 2346 2350 peakVary = [] 2347 2351 names,_,_ = getHeaderInfo(dataType) 2348 off = 0 2349 if 'LF' in dataType: off = 2 2352 if 'LF' in dataType: 2353 off = 2 2354 names = names[:-1] # drop 2nd 2theta value 2355 else: 2356 off = 0 2350 2357 for i,peak in enumerate(Peaks): 2351 2358 if type(peak) is dict: … … 2363 2370 the parmDict array 2364 2371 ''' 2372 names,_,_ = getHeaderInfo(Inst['Type'][0]) 2365 2373 off = 0 2366 2374 if 'LF' in Inst['Type'][0]: … … 2368 2376 if 'clat' in varyList: 2369 2377 Peaks[-1]['clat'] = parmDict['clat'] 2370 names,_,_ = getHeaderInfo(Inst['Type'][0])2378 names = names[:-1] # drop 2nd 2theta value 2371 2379 for i,peak in enumerate(Peaks): 2372 2380 if type(peak) is dict: … … 2378 2386 if 'pos'+str(i) not in parmDict: continue 2379 2387 pos = parmDict['pos'+str(i)] 2380 if 'LF' in Inst['Type'][0]: peak[0] = pos 2388 if 'LF' in Inst['Type'][0]: 2389 peak[0] = pos 2390 peak[-1] = pos 2381 2391 if 'difC' in Inst: 2382 2392 dsp = pos/Inst['difC'][1] … … 2414 2424 head = 13*' ' 2415 2425 for name in names: 2416 if name in ['alp','bet']: 2426 if name == 'l': 2427 head += name.center(3)+' ' 2428 elif name == 'ttheta': 2429 continue 2430 elif name in ['alp','bet']: 2417 2431 head += name.center(8)+'esd'.center(8) 2418 2432 else: … … 2428 2442 name = names[j] 2429 2443 parName = name+str(i) 2444 if parName not in parmDict: continue 2430 2445 ptstr += ptfmt[name] % (parmDict[parName]) 2431 2446 if parName in varyList: … … 5323 5338 w[len(w)//2:] = w2[len(w)//2:] 5324 5339 weqdiv = w * np.sin(Qs * ncell * co2)**2 / (np.sin(Qs * co2)**2) 5340 weqdiv[:np.searchsorted(Qs,posQ - np.pi/self.param_dicts[me]['clat'])] = 0 # isolate central peak, if needed 5341 weqdiv[np.searchsorted(Qs,posQ + np.pi/self.param_dicts[me]['clat']):] = 0 5325 5342 conv = FP.best_rfft(weqdiv) 5326 5343 conv[1::2] *= -1 #flip center -
trunk/GSASIIpwdGUI.py
r5360 r5362 1122 1122 for i in range(len(data['LFpeaks'])): 1123 1123 data['peaks'][i][2:] = data['LFpeaks'][i] 1124 wx.CallAfter(UpdatePeakGrid,G2frame,data) 1124 1125 if data['peaks']: 1125 1126 OnPeakFit(noFit=True) … … 1131 1132 state = G2frame.dataWindow.setPeakMode.IsChecked() 1132 1133 G2pwd.setPeakInstPrmMode(state) 1134 1135 def ShiftLFc(event): 1136 '''Shift the Laue Fringe lattice parameter 1137 ''' 1138 Obj = event.GetEventObject() 1139 move = Obj.GetValue() 1140 Obj.SetValue(0) 1141 data['LaueFringe']['clat'] *= 1. + move/2000. 1142 wx.CallAfter(RefreshPeakGrid,None) 1133 1143 1134 1144 #====================================================================== … … 1166 1176 PatternId = G2frame.PatternId 1167 1177 Inst = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,PatternId, 'Instrument Parameters'))[0] 1178 # Create the header on the Peak Table 1168 1179 for i in range(len(data['peaks'])): rowLabels.append(str(i+1)) 1169 1180 colLabels = [] … … 1171 1182 for _,f,l in zip(*G2pwd.getHeaderInfo(Inst['Type'][0])): 1172 1183 colLabels.append(l) 1173 if "d" in f: 1184 if l.startswith('2'): 1185 Types.append(wg.GRID_VALUE_FLOAT + ':7,3') 1186 elif "d" in f: 1174 1187 Types.append(wg.GRID_VALUE_NUMBER) 1175 1188 else: … … 1210 1223 data['peaks'][i][0] = 360 * np.arcsin(0.5 * lam / (data['LaueFringe']['clat']/l)) / np.pi 1211 1224 data['peaks'][i] += [0., False, 0., False, l, None] 1212 data['LFpeaks'].append(data['peaks'][i][2:]) 1225 peakline = copy.deepcopy(data['peaks'][i][2:]) 1226 peakline[-1] = data['peaks'][i][0] 1227 data['LFpeaks'].append(peakline) 1213 1228 G2frame.PeakTable = G2G.Table(data['LFpeaks'],rowLabels=rowLabels,colLabels=colLabels,types=Types) 1214 1229 else: … … 1241 1256 data['LaueFringe']['Show'] = data['LaueFringe'].get('Show',0) 1242 1257 cVal = G2G.ValidatedTxtCtrl(G2frame.dataWindow,data['LaueFringe'],'clat', 1243 typeHint=float,nDig=(10,4), 1258 typeHint=float,nDig=(10,4),size=(80,-1), 1244 1259 OnLeave=lambda *arg,**kw:RefreshPeakGrid(None)) 1245 1260 topSizer.Add(cVal,0,WACV) 1261 cellSpin = wx.SpinButton(G2frame.dataWindow,style=wx.SP_VERTICAL,size=wx.Size(20,20)) 1262 cellSpin.SetValue(0) 1263 cellSpin.SetRange(-1,1) 1264 cellSpin.Bind(wx.EVT_SPIN, ShiftLFc) 1265 topSizer.Add(cellSpin,0,WACV) 1246 1266 cRef = G2G.G2CheckBox(G2frame.dataWindow,'ref',data['LaueFringe'],'clat-ref') 1247 1267 topSizer.Add(cRef,0,WACV) … … 3639 3659 finally: 3640 3660 dlg.Destroy() 3641 3661 3662 def OnShowGenRefls(event): 3663 '''Generate the reflections from the unit cell and 3664 display them in the console window 3665 ''' 3666 OnHklShow(None) 3667 for r in G2frame.HKL: 3668 print("{0:.0f},{1:.0f},{2:.0f} 2\u03B8={4:7.3f} d={3:8.4f}".format(*r)) 3669 3642 3670 def OnCellChange(invalid,value,tc): 3643 3671 if invalid: … … 4602 4630 G2frame.Bind(wx.EVT_MENU, MakeNewPhase, id=G2G.wxID_MAKENEWPHASE) 4603 4631 G2frame.Bind(wx.EVT_MENU, OnExportCells, id=G2G.wxID_EXPORTCELLS) 4632 G2frame.Bind(wx.EVT_MENU, OnShowGenRefls, id=G2G.wxID_SHOWGENHKLS) 4604 4633 4605 4634 if len(data) < 6: -
trunk/docs/source/packages.rst
r5360 r5362 141 141 142 142 **DIFFaX** 143 Simulate layered structures with faulting 144 145 **CifFile** 146 A software library used to read data and structures from CIF 143 Simulate layered structures with faulting. https://www.public.asu.edu/~mtreacy/DIFFaX.html 144 145 **PyCifRW** 146 A software library used to read data and structures from 147 CIF. https://bitbucket.org/jamesrhester/pycifrw 148 147 149 148 150 **Shapes** 149 Model small angle scattering with shaped particles 151 Model small angle scattering with shaped particles. 150 152 151 153 **NIST FPA**
Note: See TracChangeset
for help on using the changeset viewer.