Changeset 2721


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

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r2717 r2721  
    154154
    155155    '''
    156     Npix,imagefile,imagetag = G2frame.PatternTree.GetImageLoc(treeId)
     156    Npix,Imagefile,imagetag = G2frame.PatternTree.GetImageLoc(treeId)
     157    if isinstance(Imagefile,list):
     158        imagefile,imagetag = Imagefile
     159    else:
     160        imagefile = Imagefile
    157161    if not os.path.exists(imagefile):
    158162        print 'Image file '+imagefile+' not found'
  • 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 = []
  • trunk/GSASIIimage.py

    r2694 r2721  
    259259            if [X,Y,dsp] not in ring:           #no duplicates!
    260260                ring.append([X,Y,dsp])
    261                 azm.append(a)
     261                azm.append(360.-a)
    262262    if len(ring) < 10:
    263263        ring = []
  • trunk/GSASIIobj.py

    r2708 r2721  
    20302030                    self.exprDict[v] = parmDict[varname]
    20312031            else:
    2032                 raise Exception,"No value for variable "+str(v)
     2032                self.exprDict[v] = None
     2033#                raise Exception,"No value for variable "+str(v)
    20332034        self.exprDict.update(self.fxnpkgdict)
    20342035
     
    20772078        if self.compiledExpr is None:
    20782079            raise Exception,"EvalExpression called before SetupCalc"
    2079         val = eval(self.compiledExpr,globals(),self.exprDict)
     2080        try:
     2081            val = eval(self.compiledExpr,globals(),self.exprDict)
     2082        except TypeError:
     2083            val = None
    20802084        if not np.isscalar(val):
    20812085            val = np.sum(val)
  • trunk/GSASIIstrMain.py

    r2717 r2721  
    317317        calcControls.update(controlDict)
    318318        varyList = rbVary+redphaseVary+hapVary+histVary
     319#        if not ihst:
     320            # save the initial vary list, but without histogram numbers on parameters
     321        saveVaryList = varyList[:]
     322        for i,item in enumerate(saveVaryList):
     323            items = item.split(':')
     324            if items[1]:
     325                items[1] = ''
     326            item = ':'.join(items)
     327            saveVaryList[i] = item
    319328        if not ihst:
    320             # save the initial vary list, but without histogram numbers on parameters
    321             saveVaryList = varyList[:]
    322             for i,item in enumerate(saveVaryList):
    323                 items = item.split(':')
    324                 if items[1]:
    325                     items[1] = ''
    326                 item = ':'.join(items)
    327                 saveVaryList[i] = item
    328329            SeqResult['varyList'] = saveVaryList
     330        else:
     331            SeqResult['varyList'] = list(set(SeqResult['varyList']+saveVaryList))
    329332        parmDict = {}
    330333        parmDict.update(phaseDict)
Note: See TracChangeset for help on using the changeset viewer.