Ignore:
Timestamp:
Mar 6, 2019 12:16:47 PM (3 years ago)
Author:
toby
Message:

add timing for SeqRef?; error msg for unlinked hists in scriptable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrMain.py

    r3764 r3836  
    4545
    4646ateln2 = 8.0*math.log(2.0)
    47 DEBUG = True
    4847
    4948def RefineCore(Controls,Histograms,Phases,restraintDict,rigidbodyDict,parmDict,varyList,
     
    355354    if 'Seq Data' in Controls:
    356355        histNames = Controls['Seq Data']
    357     else:
     356    else: # patch from before Controls['Seq Data'] was implemented?
    358357        histNames = G2stIO.GetHistogramNames(GPXfile,['PWDR',])
    359358    if Controls.get('Reverse Seq'):
     
    365364    NewparmDict = {}
    366365    for ihst,histogram in enumerate(histNames):
     366        if GSASIIpath.GetConfigValue('debug'): t1 = time.time()
    367367        print('\nRefining with '+str(histogram))
    368368        ifPrint = False
     
    414414        # do constraint processing
    415415        #reload(G2mv) # debug
     416        if GSASIIpath.GetConfigValue('debug'):
     417            t2 = time.time()
     418            print("#1 debug time {:.2f} sec.".format(t2-t1))
     419            t1 = t2
    416420        G2mv.InitVars()
    417421        constrDict,fixedList = G2stIO.GetConstraints(GPXfile)
     422        if GSASIIpath.GetConfigValue('debug'):
     423            t2 = time.time()
     424            print("#2 debug time {:.2f} sec.".format(t2-t1))
     425            t1 = t2
    418426        varyListStart = tuple(varyList) # save the original varyList before dependent vars are removed
    419427        msg = G2mv.EvaluateMultipliers(constrDict,parmDict)
     
    475483        printFile.write('\n Refinement results for histogram: %s\n'%histogram)
    476484        printFile.write(135*'-'+'\n')
     485        if GSASIIpath.GetConfigValue('debug'):
     486            t2 = time.time()
     487            print("#3 debug time {:.2f} sec.".format(t2-t1))
     488            t1 = t2
    477489        if True:
    478490#        try:
     
    504516                'parmDict':parmDict}
    505517            SeqResult[histogram] = histRefData
     518            if GSASIIpath.GetConfigValue('debug'):
     519                t2 = time.time()
     520                print("#4 debug time {:.2f} sec.".format(t2-t1))
     521                t1 = t2
    506522            G2stMth.ApplyRBModels(parmDict,Phases,rigidbodyDict,True)
    507523    #        G2stIO.SetRigidBodyModels(parmDict,sigDict,rigidbodyDict,printFile)
     
    509525            G2stIO.SetHistogramData(parmDict,sigDict,Histo,None,ifPrint,printFile)
    510526            G2stIO.SetUsedHistogramsAndPhases(GPXfile,Histo,Phases,rigidbodyDict,histRefData,makeBack)
     527            if GSASIIpath.GetConfigValue('debug'):
     528                t2 = time.time()
     529                print("#5 debug time {:.2f} sec.".format(t2-t1))
     530                t1 = t2
    511531            makeBack = False
    512532            NewparmDict = {}
     
    527547#            print (' ***** Refinement aborted *****')
    528548#            return False,Msg.msg
     549        if GSASIIpath.GetConfigValue('debug'):
     550            t2 = time.time()
     551            print("#6 debug time {:.2f} sec.".format(t2-t1))
     552            t1 = t2
    529553    SeqResult['histNames'] = [itm for itm in G2stIO.GetHistogramNames(GPXfile,['PWDR',]) if itm in SeqResult.keys()]
    530554    G2stIO.SetSeqResult(GPXfile,Histograms,SeqResult)
Note: See TracChangeset for help on using the changeset viewer.