Changeset 4002


Ignore:
Timestamp:
May 28, 2019 11:47:02 AM (3 years ago)
Author:
vondreele
Message:

finish implementation of generating added reflections for Dysnomia. Will currently not show up in reflection list, but output *.pgrid can be viewed by the VESTA program

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwd.py

    r4001 r4002  
    29642964    DysData = data['Dysnomia']
    29652965    generalData = data['General']
     2966    cell = generalData['Cell'][1:7]
     2967    A = G2lat.cell2A(cell)
     2968    SGData = generalData['SGData']
    29662969    pName = generalData['Name'].replace(' ','_')
    29672970    memName = pName+'.mem'
     
    29712974    mem = open(memName,'w')
    29722975    mem.write('%s\n'%(generalData['Name']+' from '+UseList[0]))
    2973     a,b,c,alp,bet,gam = generalData['Cell'][1:7]
     2976    a,b,c,alp,bet,gam = cell
    29742977    mem.write('%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f\n'%(a,b,c,alp,bet,gam))
    29752978    mem.write('      0.0000000      0.0000000     -1    0    0    0     P\n')   #dummy PO stuff
     
    30033006    else:
    30043007        mem.write('%10.3f 0.001\n'%sumpos)
     3008       
     3009    dmin = DysData['MEMdmin']
     3010    refSet = G2lat.GenHLaue(dmin,SGData,A)      #list of h,k,l,d
     3011    refDict = {'%d %d %d'%(ref[0],ref[1],ref[2]):ref for ref in refSet}
    30053012       
    30063013    refs = []
     
    30503057    for ref in refs1:
    30513058        h,k,l = ref[:3]
     3059        hkl = '%d %d %d'%(h,k,l)
     3060        if hkl in refDict:
     3061            del refDict[hkl]
    30523062        Fobs = np.sqrt(ref[6])
    30533063        mem.write('%5d%5d%5d%10.3f%10.3f%10.3f\n'%(h,k,l,Fobs*npcosd(ref[7]),Fobs*npsind(ref[7]),max(0.01*Fobs,0.1)))
     
    30683078        G = np.sqrt(Gsum/Msum)
    30693079        h,k,l = ref2[0][:3]
     3080        hkl = '%d %d %d'%(h,k,l)
     3081        if hkl in refDict:
     3082            del refDict[hkl]
    30703083        mem.write('%5d%5d%5d%10.3f%10.3f%5d\n'%(h,k,l,G,max(0.01*G,0.1),ref2[0][3]))
    30713084        for ref in ref2[1:]:
    30723085            h,k,l,m = ref[:4]
    30733086            mem.write('%5d%5d%5d%5d\n'%(h,k,l,m))
    3074     mem.write('0\n')
     3087            hkl = '%d %d %d'%(h,k,l)
     3088            if hkl in refDict:
     3089                del refDict[hkl]
     3090    if len(refDict):
     3091        mem.write('%d\n'%len(refDict))
     3092        for hkl in list(refDict.keys()):
     3093            h,k,l = refDict[hkl][:3]
     3094            mem.write('%5d%5d%5d\n'%(h,k,l))
     3095    else:
     3096        mem.write('0\n')
    30753097    mem.close()
    30763098    return True
     
    31013123        FoR = float(info[3])
    31023124        FoI = float(info[4])
    3103         refId = reflDict[hash('%5d%5d%5d'%(h,k,l))]
    31043125        Fosq = FoR**2+FoI**2
    31053126        phase = npatan2d(FoI,FoR)
     3127        try:
     3128            refId = reflDict[hash('%5d%5d%5d'%(h,k,l))]
     3129        except KeyError:    #added reflections
     3130            break
    31063131        reflData[refId][8] = Fosq
    31073132        reflData[refId][10] = phase
Note: See TracChangeset for help on using the changeset viewer.