Changeset 3991 for trunk/GSASIIpwd.py


Ignore:
Timestamp:
May 22, 2019 4:25:14 PM (4 years ago)
Author:
vondreele
Message:

process Dysnomia reflection table result saving new Fosq & phase in ReflData?. Then compute new fourier map.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwd.py

    r3990 r3991  
    28872887    try:
    28882888        SGId = G2spc.spgbyNum.index(SGSym)
    2889     except IndexError:
     2889    except ValueError:
    28902890        return False
    28912891    org = 1
     
    29812981    mem.close()
    29822982    return True
     2983
     2984def MEMupdateReflData(prfName,reflData):
     2985    ''' Update reflection data with new Fosq, phase result from Dysnomia
     2986    ;param str prfName: phase.mem file name
     2987    :param list reflData: GSAS-II reflection data
     2988    '''
     2989   
     2990    reflDict = {}
     2991    for iref,ref in enumerate(reflData):
     2992        reflDict[hash('%5d%5d%5d'%(ref[0],ref[1],ref[2]))] = iref
     2993    fbaName = os.path.splitext(prfName)[0]+'.fba'
     2994    fba = open(fbaName,'r')
     2995    fba.readline()
     2996    Nref = int(fba.readline()[:-1])
     2997    fbalines = fba.readlines()
     2998    for line in fbalines[:Nref]:
     2999        info = line.split()
     3000        h = int(info[0])
     3001        k = int(info[1])
     3002        l = int(info[2])
     3003        FoR = float(info[3])
     3004        FoI = float(info[4])
     3005        refId = reflDict[hash('%5d%5d%5d'%(h,k,l))]
     3006        Fosq = FoR**2+FoI**2
     3007        phase = npatan2d(FoI,FoR)
     3008        reflData[refId][8] = Fosq
     3009        reflData[refId][10] = phase
     3010   
    29833011#testing data
    29843012NeedTestData = True
Note: See TracChangeset for help on using the changeset viewer.