Ignore:
Timestamp:
Sep 3, 2019 10:29:15 PM (2 years ago)
Author:
toby
Message:

seq ref: copynext for phase parms or get from SeqRef? table

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrMain.py

    r4111 r4133  
    370370    SeqResult = G2stIO.GetSeqResult(GPXfile)
    371371#    SeqResult = {'SeqPseudoVars':{},'SeqParFitEqList':[]}
    372     makeBack = True
    373372    Histo = {}
    374373    NewparmDict = {}
     
    378377        G2fil.G2Print('\nRefining with '+str(histogram))
    379378        G2mv.InitVars()
    380         #print('before load',{i:phaseDict[i] for i in phaseDict if 'Ax:2' in i})
    381379        (Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,
    382380             FFtables,BLtables,MFtables,maxSSwave) = G2stIO.GetPhaseData(
    383381                 Phases,restraintDict,rbIds,
    384382                 Print=False,pFile=printFile,seqRef=True)
    385         #print('before fit ',{i:phaseDict[i] for i in phaseDict if 'Ax:2' in i})
    386383        ifPrint = False
    387384        if dlg:
     
    424421        parmDict.update(hapDict)
    425422        parmDict.update(histDict)
    426         if Controls['Copy2Next']:
     423        if Controls['Copy2Next']:   # update with parms from last histogram
    427424            #parmDict.update(NewparmDict) # don't use in case extra entries would cause a problem
    428425            for parm in NewparmDict:
    429426                if parm in parmDict:
    430427                    parmDict[parm] = NewparmDict[parm]
     428        elif histogram in SeqResult:  # update phase from last seq ref
     429            NewparmDict = SeqResult[histogram].get('parmDict',{})
     430            for parm in NewparmDict:
     431                if '::' in parm and parm in parmDict:
     432                    parmDict[parm] = NewparmDict[parm]
     433           
    431434        G2stIO.GetFprime(calcControls,Histo)
    432435        # do constraint processing
     
    526529            G2stIO.SetHistogramData(parmDict,sigDict,Histo,None,ifPrint,printFile)
    527530            G2stIO.SaveUpdatedHistogramsAndPhases(GPXfile,Histo,Phases,rigidbodyDict,histRefData)
    528             makeBack = False
    529531            NewparmDict = {}
    530532            # make dict of varied parameters in current histogram, renamed to
     
    535537                for parm in set(list(varyList)+list(varyListStart)):
    536538                    items = parm.split(':')
    537                     if len(items) < 3: continue
     539                    if len(items) < 3:
     540                        continue
    538541                    if str(hId) in items[1]:
    539542                        items[1] = str(nexthId)
    540543                        newparm = ':'.join(items)
    541544                        NewparmDict[newparm] = parmDict[parm]
     545                    else:
     546                        if items[2].startswith('dA'): parm = parm.replace(':dA',':A')
     547                        NewparmDict[parm] = parmDict[parm]
     548                   
    542549#        except G2obj.G2Exception(Msg):
    543550#            printFile.close()
    544551#            G2fil.G2Print (' ***** Refinement aborted *****')
    545552#            return False,Msg.msg
    546         #print('after fit',{i:parmDict[i] for i in parmDict if 'Ax:2' in i})
    547553        if GSASIIpath.GetConfigValue('Show_timing'):
    548554            t2 = time.time()
Note: See TracChangeset for help on using the changeset viewer.