Changeset 5025 for trunk/GSASIIstrIO.py


Ignore:
Timestamp:
Sep 14, 2021 11:55:59 AM (3 months ago)
Author:
vondreele
Message:

Add shell plots to 3D reflection plots.
Fix escape character issues in CopyRietveld2Origin
Revise LeBail? operation - now works in sequential refinements. Remove "Fit LeBail?" from Calculate menu.
OnLeBail? does 10 cycles instead of 3 in the "zero cycle" step.
Initial FOSQ set to Scale*Phase fr. instead of 1.0 - improves initial LeBaill? fit.
Put newLeBail flag in Controls - as more global.
Allow LeBail? refinements in sequential refinements.
Remove a wx.Yield() - obsolete
Disable deletion of selected parameters in a LeBail? refinement & let the LS handle any singularities that may ensue
Derivatives no longer controlled by LeBail? flag.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrIO.py

    r4974 r5025  
    706706            if 'parmFrozen' not in Controls:
    707707                Controls['parmFrozen'] = {}
    708             Controls['parmFrozen']['FrozenList'] = [
    709                     i if type(i) is G2obj.G2VarObj
    710                     else G2obj.G2VarObj(i)
    711                     for i in parmFrozenList]
     708            Controls['parmFrozen']['FrozenList'] = [i if type(i) is G2obj.G2VarObj
     709                else G2obj.G2VarObj(i) for i in parmFrozenList]
    712710        try:
    713711            histogram = Histograms[datum[0]]
     
    24542452################################################################################       
    24552453                   
    2456 def GetHistogramPhaseData(Phases,Histograms,Print=True,pFile=None,resetRefList=True):
     2454def GetHistogramPhaseData(Phases,Histograms,Controls={},Print=True,pFile=None,resetRefList=True):
    24572455    '''Loads the HAP histogram/phase information into dicts
    24582456
     
    26022600                if Phases[phase]['General']['doPawley']:
    26032601                    hapDict[pfx+'LeBail'] = False           #Pawley supercedes LeBail
    2604                     hapDict[pfx+'newLeBail'] = True
    26052602                    Tmin = G2lat.Dsp2pos(inst,dmin)
    26062603                    if 'T' in inst['Type'][1]:
     
    26102607                else:
    26112608                    hapDict[pfx+'LeBail'] = hapData.get('LeBail',False)
    2612                     hapDict[pfx+'newLeBail'] = hapData.get('newLeBail',True)
    26132609                if Phases[phase]['General']['Type'] == 'magnetic':
    26142610                    dmin = max(dmin,Phases[phase]['General'].get('MagDmin',0.))
    26152611                for item in ['Scale','Extinction']:
    26162612                    hapDict[pfx+item] = hapData[item][0]
    2617                     if hapData[item][1] and not hapDict[pfx+'LeBail']:
     2613                    # if hapData[item][1] and not hapDict[pfx+'LeBail']:
     2614                    if hapData[item][1]:
    26182615                        hapVary.append(pfx+item)
    26192616                names = G2spc.HStrainNames(SGData)
     
    26342631                    hapDict[pfx+'MD'] = hapData['Pref.Ori.'][1]
    26352632                    controlDict[pfx+'MDAxis'] = hapData['Pref.Ori.'][3]
    2636                     if hapData['Pref.Ori.'][2] and not hapDict[pfx+'LeBail']:
     2633                    if hapData['Pref.Ori.'][2]:     # and not hapDict[pfx+'LeBail']:
    26372634                        hapVary.append(pfx+'MD')
    26382635                else:                           #'SH' spherical harmonics
     
    26502647                    for item in hapData['Pref.Ori.'][5]:
    26512648                        hapDict[pfx+item] = hapData['Pref.Ori.'][5][item]
    2652                         if hapData['Pref.Ori.'][2] and not hapDict[pfx+'LeBail']:
     2649                        if hapData['Pref.Ori.'][2]:         # and not hapDict[pfx+'LeBail']:
    26532650                            hapVary.append(pfx+item)
    26542651                for item in ['Mustrain','Size']:
     
    26832680                    for bab in ['BabA','BabU']:
    26842681                        hapDict[pfx+bab] = hapData['Babinet'][bab][0]
    2685                         if hapData['Babinet'][bab][1] and not hapDict[pfx+'LeBail']:
     2682                        if hapData['Babinet'][bab][1]:      # and not hapDict[pfx+'LeBail']:
    26862683                            hapVary.append(pfx+bab)
    26872684                               
     
    27092706                        if hapData['Babinet']['BabA'][0]:
    27102707                            PrintBabinet(hapData['Babinet'])
    2711                 if phase in Histogram['Reflection Lists'] and 'RefList' not in Histogram['Reflection Lists'][phase] and hapData.get('LeBail',False):
    2712                     hapData['newLeBail'] = True
    2713                 if resetRefList and (not hapDict[pfx+'LeBail'] or (hapData.get('LeBail',False) and hapData['newLeBail'])):
    2714                     if hapData.get('LeBail',True):         #stop regeneating reflections for LeBail
    2715                         hapData['newLeBail'] = False
     2708                if resetRefList and (not hapDict[pfx+'LeBail'] or (hapData.get('LeBail',False) and Controls.get('newLeBail',False))):
     2709                    Scale = Histogram['Sample Parameters']['Scale'][0]      #for initializing reflection structure factors.
     2710                    StartI = hapData['Scale'][0]*Scale
    27162711                    refList = []
    2717 #                    Uniq = []
    2718 #                    Phi = []
    27192712                    useExt = 'magnetic' in Phases[phase]['General']['Type'] and 'N' in inst['Type'][0]
    27202713                    if Phases[phase]['General'].get('Modulated',False):
     
    27292722                                    pos = G2lat.Dsp2pos(inst,d)
    27302723                                    if limits[0] < pos < limits[1]:
    2731                                         refList.append([h,k,l,m,mul,d, pos,0.0,0.0,0.0,1., 0.0,0.0,1.0,1.0,1.0])
     2724                                        refList.append([h,k,l,m,mul,d, pos,0.0,0.0,0.0,StartI, 0.0,0.0,1.0,1.0,1.0])
    27322725                                        #... sig,gam,fotsq,fctsq, phase,icorr,prfo,abs,ext
    2733 #                                        Uniq.append(uniq)
    2734 #                                        Phi.append(phi)
    27352726                                elif 'T' in inst['Type'][0]:
    27362727                                    pos = G2lat.Dsp2pos(inst,d)
    27372728                                    if limits[0] < pos < limits[1]:
    27382729                                        wave = inst['difC'][1]*d/(252.816*inst['fltPath'][0])
    2739                                         refList.append([h,k,l,m,mul,d, pos,0.0,0.0,0.0,1., 0.0,0.0,0.0,0.0,wave, 1.0,1.0,1.0])
     2730                                        refList.append([h,k,l,m,mul,d, pos,0.0,0.0,0.0,StartI, 0.0,0.0,0.0,0.0,wave, 1.0,1.0,1.0])
    27402731                                        # ... sig,gam,fotsq,fctsq, phase,icorr,alp,bet,wave, prfo,abs,ext
    27412732                                        #TODO - if tabulated put alp & bet in here
    2742 #                                        Uniq.append(uniq)
    2743 #                                        Phi.append(phi)
    27442733                                elif 'B' in inst['Type'][0]:
    27452734                                    pos = G2lat.Dsp2pos(inst,d)
    27462735                                    if limits[0] < pos < limits[1]:
    2747                                         refList.append([h,k,l,m,mul,d, pos,0.0,0.0,0.0,1., 0.0,0.0,0.0,0.0, 1.0,1.0,1.0])
     2736                                        refList.append([h,k,l,m,mul,d, pos,0.0,0.0,0.0,StartI, 0.0,0.0,0.0,0.0, 1.0,1.0,1.0])
    27482737                                        # ... sig,gam,fotsq,fctsq, phase,icorr,alp,bet, prfo,abs,ext
    27492738                    else:
     
    27612750                                pos = G2lat.Dsp2pos(inst,d)
    27622751                                if limits[0] < pos < limits[1]:
    2763                                     refList.append([h,k,l,mul,d, pos,0.0,0.0,0.0,1., 0.0,0.0,1.0,1.0,1.0])
     2752                                    refList.append([h,k,l,mul,d, pos,0.0,0.0,0.0,StartI, 0.0,0.0,1.0,1.0,1.0])
    27642753                                    #... sig,gam,fotsq,fctsq, phase,icorr,prfo,abs,ext
    2765 #                                    Uniq.append(uniq)
    2766 #                                    Phi.append(phi)
    27672754                            elif 'T' in inst['Type'][0]:
    27682755                                pos = G2lat.Dsp2pos(inst,d)
    27692756                                if limits[0] < pos < limits[1]:
    27702757                                    wave = inst['difC'][1]*d/(252.816*inst['fltPath'][0])
    2771                                     refList.append([h,k,l,mul,d, pos,0.0,0.0,0.0,1., 0.0,0.0,0.0,0.0,wave, 1.0,1.0,1.0])
     2758                                    refList.append([h,k,l,mul,d, pos,0.0,0.0,0.0,StartI, 0.0,0.0,0.0,0.0,wave, 1.0,1.0,1.0])
    27722759                                    # ... sig,gam,fotsq,fctsq, phase,icorr,alp,bet,wave, prfo,abs,ext
    2773 #                                    Uniq.append(uniq)
    2774 #                                    Phi.append(phi)
    27752760                            elif 'B' in inst['Type'][0]:
    27762761                                pos = G2lat.Dsp2pos(inst,d)
    27772762                                if limits[0] < pos < limits[1]:
    2778                                     refList.append([h,k,l,mul,d, pos,0.0,0.0,0.0,1., 0.0,0.0,0.0,0.0, 1.0,1.0,1.0])
     2763                                    refList.append([h,k,l,mul,d, pos,0.0,0.0,0.0,StartI, 0.0,0.0,0.0,0.0, 1.0,1.0,1.0])
    27792764                                    # ... sig,gam,fotsq,fctsq, phase,icorr,alp,bet, prfo,abs,ext
    27802765                    Histogram['Reflection Lists'][phase] = {'RefList':np.array(refList),'FF':{},'Type':inst['Type'][0],'Super':ifSuper}
Note: See TracChangeset for help on using the changeset viewer.