Changeset 4334 for trunk/GSASIIfiles.py


Ignore:
Timestamp:
Mar 1, 2020 1:19:50 AM (20 months ago)
Author:
vondreele
Message:

make new f(q) & g(r) files suitable for RMCProfile. The g(r) == PDF.
Fix 2X issue in xray scale factor for .bragg files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIfiles.py

    r4195 r4334  
    905905      PDFsaves[2], if True writes a F(Q) file with a .fq extension
    906906      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
    908908      a .gr extension. Note that if PDFsaves[3] and PDFsaves[4] are
    909909      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
    910912    :param dict PDFControls: The PDF parameters and computed results
    911913    :param dict Inst: Instrument parameters from the PDWR entry used
     
    10291031        grfile.close()
    10301032        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
Note: See TracChangeset for help on using the changeset viewer.