Changeset 3390


Ignore:
Timestamp:
May 16, 2018 10:31:09 AM (5 years ago)
Author:
vondreele
Message:

fix issue with deleted phases in Restraints - they are now deleted from Restraints tree if selected
fix issue of a phase not used in any histogram - any set refine flags cause crash in refinement
now a phase is included in phase list if it is Used in any histogrsm - fixes to GetUsedHistogramsAndPhases? in G2strIO and GetUsedHistogramsAndPhasesfromTree? in G2dataGUI.
also some weird business in G2spc - had to swap two routines (SGProd & GetLittleGrpOps?) before debug in Spyder would load GSAS-II.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIdataGUI.py

    r3378 r3390  
    41844184            Phase['pId'] = pId
    41854185            if Phase['Histograms']:
    4186                 if phase not in Phases:
    4187                     Phases[phase] = Phase
    41884186                for hist in Phase['Histograms']:
    41894187                    if 'Use' not in Phase['Histograms'][hist]:      #patch: add Use flag as True
    41904188                        Phase['Histograms'][hist]['Use'] = True         
    41914189                    if hist not in Histograms and Phase['Histograms'][hist]['Use']:
     4190                        if phase not in Phases:
     4191                            Phases[phase] = Phase
    41924192                        item = GetGPXtreeItemId(self,self.root,hist)
    41934193                        if item:
     
    77427742        if phaseName not in data:
    77437743            data[phaseName] = {}
    7744         G2restG.UpdateRestraints(G2frame,data[phaseName],phaseName)
     7744        G2restG.UpdateRestraints(G2frame,data,phaseName)
    77457745    elif G2frame.GPXtree.GetItemText(item) == 'Comments':
    77467746        SetDataMenuBar(G2frame,G2frame.dataWindow.DataCommentsMenu)
  • trunk/GSASIIrestrGUI.py

    r3356 r3390  
    19071907
    19081908    # UpdateRestraints execution starts here
    1909     phasedata = G2frame.GetPhaseData()[phaseName]
    1910     restrData = data
     1909    try:
     1910        phasedata = G2frame.GetPhaseData()[phaseName]
     1911    except KeyError:        #delete unknown or previously deleted phases from Restraints
     1912        rId = G2gd.GetGPXtreeItemId(G2frame,G2frame.root,'Restraints')
     1913        pId = G2gd.GetGPXtreeItemId(G2frame,rId,phaseName)
     1914        G2frame.GPXtree.Delete(pId)
     1915        print('Unknown phase '+phaseName+' is deleted from Restraints')
     1916        return
     1917    restrData = data[phaseName]
    19111918    if 'Bond' not in restrData:
    19121919        restrData['Bond'] = {'wtFactor':1.0,'Range':1.1,'Bonds':[],'Use':True}
  • trunk/GSASIIspc.py

    r3387 r3390  
    17271727        print (l)
    17281728       
     1729def SGProd(OpA,OpB):
     1730    '''
     1731    Form space group operator product. OpA & OpB are [M,V] pairs;
     1732        both must be of same dimension (3 or 4). Returns [M,V] pair
     1733    '''
     1734    A,U = OpA
     1735    B,V = OpB
     1736    M = np.inner(B,A.T)
     1737    W = np.inner(B,U)+V
     1738    return M,W
     1739       
    17291740def GetLittleGrpOps(SGData,vec):
    17301741    ''' Find rotation part of operators that leave vec unchanged
     
    17431754            Little.append([M,T])
    17441755    return Little
    1745        
    1746 def SGProd(OpA,OpB):
    1747     '''
    1748     Form space group operator product. OpA & OpB are [M,V] pairs;
    1749         both must be of same dimension (3 or 4). Returns [M,V] pair
    1750     '''
    1751     A,U = OpA
    1752     B,V = OpB
    1753     M = np.inner(B,A.T)
    1754     W = np.inner(B,U)+V
    1755     return M,W
    17561756       
    17571757def MoveToUnitCell(xyz):
     
    19031903    return iabsnt,mulp,Uniq,phi
    19041904
    1905 def MagHKLchk(HKL,SGData):
    1906     SpnFlp = SGData['SpnFlp']
    1907     print(HKL)
    1908     Uniq = GenHKL(HKL,SGData)
     1905#def MagHKLchk(HKL,SGData):
     1906#    SpnFlp = SGData['SpnFlp']
     1907#    print(HKL)
     1908#    Uniq = GenHKL(HKL,SGData)
    19091909   
    19101910def checkSSLaue(HKL,SGData,SSGData):
  • trunk/GSASIIstrIO.py

    r3377 r3390  
    439439        if Phase['General']['Type'] == 'faulted': continue      #don't use faulted phases!
    440440        if Phase['Histograms']:
    441             if phase not in Phases:
    442                 pId = phaseNames.index(phase)
    443                 Phase['pId'] = pId
    444                 Phases[phase] = Phase
    445441            for hist in Phase['Histograms']:
    446442                if 'Use' not in Phase['Histograms'][hist]:      #patch
    447443                    Phase['Histograms'][hist]['Use'] = True         
    448444                if hist not in Histograms and Phase['Histograms'][hist]['Use']:
     445                    if phase not in Phases:
     446                        pId = phaseNames.index(phase)
     447                        Phase['pId'] = pId
     448                        Phases[phase] = Phase
    449449                    try:
    450450                        Histograms[hist] = allHistograms[hist]
Note: See TracChangeset for help on using the changeset viewer.