Changeset 2721 for trunk/GSASIIgrid.py


Ignore:
Timestamp:
Feb 23, 2017 1:26:52 PM (5 years ago)
Author:
vondreele
Message:

fix pseudo variable issues when some vals are None
fix problem of moved ge multi-image files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIgrid.py

    r2720 r2721  
    35313531            calcobj.SetupCalc(VparmDict)
    35323532            results.append(calcobj.EvalExpression())
     3533        if None in results:
     3534            return None
    35333535        return (results[0] - results[1]) / (2.*step)
    35343536       
     
    38243826    for item in newCellDict:
    38253827        cellAlist.append(newCellDict[item][0])
    3826         if item in data['varyList']:
     3828        if item in data.get('varyList',[]):
    38273829            ESDlookup[newCellDict[item][0]] = item
    38283830            Dlookup[item] = newCellDict[item][0]
     
    41324134                    [EvalPSvarDeriv(calcobj,parmDict.copy(),sampleDict[name],var,ESD)
    41334135                     for var,ESD in zip(varyList,sigs)])
    4134                 esdList.append(np.sqrt(
    4135                     np.inner(derivs,np.inner(data[name]['covMatrix'],derivs.T)) ))
     4136                if None in list(derivs):
     4137                    esdList.append(None)
     4138                else:
     4139                    esdList.append(np.sqrt(
     4140                        np.inner(derivs,np.inner(data[name]['covMatrix'],derivs.T)) ))
    41364141            PSvarDict = parmDict.copy()
    41374142            PSvarDict.update(sampleDict[name])
     
    41494154
    41504155    # Make dict needed for creating & editing pseudovars (PSvarDict).
     4156   
    41514157    name = histNames[0]
    41524158    parmDict = data[name].get('parmDict',{})
     
    41574163    # for Parametric fitting from the data table
    41584164    parmDict = dict(zip(colLabels,zip(*G2frame.colList)[0])) # scratch dict w/all values in table
    4159     parmDict.update({var:val for var,val in data[name].get('newCellDict',{}).values()}) #  add varied reciprocal cell terms
     4165    parmDict.update({var:val for var,val in newCellDict.values()}) #  add varied reciprocal cell terms
    41604166    del parmDict['Use']
    41614167    name = histNames[0]
     
    41744180        else:
    41754181            val,sig = G2frame.colList[i][0],None
    4176         if val is None: continue
    4177         elif sig is None or sig == 0.:
    4178             VarDict[var] = val
    4179         elif striphist(var) not in Dlookup:
     4182#        if val is None: continue
     4183#        elif sig is None or sig == 0.:
     4184#            VarDict[var] = val
     4185        if striphist(var) not in Dlookup:
    41804186            VarDict[var] = val
    41814187    # add recip cell coeff. values
    4182     VarDict.update({var:val for var,val in data[name].get('newCellDict',{}).values()})
     4188    VarDict.update({var:val for var,val in newCellDict.values()})
    41834189
    41844190    G2frame.dataFrame.currentGrids = []
Note: See TracChangeset for help on using the changeset viewer.