Changeset 3599


Ignore:
Timestamp:
Sep 13, 2018 1:58:35 PM (3 years ago)
Author:
toby
Message:

remove vars from constraints (see G2obj.removeNonRefined); new tutorial

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIconstrGUI.py

    r3588 r3599  
    175175    globalList = list(rbDict.keys())
    176176    globalList.sort()
     177    globalList = G2obj.removeNonRefined(globalList)   # remove any non-refinable prms from list
    177178    try:
    178179        AtomDict = dict([Phases[phase]['pId'],Phases[phase]['Atoms']] for phase in Phases)
    179180    except KeyError:
    180181        G2frame.ErrorDialog('Constraint Error','Constraints cannot be set until a cycle of least squares'+
    181                             'has been run.\nWe suggest you refine a scale factor.')
     182                            ' has been run.\nWe suggest you refine a scale factor.')
    182183        return
    183184
     
    203204            phaseAtNames[item] = ''
    204205            phaseAtTypes[item] = ''
     206    phaseList = G2obj.removeNonRefined(phaseList)  # remove any non-refinable prms from list
    205207             
    206208    # create a list of the hist*phase variables
     
    221223            if sj not in wildList: wildList.append(sj)
    222224        hapList = wildList
     225    hapList = G2obj.removeNonRefined(hapList)  # remove any non-refinable prms from list
    223226    histVary,histDict,controlDict = G2stIO.GetHistogramData(histDict,Print=False)
    224     histList = []
    225     for item in histDict:
    226         if item.split(':')[2] not in ['Omega','Type','Chi','Phi',
    227                                       'Azimuth','Gonio. radius',
    228                                       'Lam1','Lam2','Back','Temperature','Pressure',
    229                                       'FreePrm1','FreePrm2','FreePrm3',
    230                                       ]:
    231             histList.append(item)
     227    histList = list(histDict.keys())
    232228    histList.sort()
    233229    if seqList: # convert histogram # to wildcard
     
    240236            if sj not in wildList: wildList.append(sj)
    241237        histList = wildList
     238    histList = G2obj.removeNonRefined(histList)  # remove any non-refinable prms from list
    242239    Indx = {}
    243240    G2frame.Page = [0,'phs']
  • trunk/GSASIIctrlGUI.py

    r3586 r3599  
    50535053     '''This shows how to get an initial estimate of background parameters from a suite of fixed points
    50545054     before beginning Rietveld refinement.'''],
     5055    ['RietPlot', 'PublicationPlot.htm', 'Create a Publication-Ready Rietveld Plot',
     5056     '''Shows how to create a customized version of a plot from a fit,
     5057     with enlarged letters, different colors or symbols which can be written
     5058     as a bitmap file, a pdf file or be exported to the Grace or Igor Pro
     5059     plotting programs.'''],
    50555060   
    50565061    ['Parametric sequential fitting'],
  • trunk/GSASIIobj.py

    r3597 r3599  
    15541554        reVarDesc[re.compile(key)] = value
    15551555
     1556def removeNonRefined(parmList):
     1557    '''Remove items from variable list that are not refined and should not
     1558    appear as options for constraints
     1559
     1560    :param list parmList: a list of strings of form "p:h:VAR:a" where
     1561      VAR is the variable name
     1562
     1563    :returns: a list after removing variables where VAR matches a
     1564      entry in local variable NonRefinedList
     1565    '''
     1566    NonRefinedList = ['Omega','Type','Chi','Phi', 'Azimuth','Gonio. radius',
     1567                          'Lam1','Lam2','Back','Temperature','Pressure',
     1568                          'FreePrm1','FreePrm2','FreePrm3',
     1569                          'Source','nPeaks','LeBail','newLeBail','Bank',
     1570                          'nDebye', #'',
     1571                    ]
     1572    return [prm for prm in parmList if prm.split(':')[2] not in NonRefinedList]
     1573       
    15561574def getDescr(name):
    15571575    '''Return a short description for a GSAS-II variable
  • trunk/help/Tutorials.html

    r3559 r3599  
    4040<blockquote><I>This shows how to get an initial estimate of background parameters from a suite of fixed points
    4141     before beginning Rietveld refinement.</I></blockquote>
     42<LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/RietPlot/PublicationPlot.htm">Create a Publication-Ready Rietveld Plot</A>
     43 [link: <A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/RietPlot/data">Exercise files</A>].
     44<blockquote><I>Shows how to create a customized version of a plot from a fit,
     45     with enlarged letters, different colors or symbols which can be written
     46     as a bitmap file, a pdf file or be exported to the Grace or Igor Pro
     47     plotting programs.</I></blockquote>
    4248</UL><h4>Parametric sequential fitting</H4><UL>
    4349<LI><A href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SeqRefine/SequentialTutorial.htm">Sequential refinement of multiple datasets</A>
Note: See TracChangeset for help on using the changeset viewer.