Changeset 4046


Ignore:
Timestamp:
Jun 30, 2019 9:53:33 PM (4 years ago)
Author:
toby
Message:

remove histograms that are not added to a phse from the Seq Ref refinement; skip histograms w/o Use flag in mass fraction computation

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIdataGUI.py

    r4045 r4046  
    46974697            time.sleep(0.1)
    46984698            pltNumber = self.G2plotNB.nb.GetSelection()
    4699             pltText = self.G2plotNB.nb.GetPageText(pltNumber)
     4699            if pltNumber >= 0:
     4700                pltText = self.G2plotNB.nb.GetPageText(pltNumber)
     4701            else:
     4702                pltText = None
    47004703        # update plots where a routine is supplied
    47014704        for lbl,win in zip(self.G2plotNB.plotList,self.G2plotNB.panelList):
     
    73557358                sigwtFrList.append(0.0)
    73567359                continue
     7360            elif not Phases[phase]['Histograms'][name]['Use']:
     7361                wtFrList.append(None)
     7362                sigwtFrList.append(0.0)
     7363                continue
    73577364            wtFrSum = 0.
    73587365            for phase1 in Phases:
    73597366                if name not in Phases[phase1]['Histograms']: continue
     7367                if not Phases[phase1]['Histograms'][name]['Use']: continue
    73607368                wtFrSum += Phases[phase1]['Histograms'][name]['Scale'][0]*Phases[phase1]['General']['Mass']
    73617369            var = str(Phases[phase]['pId'])+':'+str(i)+':Scale'
  • trunk/GSASIIddataGUI.py

    r3982 r4046  
    126126        if 'PWDR' in G2frame.hist and generalData['Type'] != 'magnetic':
    127127            wtSum = G2pwd.PhaseWtSum(G2frame,G2frame.hist)
    128             if wtSum:
     128            if wtSum and UseList[G2frame.hist]['Use']:
    129129                weightFr = UseList[G2frame.hist]['Scale'][0]*generalData['Mass']/wtSum
    130130                scaleSizer.Add(wx.StaticText(DData,label=' Wt. fraction: %.3f'%(weightFr)),0,WACV)
     
    832832            Obj = event.GetEventObject()
    833833            UseList[G2frame.hist]['Use'] = Obj.GetValue()
     834            wx.CallLater(100,RepaintHistogramInfo,DData.GetScrollPos(wx.VERTICAL))
    834835
    835836        def OnLeBail(event):
  • trunk/GSASIIplot.py

    r4044 r4046  
    64336433                Xnew.append(X[i])
    64346434                Ynew.append(Y[i])
    6435                 if sig[i]:
     6435                if sig and sig[i]:
    64366436                    gotsig = True
    64376437                    Ysnew.append(sig[i])
  • trunk/GSASIIpwd.py

    r4030 r4046  
    8686        if Phases[phase]['General']['Type'] != 'magnetic':
    8787            if histo in Phases[phase]['Histograms']:
     88                if not Phases[phase]['Histograms'][histo]['Use']: continue
    8889                mass = Phases[phase]['General']['Mass']
    8990                phFr = Phases[phase]['Histograms'][histo]['Scale'][0]
  • trunk/GSASIIstrMath.py

    r4038 r4046  
    30133013                    continue
    30143014                Phase = Phases[phase]
     3015                if histogram not in Phase['Histograms']:
     3016                    continue
    30153017                im = 0
    30163018                if Phase['General'].get('Modulated',False):
     
    31143116        print ('GetFobsSq t=',time.time()-starttime)
    31153117               
    3116 def getPowderProfile(parmDict,x,varylist,Histogram,Phases,calcControls,pawleyLookup):
     3118def getPowderProfile(parmDict,x,varylist,Histogram,Phases,calcControls,pawleyLookup,histogram=None):
    31173119    'Computes the powder pattern for a histogram based on contributions from all used phases'
    31183120    if GSASIIpath.GetConfigValue('Show_timing',False): starttime = time.time()
     
    31733175            continue
    31743176        Phase = Phases[phase]
     3177        if histogram and not histogram in Phase['Histograms']:
     3178            continue
    31753179        pId = Phase['pId']
    31763180        pfx = '%d::'%(pId)
     
    33183322    ptx.pyqlmninit()            #initialize fortran arrays for spherical harmonics for each processor
    33193323    parmDict,x,varylist,Histogram,Phases,rigidbodyDict,calcControls,pawleyLookup,dependentVars = args[:9]
    3320     prc=0
    3321     tprc=1
     3324    prc,tprc,histogram = 0,1,None
    33223325    if len(args) >= 10: prc=args[9]
    33233326    if len(args) >= 11: tprc=args[10]
     3327    if len(args) >= 12: histogram=args[11]
    33243328    def cellVaryDerv(pfx,SGData,dpdA):
    33253329        if SGData['SGLaue'] in ['-1',]:
     
    33903394            continue
    33913395        Phase = Phases[phase]
     3396        if histogram and histogram not in Phase['Histograms']:
     3397            continue
    33923398        SGData = Phase['General']['SGData']
    33933399        SGMT = np.array([ops[0].T for ops in SGData['SGOps']])
     
    38553861                dMdvh = None
    38563862                depDerivDict = None
    3857                 profArgs = [
     3863                # old approach, create all args prior to use
     3864#                profArgs = [
     3865#                    (parmDict,x[xB:xF],varylist,Histogram,Phases,rigidbodyDict,calcControls,pawleyLookup,dependentVars,
     3866#                     i,ncores,histogram) for i in range(ncores)]
     3867#                for dmdv,depDerivs in MPpool.imap_unordered(getPowderProfileDervMP,profArgs):
     3868                # better, use a generator so arg is created as used
     3869                profGenArgs = (
    38583870                    (parmDict,x[xB:xF],varylist,Histogram,Phases,rigidbodyDict,calcControls,pawleyLookup,dependentVars,
    3859                      i,ncores) for i in range(ncores)]
    3860                 for dmdv,depDerivs in MPpool.imap_unordered(getPowderProfileDervMP,profArgs):
     3871                     i,ncores,histogram) for i in range(ncores))
     3872                for dmdv,depDerivs in MPpool.imap_unordered(getPowderProfileDervMP,profGenArgs):
    38613873                    if dMdvh is None:
    38623874                       dMdvh = dmdv
     
    38683880            else:
    38693881                dMdvh,depDerivDict = getPowderProfileDervMP([parmDict,x[xB:xF],
    3870                     varylist,Histogram,Phases,rigidbodyDict,calcControls,pawleyLookup,dependentVars])
     3882                    varylist,Histogram,Phases,rigidbodyDict,calcControls,pawleyLookup,dependentVars,0,1,histogram])
    38713883                #dMdvh = getPowderProfileDerv(parmDict,x[xB:xF],
    38723884                #    varylist,Histogram,Phases,rigidbodyDict,calcControls,pawleyLookup,dependentVars)
     
    39503962            xF = np.searchsorted(x,Limits[1])+1
    39513963            yc[xB:xF],yb[xB:xF] = getPowderProfile(parmDict,x[xB:xF],
    3952                 varylist,Histogram,Phases,calcControls,pawleyLookup)
     3964                varylist,Histogram,Phases,calcControls,pawleyLookup,histogram)
    39533965            yc[xB:xF] += yb[xB:xF]
    39543966            if not np.any(y):                   #fill dummy data
Note: See TracChangeset for help on using the changeset viewer.