Changeset 3991


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.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r3990 r3991  
    42034203        Csizer.Add(Cyc,0,WACV)
    42044204        mainSizer.Add(Csizer)
    4205        
    4206        
    4207        
    4208        
    4209        
    42104205        SetPhaseWindow(G2frame.MEMData,mainSizer)
    42114206
    42124207    def OnLoadDysnomia(event):
    4213         print('Load MEM')
     4208        print('Load MEM - might not be implemented')
    42144209       
    42154210    def OnSaveDysnomia(event):
    4216         print('Save MEM')
     4211        print('Save MEM - might not be implemented')
    42174212
    42184213    def OnRunDysnomia(event):
    42194214       
    4220 #data['Dysnomia'] = {'DenStart':'uniform','Optimize':'ZSPA','Lagrange':['user',0.001,0.05],
    4221 #    'wt pwr':0,'E_factor':1.,'Ncyc':5000,'prior':'uniform','Lam frac':[1,0,0,0,0,0,0,0]}
    4222 
    42234215        generalData = data['General']
    42244216        Map = generalData['Map']
     
    42464238       
    42474239        path2GSAS2 = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
    4248         DYSNOMIA = os.path.join(path2GSAS2,'Dysnomia','Dysnomia64.exe')
     4240        DYSNOMIA = os.path.join(path2GSAS2,'Dysnomia','Dysnomia64.exe')     #TODO; need check if DYSNOMIA exists!
    42494241        print('Run '+DYSNOMIA)
    42504242       
    42514243        subp.call([DYSNOMIA,prfName])
     4244       
     4245        G2pwd.MEMupdateReflData(prfName,reflData)   #auto run Fourier?
     4246        OnFourierMaps(event)       
    42524247           
    42534248       
  • 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.