Changeset 4133


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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIscriptable.py

    r4128 r4133  
    108108:meth:`G2Project.set_Controls`                        Set overall GSAS-II control settings such as number of cycles and to set up a sequential
    109109                                                      fit. (Also see :meth:`G2Project.get_Controls` to read values.)
     110:meth:`G2Project.imageMultiDistCalib`                 Performs a global calibration fit with images at multiple distance settings.
    110111==================================================    ===============================================================================================================
    111112
     
    791792    gpx.refine() 
    792793
     794.. _ImageProc:
     795
    793796----------------------
    794797Image Processing
     
    848851        c = img.getControls()
    849852        print(c['distance'],c['wavelength'])
     853
     854.. _MultiDist_Example:
    850855
    851856This example performs a number of cycles of constrained fitting.
     
    28992904        This may produce a better result if run more than once.
    29002905
     2906        See :ref:`MultiDist_Example` for example code.
     2907
    29012908        :param str imageList: the images to include in the fit, if not specified
    29022909          all images in the project will be included.
     
    50245031    >>> imlst[0].setControl('outAzimuths',3)
    50255032    >>> pwdrList = imlst[0].Integrate()
     5033 
     5034    More detailed image processing examples are shown at :ref:`ImageProc`.
    50265035
    50275036    '''
  • 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.