Changeset 1884 for trunk/GSASIIstrIO.py


Ignore:
Timestamp:
Jun 9, 2015 4:02:06 PM (8 years ago)
Author:
vondreele
Message:

remove some unused imports
add merohedral/pseudomerohedral Twin Laws to G2ddataGUI and G2strIO (not in G2strmath yet).
allow ReImport? atoms to fill otherwise empty Atom List
clarify HKL importers as Shelx HKL 4 & HKL 5 files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrIO.py

    r1876 r1884  
    20272027        print >>pFile,varstr
    20282028       
    2029    
    20302029    hapDict = {}
    20312030    hapVary = []
     
    22432242                if hapData.get('Flack',[0,False])[1]:
    22442243                    hapVary.append(pfx+'Flack')
     2244                Twins = hapData.get('Twins',[[np.array([[1,0,0],[0,1,0],[0,0,1]]),[1.0,False]],])
     2245                sumTwFr = 0.
     2246                for it,twin in enumerate(Twins):
     2247                    controlDict[pfx+'TwinLaw;'+str(it)] = twin[0]
     2248                    hapDict[pfx+'TwinFr;'+str(it)] = twin[1][0]
     2249                    sumTwFr += twin[1][0]
     2250                    if twin[1][1]:
     2251                        hapVary.append(pfx+'TwinFr;'+str(it))
     2252                for it,twin in enumerate(Twins):    #force sum to unity
     2253                    hapDict[pfx+'TwinFr;'+str(it)] /= sumTwFr
    22452254                if Print:
    22462255                    print >>pFile,'\n Phase: ',phase,' in histogram: ',histogram
     
    22572266                    if not SGData['SGInv']:
    22582267                        print >>pFile,' Flack parameter: %10.3f'%(hapData['Flack'][0]),' Refine?',hapData['Flack'][1]
     2268                    if len(Twins) > 1:
     2269                        for it,twin in enumerate(Twins):
     2270                            print >>pFile,' Twin law: %s'%(str(twin[0]).replace('\n',',')),' Twin fr.: %5.3f Refine? '%(hapDict[pfx+'TwinFr;'+str(it)]),twin[1][1]
     2271                       
    22592272                Histogram['Reflection Lists'] = phase       
    22602273               
     
    24092422        print >>pFile,ptstr
    24102423        print >>pFile,sigstr
     2424       
     2425    def PrintTwinsAndSig(pfx,hapData,TwinSig):
     2426        print >>pFile,'\n Twin Law fractions : '
     2427        ptlbls = ' names :'
     2428        ptstr =  ' values:'
     2429        sigstr = ' sig   :'
     2430        for item in hapData:
     2431            ptlbls += '%12s'%(item)
     2432            ptstr += '%12.3f'%(hapData[item][0])
     2433            if pfx+item in TwinSig:
     2434                sigstr += '%12.3f'%(TwinSig[pfx+item])
     2435            else:
     2436                sigstr += 12*' '
     2437        print >>pFile,ptlbls
     2438        print >>pFile,ptstr
     2439        print >>pFile,sigstr
     2440       
    24112441   
    24122442    PhFrExtPOSig = {}
     
    24142444    ScalExtSig = {}
    24152445    BabSig = {}
     2446    TwinFrSig = {}
    24162447    wtFrSum = {}
    24172448    for phase in Phases:
     
    24962527                        if pfx+item in sigDict:
    24972528                            ScalExtSig[pfx+item] = sigDict[pfx+item]
    2498                 for name in ['BabA','BabU']:
    2499                     hapData['Babinet'][name][0] = parmDict[pfx+name]
    2500                     if pfx+name in sigDict:
    2501                         BabSig[pfx+name] = sigDict[pfx+name]               
     2529                for item in ['BabA','BabU']:
     2530                    hapData['Babinet'][item][0] = parmDict[pfx+item]
     2531                    if pfx+item in sigDict:
     2532                        BabSig[pfx+item] = sigDict[pfx+item]
     2533                item = 'TwinFr'
     2534                it = 0
     2535                while True:
     2536                    try:
     2537                        hapData['TwinFr'][1][0] = parmDict[pfx+'TwinFr;'+str(it)]
     2538                        if pfx+'TwinFr;'+str(it) in sigDict:
     2539                            TwinFrSig[pfx+'TwinFr;'+str(it)] = sigDict[pfx+'TwinFr;'+str(it)]
     2540                        it += 1
     2541                    except KeyError:
     2542                        break
    25022543
    25032544    if Print:
     
    25612602                    if pfx+'Flack' in ScalExtSig:
    25622603                        print >>pFile,' Flack parameter : %10.3f, sig %10.3f'%(hapData['Flack'][0],ScalExtSig[pfx+'Flack'])
     2604                    if pfx+'TwinFr;1' in TwinFrSig:
     2605                        PrintTwinFrAndSig(pfx,hapData['TwinFr'],TwinFrSig)
    25632606
    25642607################################################################################
Note: See TracChangeset for help on using the changeset viewer.