Changeset 4220 for trunk/GSASIIpwd.py


Ignore:
Timestamp:
Dec 21, 2019 6:41:42 AM (22 months ago)
Author:
vondreele
Message:

swap order of binds in ValidatedTextCtrl? - might work better?routines
enhancements to RMCProfile file preparation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwd.py

    r4210 r4220  
    22432243    return fname
    22442244
    2245 def MakeRMCPdat(G2frame,Name,Phase,Meta,Atseq,Supercell,Files,PWId):
    2246     fname = Name+'.testdat'
     2245def MakeRMCPdat(G2frame,Name,Phase,Meta,Atseq,Atypes,atPairs,Supercell,Files,PWId,BraggWt):
     2246    PWDdata = G2frame.GetPWDRdatafromTree(PWId)
     2247    inst = PWDdata['Instrument Parameters'][0]
     2248    refList = PWDdata['Reflection Lists'][Name]['RefList']
     2249    dMin = refList[-1][4]
     2250    gsasType = 'xray2'
     2251    if 'T' in inst['Type'][1]:
     2252        gsasType = 'gsas3'
     2253    elif 'X' in inst['Type'][1]:
     2254        XFF = G2elem.GetFFtable(Atseq)
     2255        Xfl = open(Name+'.xray','w')
     2256        for atm in Atseq:
     2257            fa = XFF[atm]['fa']
     2258            fb = XFF[atm]['fb']
     2259            fc = XFF[atm]['fc']
     2260            Xfl.write('%2s  %8.4f%8.4f%8.4f%8.4f%8.4f%8.4f%8.4f%8.4f%8.4f\n'%(
     2261                    atm.upper(),fa[0],fb[0],fa[1],fb[1],fa[2],fb[2],fa[3],fb[3],fc))
     2262        Xfl.close()
     2263    lenA = len(Atseq)
     2264    Pairs = []
     2265    for pair in [[' %s-%s'%(Atseq[i],Atseq[j]) for j in range(i,lenA)] for i in range(lenA)]:
     2266        Pairs += pair
     2267    pairMin = [atPairs[pair] for pair in Pairs]
     2268    maxMoves = [Atypes[atm] for atm in Atseq]
     2269    fname = Name+'.dat'
    22472270    fl = open(fname,'w')
     2271    fl.write(' %% hand edit the following as needed\n')
    22482272    fl.write('TITLE :: '+Name+'\n')
    22492273    fl.write('MATERIAL :: '+Meta['material']+'\n')
     
    22512275    fl.write('TEMPERATURE :: '+str(Meta['temperature'])+'\n')
    22522276    fl.write('INVESTIGATOR :: '+Meta['owner']+'\n')
    2253     fl.write(' %% edit the following as needed\n')
    2254     fl.write('MINIMUM_DISTANCES ::   4.00  1.37  2.0    Angstrom\n')
    2255     fl.write('MAXIMUM_MOVES ::   0.05  0.10 Angstrom\n')
     2277    minD = ' '.join(['%6.3f'%dist for dist in pairMin])
     2278    fl.write('MINIMUM_DISTANCES ::   %s  Angstrom\n'%minD)
     2279    maxMv = ' '.join(['%6.3f'%mov for mov in maxMoves])
     2280    fl.write('MAXIMUM_MOVES ::   %s Angstrom\n'%maxMv)
    22562281    fl.write('R_SPACING ::  0.0200 Angstrom\n')
    22572282    fl.write('PRINT_PERIOD :: 100\n')
    22582283    fl.write('TIME_LIMIT ::     10.00 MINUTES\n')
    22592284    fl.write('SAVE_PERIOD ::     1.00 MINUTES\n')
     2285    fl.write('\n')
    22602286    fl.write('ATOMS :: '+' '.join(Atseq)+'\n')
     2287    fl.write('\n')
    22612288    fl.write('FLAGS ::\n')
    22622289    fl.write('  > NO_MOVEOUT\n')
    22632290    fl.write('  > NO_SAVE_CONFIGURATIONS\n')
    22642291    fl.write('  > NO_RESOLUTION_CONVOLUTION\n')
     2292    fl.write('\n')
    22652293    fl.write('INPUT_CONFIGURATION_FORMAT ::  rmc6f\n')
    22662294    fl.write('SAVE_CONFIGURATION_FORMAT  ::  rmc6f\n')
    2267    
    2268    
    2269    
    2270    
     2295    for File in Files:
     2296        if Files[File][0]:
     2297            fl.write('\n')
     2298            fl.write('%s ::\n'%File.split(';')[0].upper().replace(' ','_'))
     2299            fl.write('  > FILENAME :: %s\n'%Files[File][0])
     2300            fl.write('  > DATA_TYPE :: %s\n'%Files[File][2])
     2301            fl.write('  > FIT_TYPE :: %s\n'%Files[File][2])
     2302            fl.write('  > START_POINT :: 1\n')
     2303            fl.write('  > END_POINT :: 3000\n')
     2304            fl.write('  > CONSTANT_OFFSET 0.000\n')
     2305            fl.write('  > WEIGHT :: %.4f\n'%Files[File][1])
     2306            if 'reciprocal' in File:
     2307                fl.write('  > CONVOLVE ::\n')
     2308                fl.write('  > NO_FITTED_SCALE\n')
     2309            fl.write('  > NO_FITTED_OFFSET\n')
     2310            if Files[File][3] !='RMC':
     2311                fl.write('  > %s\n'%Files[File][3])
     2312    fl.write('BRAGG ::\n')
     2313    fl.write('  > BRAGG_SHAPE :: %s\n'%gsasType)
     2314    fl.write('  > RECALCUATE\n')
     2315    fl.write('  > DMIN :: %.2f\n'%(dMin-0.02))
     2316    fl.write('  > WEIGHT :: %10.3f\n'%BraggWt)
     2317    fl.write('\n')
     2318    fl.write('END  ::\n')
    22712319    fl.close()
    22722320    return fname
Note: See TracChangeset for help on using the changeset viewer.