- Timestamp:
- Mar 1, 2020 1:19:50 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIdataGUI.py
r4333 r4334 4267 4267 'Save S(Q), G(R),... as selected by user' 4268 4268 def PDFSave(G2frame,exports,PDFsaves): 4269 'Save a PDF I(Q), S(Q), F(Q) and G(r) in column formats'4269 'Save a PDF I(Q), S(Q), F(Q), G(r) and g(r) in column formats' 4270 4270 if len(exports) > 1: 4271 4271 dirname = G2G.askSaveDirectory(G2frame) … … 4273 4273 else: 4274 4274 defnam = exports[0].replace(' ','_')[5:] 4275 filename = G2G.askSaveFile(G2frame,defnam,'.gr', 4276 'G(r) file, etc.') 4275 filename = G2G.askSaveFile(G2frame,defnam,'.gr','G(r) file, etc.') 4277 4276 if not filename: return 4278 4277 dirname,filename = os.path.split(filename) … … 4300 4299 od = {'label_1':'Export I(Q)','value_1':False,'label_2':'Export S(Q)','value_2':False, 4301 4300 'label_3':'Export F(Q)','value_3':False,'label_4':'Export G(R)','value_4':True, 4302 'label_5':'Make G(R) for pdfGUI','value_5':False} 4301 'label_5':'Make G(R) for pdfGUI','value_5':False, 4302 'label_6':'Make F(Q) & g(r) for RMCProfile','value_6':False} 4303 4303 dlg = G2G.G2MultiChoiceDialog(self,'Select','PDF patterns to export',names,extraOpts=od) 4304 4304 if dlg.ShowModal() == wx.ID_OK: … … 4308 4308 dlg.Destroy() 4309 4309 if exports: 4310 PDFsaves = [od['value_1'],od['value_2'],od['value_3'],od['value_4'],od['value_5'] ]4310 PDFsaves = [od['value_1'],od['value_2'],od['value_3'],od['value_4'],od['value_5'],od['value_6']] 4311 4311 PDFSave(self,exports,PDFsaves) 4312 4312 -
trunk/GSASIIfiles.py
r4195 r4334 905 905 PDFsaves[2], if True writes a F(Q) file with a .fq extension 906 906 PDFsaves[3], if True writes a G(r) file with a .gr extension 907 PDFsaves[4], if True writes G(r) in a pdfGUI input file with 907 PDFsaves[4], if True writes G(r) in a pdfGUI input file with 908 908 a .gr extension. Note that if PDFsaves[3] and PDFsaves[4] are 909 909 both True, the pdfGUI overwrites the G(r) file. 910 PDFsaves[5], if True writes F(Q) & g(R) with .fq & .gr extensions 911 overwrites these if selected by option 2, 3 or 4 910 912 :param dict PDFControls: The PDF parameters and computed results 911 913 :param dict Inst: Instrument parameters from the PDWR entry used … … 1029 1031 grfile.close() 1030 1032 G2Print (' G(R) saved to: '+grfilename) 1033 1034 if PDFsaves[5]: #RMCProfile files for F(Q) & g(r) overwrites any above 1035 1036 fqfilename = fileroot+'.fq' 1037 fqdata = PDFControls['F(Q)'][1] 1038 fqfxn = scintp.interp1d(fqdata[0],fqdata[1],kind='linear') 1039 fqfile = open(fqfilename,'w') 1040 qnew = np.arange(fqdata[0][0],fqdata[0][-1],0.005) 1041 nq = qnew.shape[0] 1042 fqfile.write('%20d\n'%nq-1) 1043 fqfile.write(fqfilename+'\n') 1044 fqnew = zip(qnew,fqfxn(qnew)) 1045 for q,fq in fqnew[1:]: 1046 fqfile.write("%15.6g %15.6g\n" % (q,fq)) 1047 fqfile.close() 1048 G2Print (' F(Q) saved to: '+fqfilename) 1049 1050 grfilename = fileroot+'.gr' 1051 grdata = PDFControls['g(r)'][1] 1052 grfxn = scintp.interp1d(grdata[0],grdata[1],kind='linear') 1053 grfile = open(grfilename,'w') 1054 rnew = np.arange(grdata[0][0],grdata[0][-1],0.010) 1055 nr = rnew.shape[0] 1056 grfile.write('%20d\n'%nr-1) 1057 grfile.write(grfilename+'\n') 1058 grnew = zip(rnew,grfxn(rnew)) 1059 for r,gr in grnew[1:]: 1060 grfile.write("%15.6g %15.6g\n" % (r,gr)) 1061 grfile.close() 1062 G2Print (' G(R) saved to: '+grfilename) 1063 -
trunk/GSASIIphsGUI.py
r4330 r4334 5320 5320 if os.path.isfile(pName+'.his6f'): 5321 5321 os.remove(pName+'.his6f') 5322 if os.path.isfile(pName+'.xray'): 5323 os.remove(pName+'.xray') 5322 5324 if os.path.isfile(pName+'.neigh'): 5323 5325 os.remove(pName+'.neigh') -
trunk/GSASIIplot.py
r4328 r4334 4438 4438 if not plotType: 4439 4439 plotType = G2frame.G2plotNB.plotList[G2frame.G2plotNB.nb.GetSelection()] 4440 if plotType not in ['I(Q)','S(Q)','F(Q)','G(R)',' delt-G(R)']:4440 if plotType not in ['I(Q)','S(Q)','F(Q)','G(R)','g(r)','delt-G(R)']: 4441 4441 return 4442 4442 … … 4675 4675 PlotList.append(Pattern[plotType]) 4676 4676 name = plotType 4677 if plotType == 'G(R)':4677 if plotType in ['G(R)','g(r)']: 4678 4678 Plot.set_xlabel(r'r,$\AA$',fontsize=14) 4679 Plot.set_ylabel(r' G(r), $\AA^{-2}$',fontsize=14)4679 Plot.set_ylabel(r'%s, $\AA^{-2}$'%plotType,fontsize=14) 4680 4680 if lim is not None: 4681 4681 lim[0] = list([lim[0][0],data['Rmax']]) … … 4786 4786 wx.EndBusyCursor() 4787 4787 if plotType == 'G(R)' and numbDen: 4788 Xb = [0., 2.5]4789 Yb = [0.,- 10.*np.pi*numbDen]4788 Xb = [0.,5.] 4789 Yb = [0.,-20.*np.pi*numbDen] 4790 4790 Plot.plot(Xb,Yb,color='k',dashes=(5,5)) 4791 4791 Plot.set_xlim([0.,PDFdata['Rmax']]) 4792 4792 elif plotType == 'F(Q)': 4793 Xb = [0.,5.0] 4794 Yb = [0.,-20.*np.pi*numbDen] 4795 Plot.plot(Xb,Yb,color='k',dashes=(5,5)) 4793 4796 Plot.axhline(0.,color='k') 4794 4797 elif plotType == 'S(Q)': -
trunk/GSASIIpwd.py
r4333 r4334 403 403 xydata['FofQ'][1][1] *= LorchWeight(Q) 404 404 xydata['GofR'] = copy.deepcopy(xydata['FofQ']) 405 xydata['gofr'] = copy.deepcopy(xydata['FofQ']) 405 406 nR = len(xydata['GofR'][1][1]) 406 407 Rmax = GSASIIpath.GetConfigValue('PDF_Rmax',100.) … … 409 410 R = 2.*np.pi*np.linspace(0,nR,nR,endpoint=True)/(mul*qLimits[1]) 410 411 xydata['GofR'][1][0] = R 412 xydata['gofr'][1][0] = R 411 413 GR = -dq*np.imag(fft.fft(xydata['FofQ'][1][1],mul*nR)[:nR]) 412 414 xydata['GofR'][1][1] = GR 413 # gr = GR/(4.*np.pi*R) 414 # auxPlot.append([R,gr,'g(r)']) 415 gr = GR/(np.pi*R) 416 xydata['gofr'][1][1] = gr 417 numbDen = 0. 418 if 'ElList' in data: 419 numbDen = GetNumDensity(data['ElList'],data['Form Vol']) 415 420 if data.get('noRing',True): 416 xydata['GofR'][1][1] = np.where(xydata['GofR'][1][0]<0.5,0.,xydata['GofR'][1][1]) 421 Rmin = data['Rmin'] 422 xydata['gofr'][1][1] = np.where(R<Rmin,-4.*numbDen,xydata['gofr'][1][1]) 423 xydata['GofR'][1][1] = np.where(R<Rmin,-4.*R*np.pi*numbDen,xydata['GofR'][1][1]) 417 424 return auxPlot 418 425 … … 2279 2286 Sample = PWDdata['Sample Parameters'] 2280 2287 Scale = Sample['Scale'][0] 2281 if 'X' in Inst['Type'][0]:2282 Scale *= 2.2283 2288 Limits = PWDdata['Limits'][1] 2284 2289 Ibeg = np.searchsorted(Data[0],Limits[0]) -
trunk/GSASIIpwdGUI.py
r4324 r4334 6765 6765 data['F(Q)'] = xydata['FofQ'] 6766 6766 data['G(R)'] = xydata['GofR'] 6767 data['g(r)'] = xydata['gofr'] 6767 6768 return auxPlot 6768 6769 … … 7314 7315 G2plt.PlotISFG(G2frame,data,newPlot=True,plotType='F(Q)') 7315 7316 G2plt.PlotISFG(G2frame,data,newPlot=True,plotType='G(R)') 7317 G2plt.PlotISFG(G2frame,data,newPlot=True,plotType='g(r)') 7316 7318 else: 7317 7319 G2plt.PlotISFG(G2frame,data,newPlot=True) … … 7384 7386 G2plt.PlotISFG(G2frame,data,newPlot=True,plotType='F(Q)') 7385 7387 G2plt.PlotISFG(G2frame,data,newPlot=True,plotType='G(R)') 7388 G2plt.PlotISFG(G2frame,data,newPlot=True,plotType='g(r)') 7386 7389 7387 7390 # Routine UpdatePDFGrid starts here -
trunk/GSASIIscriptable.py
r4327 r4334 2579 2579 self.names.append([PDFname]+['PDF Controls', 'PDF Peaks']) 2580 2580 self.data[PDFname] = PDFdict 2581 for i in 'I(Q)','S(Q)','F(Q)','G(R)' :2581 for i in 'I(Q)','S(Q)','F(Q)','G(R)','g(r)': 2582 2582 self.data[PDFname]['PDF Controls'][i] = [] 2583 2583 G2fil.G2Print('Adding "{}" to project'.format(PDFname)) … … 2608 2608 'DetType':'Area detector','ObliqCoeff':0.2,'Ruland':0.025,'QScaleLim':[20,25], 2609 2609 'Lorch':False,'BackRatio':0.0,'Rmax':100.,'noRing':False,'IofQmin':1.0,'Rmin':1.0, 2610 'I(Q)':[],'S(Q)':[],'F(Q)':[],'G(R)':[] }2610 'I(Q)':[],'S(Q)':[],'F(Q)':[],'G(R)':[],'g(r)':[]} 2611 2611 2612 2612 fo = open(prmfile,'r') … … 5276 5276 data['F(Q)'] = xydata['FofQ'] 5277 5277 data['G(R)'] = xydata['GofR'] 5278 data['g(r)'] = xydata['gofr'] 5278 5279 5279 5280 def optimize(self,showFit=True,maxCycles=5,
Note: See TracChangeset
for help on using the changeset viewer.