Changeset 2717


Ignore:
Timestamp:
Feb 21, 2017 3:50:45 PM (5 years ago)
Author:
vondreele
Message:
 
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r2715 r2717  
    35923592                        if 'formula' in item[:15].lower():
    35933593                            formula = item.split('=')[1].split()
    3594                             elems = formula[::2]
    3595                             nums = formula[1::2]
    3596                             formula = zip(elems,nums)
    3597                             for [elem,num] in formula:
    3598                                 ElData = G2elem.GetElInfo(elem,Parms)
    3599                                 ElData['FormulaNo'] = float(num)
     3594                            try:
     3595                                elems = formula[::2]
     3596                                nums = formula[1::2]
     3597                                Formula = zip(elems,nums)
     3598                                for [elem,num] in Formula:
     3599                                    ElData = G2elem.GetElInfo(elem,Parms)
     3600                                    ElData['FormulaNo'] = float(num)
     3601                                    ElList[elem] = ElData
     3602                            except ValueError:
     3603                                ElData = G2elem.GetElInfo(formula[0],Parms)
     3604                                ElData['FormulaNo'] = 1.0
    36003605                                ElList[elem] = ElData
    36013606                    ElLists.append(ElList)
  • trunk/GSASIIIO.py

    r2712 r2717  
    10931093            grfile.write('composition = %s\n'%(formula))
    10941094            grfile.write('bgscale = %.3f\n'%(-PDFControls['Sample Bkg.']['Mult']))
    1095             grfile.write('rpoly = 1.05\n')
    10961095            highQ = 2.*np.pi/G2lat.Pos2dsp(Inst,Limits[1][1])
    10971096            grfile.write('qmaxinst = %.2f\n'%(highQ))
  • trunk/GSASIIgrid.py

    r2715 r2717  
    9191
    9292[ wxID_PAWLEYLOAD, wxID_PAWLEYESTIMATE, wxID_PAWLEYUPDATE, wxID_PAWLEYSELALL, wxID_PAWLEYSELNONE,
    93   wxID_PAWLEYSELTOGGLE, wxID_PAWLEYSET,
     93  wxID_PAWLEYSELTOGGLE, wxID_PAWLEYSET, 
    9494] = [wx.NewId() for item in range(7)]
    9595
     
    39013901            continue
    39023902        foundNames.append(name)
     3903        maxPWL = 5
    39033904        for var,val,sig in zip(data[name]['varyList'],data[name]['variables'],data[name]['sig']):
    39043905            svar = striphist(var,'*') # wild-carded
     3906            if 'PWL' in svar:
     3907                if int(svar.split(':')[-1]) > maxPWL:
     3908                    continue
    39053909            if svar not in combinedVaryList:
    39063910                # add variables to list as they appear
     
    39133917            for var in data[name]['varyList']:
    39143918                svar = striphist(var,'*')
     3919                if 'PWL' in svar:
     3920                    if int(svar.split(':')[-1]) > maxPWL:
     3921                        continue
    39153922                posdict[name][combinedVaryList.index(svar)] = svar
    39163923            VaryListChanges.append(name)
     
    39613968            Types += (1+len(uniqCellIndx[pId]))*[wg.GRID_VALUE_FLOAT,]
    39623969            for name in histNames:
    3963                 covData = {
    3964                     'varyList': [Dlookup.get(striphist(v),v) for v in data[name]['varyList']],
    3965                     'covMatrix': data[name]['covMatrix']
    3966                     }
     3970                covData = {'varyList': [Dlookup.get(striphist(v),v) for v in data[name]['varyList']],
     3971                    'covMatrix': data[name]['covMatrix']}
    39673972                A = RecpCellTerms[pId][:] # make copy of starting A values
    39683973                # update with refined values
  • trunk/GSASIIpwd.py

    r2689 r2717  
    18521852            print '*** recommended is 6-10; you have %.2f ***'%(min(binsperFWHM))
    18531853    return sigDict,result,sig,Rvals,varyList,parmDict,fullvaryList,badVary
    1854 
     1854   
    18551855def calcIncident(Iparm,xdata):
    18561856    'needs a doc string'
  • trunk/GSASIIstrMain.py

    r2713 r2717  
    237237    if dlg:
    238238        return True,Rvals
     239       
     240def phaseCheck(phaseVary,Phases,histogram):
     241    '''
     242    Removes unused parameters from phase varylist if phase not in histogram
     243    '''
     244    pIds = []
     245    for phase in Phases:
     246        if Phases[phase]['Histograms'][histogram]['Use']:
     247            pIds.append(str(Phases[phase]['pId']))
     248    return [item for item in phaseVary if item.split(':')[0] in pIds]
    239249
    240250def SeqRefine(GPXfile,dlg):
     
    300310            print("Error: not found!")
    301311            continue
     312        redphaseVary = phaseCheck(phaseVary,Phases,histogram)
    302313        Histo = {histogram:Histograms[histogram],}
    303314        hapVary,hapDict,controlDict = G2stIO.GetHistogramPhaseData(Phases,Histo,Print=False)
     
    305316        histVary,histDict,controlDict = G2stIO.GetHistogramData(Histo,False)
    306317        calcControls.update(controlDict)
    307         varyList = rbVary+phaseVary+hapVary+histVary
     318        varyList = rbVary+redphaseVary+hapVary+histVary
    308319        if not ihst:
    309320            # save the initial vary list, but without histogram numbers on parameters
Note: See TracChangeset for help on using the changeset viewer.