Ignore:
Timestamp:
Sep 30, 2016 1:44:10 PM (5 years ago)
Author:
vondreele
Message:

allow atom constraints between phases

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIconstrGUI.py

    r2481 r2482  
    840840            else:
    841841                constr = [[1.0,G2obj.G2VarObj(name)]]
    842             pref = name.rsplit(':',1)[0]
     842            pref = ':'+name.rsplit(':',1)[0].split(':',1)[1]    #get stuff between phase id & atom id
    843843            for sel in Selections:
    844                 id = Atoms[AtNames[sel]][0].rsplit(':',1)[-1]
     844                name2 = Atoms[AtNames[sel]][0]
     845                pid = name2.split(':',1)[0]                     #get phase id for 2nd atom
     846                id = name2.rsplit(':',1)[-1]                    #get atom no. for 2nd atom
    845847                if 'riding' in constType:
     848                    pref = pid+pref
    846849                    if 'AUiso' in pref:
    847850                        parts = pref.split('AUiso')
     
    850853                        constr += [[1.0,G2obj.G2VarObj('%s:%s'%(pref,id))]]
    851854                else:
    852                     constr += [[1.0,G2obj.G2VarObj('%s:%s'%(pref,id))]]
     855                    constr += [[1.0,G2obj.G2VarObj('%s:%s'%(pid+pref,id))]]
    853856            if not constr:
    854857                continue
Note: See TracChangeset for help on using the changeset viewer.