Changeset 2326 for trunk/GSASIIgrid.py


Ignore:
Timestamp:
Jun 15, 2016 9:21:13 PM (7 years ago)
Author:
vondreele
Message:

add more to angle calc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIgrid.py

    r2323 r2326  
    28072807
    28082808    def AddNewAnglePseudoVar(event):
    2809         print 'Add bond angle pseudo-variable here - TBD'
    28102809        dlg = G2exG.AngleDialog(
    28112810            G2frame.dataDisplay,Phases,PSvarDict,
     
    28132812            VarLabel = "New Angle")
    28142813        if dlg.ShowModal() == wx.ID_OK:
    2815             obj = dlg.GetSelection()
     2814            pName,Oatom,Tatoms = dlg.GetSelection()
     2815            if Tatoms:
     2816                Phase = Phases[pName]
     2817                General = Phase['General']
     2818                cx,ct = General['AtomPtrs'][:2]
     2819                pId = Phase['pId']
     2820                SGData = General['SGData']
     2821                Atoms = Phase['Atoms']
     2822                aNames = [atom[ct-1] for atom in Atoms]
     2823                tIds = []
     2824                symNos = []
     2825                cellNos = []
     2826                oId = aNames.index(Oatom)
     2827                Tatoms = Tatoms.split(';')
     2828                for Tatom in Tatoms:
     2829                    sB = Tatom.find('(')+1
     2830                    symNo = 0
     2831                    if sB:
     2832                        sF = Tatom.find(')')
     2833                        symNo = int(Tatom[sB:sF])
     2834                    symNos.append(symNo)
     2835                    cellNo = [0,0,0]
     2836                    cB = Tatom.find('[')
     2837                    if cB>0:
     2838                        cF = Tatom.find(']')+1
     2839                        cellNo = eval(Tatom[cB:cF])
     2840                    cellNos.append(cellNo)
     2841                    tIds.append(aNames.index(Tatom.split('+')[0]))
     2842                # create an expression object
     2843                obj = G2obj.ExpressionObj()
     2844                obj.expression = 'Angle(%s,%s,\n%s)'%(Tatoms[0],Oatom,Tatoms[1])
     2845                obj.angle_dict = {'pId':pId,'SGData':SGData,'symNo':symNos,'cellNo':cellNos}
     2846                obj.angle_atoms = [oId,tIds]
    28162847        else:
    28172848            dlg.Destroy()
     
    28192850        dlg.Destroy()
    28202851        if obj:
    2821             calcobj = G2obj.ExpressionCalcObj(obj)
    2822             Controls['SeqPseudoVars'][calcobj.eObj.expression] = obj
     2852            Controls['SeqPseudoVars'][obj.expression] = obj
    28232853            UpdateSeqResults(G2frame,data,G2frame.dataDisplay.GetSize()) # redisplay variables
    28242854           
Note: See TracChangeset for help on using the changeset viewer.