Changeset 1643


Ignore:
Timestamp:
Feb 10, 2015 12:24:35 PM (10 years ago)
Author:
vondreele
Message:

fix input of TOF hkl data
fix bond angle calculations
fix 2D & 3D hkl plotting

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/GSASII.py

    r1625 r1643  
    755755                    Id = self.PatternTree.AppendItem(parent=self.root,text=HistName)
    756756                    if not Bank['RefDict'].get('FF'):
    757                         Bank['RefDict']['FF'] = [{} for i in range(len(Bank['RefDict']['RefList']))]
     757                        Bank['RefDict']['FF'] = {}
    758758                    self.PatternTree.SetItemPyData(Id,[valuesdict,Bank['RefDict']])
    759759                    Sub = self.PatternTree.AppendItem(Id,text='Instrument Parameters')
     
    767767                print 'Read structure factor table '+str(HistName)+' from file '+str(self.lastimport)
    768768                if not rd.RefDict.get('FF'):
    769                     rd.RefDict['FF'] = [{} for i in range(len(rd.RefDict['RefList']))]
     769                    rd.RefDict['FF'] = {}
    770770                Id = self.PatternTree.AppendItem(parent=self.root,text=HistName)
    771771                self.PatternTree.SetItemPyData(Id,[valuesdict,rd.RefDict])
  • TabularUnified trunk/GSASIIIO.py

    r1634 r1643  
    16851685        'self.Parameters is a list with two dicts for data parameter settings'
    16861686        self.InitParameters()
    1687         self.RefDict = {'RefList':[],'FF':[],'Super':0}
     1687        self.RefDict = {'RefList':[],'FF':{},'Super':0}
    16881688        self.Banks = []             #for multi bank data (usually TOF)
    16891689        '''self.RefDict is a dict containing the reflection information, as read from the file.
     
    16991699        self.InitParameters()
    17001700        self.Banks = []             #for multi bank data (usually TOF)
    1701         self.RefDict = {'RefList':[],'FF':[],'Super':0}
     1701        self.RefDict = {'RefList':[],'FF':{},'Super':0}
    17021702       
    17031703    def InitParameters(self):
  • TabularUnified trunk/GSASIImath.py

    r1639 r1643  
    10901090    '''
    10911091    def calcVec(Ox,Tx,U,inv,C,M,T,Amat):
    1092         TxT = inv*(np.inner(M,Tx)+T)+C
    1093         TxT = G2spc.MoveToUnitCell(TxT)+U
     1092        TxT = inv*(np.inner(M,Tx)+T)+C+U
    10941093        return np.inner(Amat,(TxT-Ox))
    10951094       
  • TabularUnified trunk/GSASIIplot.py

    r1635 r1643  
    527527################################################################################
    528528
    529 def Plot3DSngl(G2frame,newPlot=False,Data=None,hklRef=None,Title='no phase'):
     529def Plot3DSngl(G2frame,newPlot=False,Data=None,hklRef=None,Title=False):
    530530    '''3D Structure factor plotting package - displays reflections as rings proportional
    531531        to F, F**2, etc. as requested as 3D array
     
    545545                    print "PIL/pillow Image module not present. Cannot save images without this"
    546546                    raise Exception("PIL/pillow Image module not found")
    547             Fname = os.path.join(Mydir,generalData['Name']+'.'+mode)
     547            try:
     548                Fname = os.path.join(Mydir,generalData['Name']+'.'+mode)
     549            except NameError:   #for when generalData doesn't exist!
     550                Fname = os.path.join(Mydir,'unknown'+'.'+mode)
     551            print Fname+' saved'
    548552            size = Page.canvas.GetSize()
    549553            glPixelStorei(GL_UNPACK_ALIGNMENT, 1)
     
    600604           
    601605    Name = G2frame.PatternTree.GetItemText(G2frame.PatternId)
    602     if Title != 'no phase': #NB: save image as e.g. jpeg will fail if no phase; MyDir is unknown
     606    if Title: #NB: save image as e.g. jpeg will fail if False; MyDir is unknown
    603607        generalData = G2frame.GetPhaseData()[Title]['General']
    604608        cell = generalData['Cell'][1:7]
  • TabularUnified trunk/GSASIIpwdGUI.py

    r1637 r1643  
    28692869        Super = General.get('Super',0)
    28702870        SuperVec = General.get('SuperVec',[])
    2871         refList = np.array(data[phaseName]['RefList'])
     2871        if 'list' in str(type(data)):   #single crystal data is 2 dict in list
     2872            refList = data[1]['RefList']
     2873        else:                           #powder data is a dict of dicts; each same structure as SC 2nd dict
     2874            refList = np.array(data[phaseName]['RefList'])
    28722875        FoMax = np.max(refList.T[8+Super])
    28732876        Hmin = np.array([int(np.min(refList.T[0])),int(np.min(refList.T[1])),int(np.min(refList.T[2]))])
     
    28862889        Super = General.get('Super',0)
    28872890        SuperVec = General.get('SuperVec',[])
    2888         refList = np.array(data[phaseName]['RefList'])
     2891        if 'list' in str(type(data)):   #single crystal data is 2 dict in list
     2892            refList = data[1]['RefList']
     2893        else:                           #powder data is a dict of dicts; each same structure as SC 2nd dict
     2894            refList = np.array(data[phaseName]['RefList'])
    28892895        FoMax = np.max(refList.T[8+Super])
    28902896        Hmin = np.array([int(np.min(refList.T[0])),int(np.min(refList.T[1])),int(np.min(refList.T[2]))])
  • TabularUnified trunk/GSASIIspc.py

    r1638 r1643  
    11551155
    11561156    '''
    1157     hklf = HKL+[0,]
     1157    hklf = list(HKL)+[0,]       #could be numpy array!
    11581158    Ops = SGData['SGOps']
    11591159    OpM = np.array([op[0] for op in Ops])
  • TabularUnified trunk/GSASIIstrMain.py

    r1625 r1643  
    527527                        if i <= j: continue
    528528                        AngArray[Oatom[0]].append((i,j,
    529                                                    G2mth.getAngSig(VectA[i],VectA[j],Amat,SGData,covData)
    530                                                    ))
     529                            G2mth.getAngSig(VectA[i],VectA[j],Amat,SGData,covData)))
    531530    return AtomLabels,DistArray,AngArray
    532531
Note: See TracChangeset for help on using the changeset viewer.