Changeset 5153


Ignore:
Timestamp:
Jan 23, 2022 9:53:57 PM (7 months ago)
Author:
toby
Message:

revamp of constraints New Var does not use dependent param vary flags; err/warnings revised; constraints display updated; add Constr help button; Shortcut: if only one phase is present, selection of Restraints opens that phase

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIconstrGUI.py

    r5137 r5153  
    739739            return False
    740740        elif warnmsg:
    741             print ('Unexpected contraint warning:\n'+warnmsg)
     741            print ('Warning after constraint addition:\n'+warnmsg)
     742            ans = G2G.ShowScrolledInfo(header='Constraint Warning',
     743                    txt='Warning noted after adding constraint:\n'+warnmsg+
     744                '\n\nKeep this addition?',
     745                buttonlist=[wx.ID_YES,wx.ID_NO],parent=G2frame,height=250)
     746            if ans == wx.ID_NO: return False
    742747        return True
    743748
     
    777782            return False
    778783        elif warnmsg:
    779             print ('Unexpected contraint warning:\n'+warnmsg)
     784            print ('Warning after constraint edit:\n'+warnmsg)
     785            ans = G2G.ShowScrolledInfo(header='Constraint Warning',
     786                    txt='Warning noted after last constraint edit:\n'+warnmsg+
     787                    '\n\nKeep this change?',
     788                    buttonlist=[wx.ID_YES,wx.ID_NO],parent=G2frame,height=250)
     789            if ans == wx.ID_NO: return False
    780790        return True
    781791             
     
    840850                    data[constrDictEnt] += newcons
    841851        dlg.Destroy()
    842         wx.CallAfter(OnPageChanged,None)
     852        #wx.CallAfter(OnPageChanged,None)
     853        wx.CallAfter(UpdateConstraints, G2frame, data, G2frame.constr.GetSelection(), True)
    843854       
    844855    def OnAddEquivalence(event):
     
    945956        dlg.Destroy()
    946957        WarnConstraintLimit()
    947         wx.CallAfter(OnPageChanged,None)
     958#        wx.CallAfter(OnPageChanged,None)
     959        wx.CallAfter(UpdateConstraints, G2frame, data, G2frame.constr.GetSelection(), True)
    948960                       
    949961    def FindNeighbors(phase,FrstName,AtNames):
     
    10451057                    data[constrDictEnt] += newcons
    10461058        WarnConstraintLimit()
    1047         wx.CallAfter(OnPageChanged,None)
     1059#        wx.CallAfter(OnPageChanged,None)
     1060        wx.CallAfter(UpdateConstraints, G2frame, data, G2frame.constr.GetSelection(), True)
    10481061                       
    10491062    def MakeConstraintsSizer(name,panel):
     
    11701183                            helptext += '\n\n'+ hlptxt
    11711184                    if item[-3]:
    1172                         typeString = '(NEWVAR) ' + str(item[-3]) + ' = '
     1185                        typeString = str(item[-3]) + ' ='
     1186                        if note: note += ', '
     1187                        note += '(NEW VAR)'
    11731188                    else:
    11741189                        typeString = 'New Variable = '
     
    12661281            else:
    12671282                constSizer.Add((-1,-1))
    1268             constSizer.Add(wx.StaticText(panel,wx.ID_ANY,typeString),0,WACV|wx.ALIGN_CENTER|wx.RIGHT|wx.LEFT,3)
     1283            if typeString.strip().endswith('='):
     1284                constSizer.Add(wx.StaticText(panel,wx.ID_ANY,typeString,style=wx.ALIGN_RIGHT),0,wx.EXPAND|wx.ALIGN_CENTER_VERTICAL,1)
     1285            else:
     1286                constSizer.Add(wx.StaticText(panel,wx.ID_ANY,typeString,style=wx.ALIGN_CENTER),0,wx.EXPAND|wx.ALIGN_CENTER_VERTICAL,1)
    12691287            #if badVar: eqString[-1] += ' -- Error: variable removed'
    12701288            #if note: eqString[-1] += '  (' + note + ')'
     
    12821300            constSizer.Add((3,3))
    12831301            if note:
    1284                 Eq = wx.StaticText(panel,wx.ID_ANY,note)
     1302                Eq = wx.StaticText(panel,wx.ID_ANY,note,
     1303                                             style=wx.ALIGN_CENTER)
    12851304                if problemItem: Eq.SetBackgroundColour(wx.YELLOW)
    12861305            else:
    12871306                Eq = (-1,-1)
    1288             constSizer.Add(Eq,1,WACV,3)
     1307            constSizer.Add(Eq,1,wx.EXPAND|wx.ALIGN_CENTER_VERTICAL,3)
    12891308        if panel.delBtn.checkboxList:
    12901309            panel.delBtn.Enable(True)
     
    13161335            else:
    13171336                varname = ""
    1318             lbl = 'Enter value for each term in constraint; sum = new variable'
     1337            lbl = 'Enter multiplier for each parameter in the New Var expression'
    13191338            dlg = ConstraintDialog(G2frame,constType,lbl,items,
    13201339                varname=varname,varyflag=data[name][Id][-2])
     
    13871406            butSizer.Add(btn,0,wx.ALIGN_CENTER_VERTICAL)
    13881407            btn.Bind(wx.EVT_BUTTON,lambda event:
    1389                          G2G.ShowScrolledInfo(panel,
    1390                         '*** Constraints after processing ***\n'+G2mv.VarRemapShow(),
    1391                          header='Generated constraints'))
     1408                         G2G.ShowScrolledColText(panel,
     1409                        '*** Constraints after processing ***'+G2mv.VarRemapShow(linelen=999),
     1410                         header='Generated constraints',col1len=80))
    13921411            panel.delBtn = wx.Button(panel, wx.ID_ANY, 'Delete selected')
    13931412            butSizer.Add(panel.delBtn,0,wx.ALIGN_CENTER_VERTICAL)
    13941413            panel.delBtn.Bind(wx.EVT_BUTTON,OnConstDel)
    13951414            panel.delBtn.checkboxList = []
     1415            butSizer.Add((-1,-1),1,wx.EXPAND,1)
     1416            butSizer.Add(G2G.HelpButton(panel,helpIndex='Constraints'))
     1417            Siz.Add(butSizer,0,wx.EXPAND)
    13961418            if G2frame.testSeqRefineMode():
    1397                 Siz.Add(butSizer)
    13981419                butSizer = wx.BoxSizer(wx.HORIZONTAL)
    13991420                butSizer.Add(wx.StaticText(panel,wx.ID_ANY,'  Sequential Ref. Settings.  Wildcard use: '),0,WACV)
     
    14091430                        lambda x: wx.CallAfter(UpdateConstraints, G2frame, data, G2frame.constr.GetSelection(), True))
    14101431                butSizer.Add(btn,0,wx.ALIGN_CENTER_VERTICAL)
    1411             Siz.Add(butSizer)
     1432                Siz.Add(butSizer,0)
    14121433            G2G.HorizontalLine(Siz,panel)
    14131434#            Siz.Add((5,5),0)
  • trunk/GSASIIctrlGUI.py

    r5149 r5153  
    8585:func:`G2MessageBox`               Displays text typically used for errors or warnings.
    8686:func:`ShowScrolledInfo`           Displays longer text where scrolling is possibly needed
     87:func:`ShowScrolledColText`        Displays tabular text with scrolling where needed
    8788:func:`GetItemOrder`               Creates a dialog for ordering items into columns
    8889:func:`GetImportFile`              Gets one ore more file from the appropriate import
     
    24222423    dlg.Destroy()
    24232424
    2424 def ShowScrolledInfo(parent,txt,width=600,height=400,header='Warning info'):
     2425def ShowScrolledInfo(parent,txt,width=600,height=400,header='Warning info',
     2426                         buttonlist=None):
    24252427    '''Simple code to display possibly extensive error or warning text
    24262428    in a scrolled window.
     
    24302432    :param int width: lateral of window in pixels (defaults to 600)
    24312433    :param int height: vertical dimension of window in pixels (defaults to 400)
    2432     :param str header: width of window in pixels (defaults to 600)
     2434    :param str header: title to be placed on window
     2435    :param list buttonlist: list of button Ids to show. The default is None
     2436      which places a single "Close" button and returns wx.ID_CANCEL
     2437    :returns: the wx Id for the selected button
    24332438    '''
    24342439   
     
    24432448    txt.SetBackgroundColour(wx.WHITE)
    24442449    txtSizer.Add(txt,1,wx.ALL|wx.EXPAND,1)
     2450    spanel.SetSizer(txtSizer)
     2451    btnsizer = wx.BoxSizer(wx.HORIZONTAL)
     2452    if buttonlist is None:
     2453        btn = wx.Button(dlg, wx.ID_CLOSE)
     2454        btn.Bind(wx.EVT_BUTTON,lambda event: dlg.EndModal(wx.ID_CANCEL))
     2455        btnsizer.Add(btn)
     2456    else:
     2457        for b in buttonlist:
     2458            btn = wx.Button(dlg, b)
     2459            btn.Bind(wx.EVT_BUTTON,lambda event: dlg.EndModal(event.Id))
     2460            btnsizer.Add(btn)
     2461    mainSizer.Add(btnsizer, 0, wx.ALIGN_CENTER|wx.ALL, 5)
     2462    dlg.SetSizer(mainSizer)
     2463    mainSizer.Fit(dlg)
     2464    spanel.SetAutoLayout(1)
     2465    spanel.SetupScrolling()
     2466    #dlg.SetMaxSize((-1,400))
     2467    dlg.CenterOnParent()
     2468    ans = dlg.ShowModal()
     2469    dlg.Destroy()
     2470    return ans
     2471
     2472def ShowScrolledColText(parent,txt,width=600,height=400,header='Warning info',col1len=999):
     2473    '''Simple code to display tabular information in a scrolled wx.Dialog
     2474    window.
     2475
     2476    Lines ending with a colon (:) are centered across all columns
     2477    and have a grey background.
     2478    Lines beginning and ending with '**' are also are centered
     2479    across all columns and are given a yellow background
     2480    All other lines have columns split by tab (\\t) characters.
     2481
     2482    :param wx.Frame parent: parent window
     2483    :param str txt: text to be displayed
     2484    :param int width: lateral of window in pixels (defaults to 600)
     2485    :param int height: vertical dimension of window in pixels (defaults to 400)
     2486    :param str header: title to be placed on window
     2487    '''
     2488   
     2489    dlg = wx.Dialog(parent.GetTopLevelParent(),wx.ID_ANY,header, style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)
     2490    spanel = wxscroll.ScrolledPanel(dlg, wx.ID_ANY, size=(width-20, height))
     2491    mainSizer = wx.BoxSizer(wx.VERTICAL)
     2492    mainSizer.Add(spanel,1,wx.ALL|wx.EXPAND,1)
     2493
     2494    cols = 1
     2495    for i,line in enumerate(txt.split('\n')):
     2496        cols = max(cols,line.count('\t')+1)
     2497
     2498    txtSizer = wx.GridBagSizer()
     2499    for i,line in enumerate(txt.split('\n')):
     2500        if line.strip().endswith(':'):
     2501            st = wx.StaticText(spanel,wx.ID_ANY,line,style=wx.ALIGN_CENTER)
     2502            txtSizer.Add(st,pos=(i,0),span=(0,cols),flag=wx.EXPAND)
     2503            continue
     2504        elif line.strip().startswith('**') and line.strip().endswith('**'):
     2505            st = wx.StaticText(spanel,wx.ID_ANY,line)
     2506            st.SetBackgroundColour(DULL_YELLOW)
     2507            txtSizer.Add(st,pos=(i,0),span=(0,cols),flag=wx.EXPAND)
     2508            continue
     2509        items = line.split('\t')
     2510        for col in range(cols):
     2511            if col < len(items):
     2512                item = items[col].strip()
     2513            else:
     2514                item = ''
     2515            t = item[:]
     2516            s = ''
     2517            #if len(t) > col1len: GSASIIpath.IPyBreak()
     2518            while col == 0 and len(t) > col1len:
     2519                b = -1
     2520                for sym in (') ',' * ',' + ',' - '):
     2521                    if sym in t[:col1len]:
     2522                        b = max(b,t.rfind(sym,0,col1len)+len(sym))
     2523                s += t[:b] + '\n\t'
     2524                t = t[b:]
     2525            s += t
     2526            st = wx.StaticText(spanel,wx.ID_ANY,s)
     2527            if col == 0: st.Wrap(600)
     2528            st.SetBackgroundColour(wx.WHITE)
     2529            txtSizer.Add(st,pos=(i,col),flag=wx.EXPAND)
     2530        txtSizer.AddGrowableRow(i)
     2531    txtSizer.AddGrowableCol(1)
    24452532    spanel.SetSizer(txtSizer)
    24462533    btnsizer = wx.BoxSizer(wx.HORIZONTAL)
     
    24572544    dlg.ShowModal()
    24582545    dlg.Destroy()
    2459 
     2546   
    24602547################################################################################
    24612548class PickTwoDialog(wx.Dialog):
     
    76597746
    76607747if __name__ == '__main__':
    7661     app = wx.PySimpleApp()
     7748    app = wx.App()
    76627749    GSASIIpath.InvokeDebugOpts()
    76637750    frm = wx.Frame(None) # create a frame
    76647751    frm.Show(True)
     7752    warnmsg = '\nsome info\non a few lines\nand one more'
     7753    choices = [wx.ID_YES,wx.ID_NO]
     7754    ans = ShowScrolledInfo(header='Constraint Warning',
     7755                    txt='Warning noted after last constraint edit:\n'+warnmsg+
     7756                    '\n\nKeep this change?',
     7757                    buttonlist=choices,parent=frm,height=250)
     7758    print(ans, choices)
     7759    import sys; sys.exit()
    76657760   
    76667761    #======================================================================
  • trunk/GSASIIdataGUI.py

    r5151 r5153  
    77977797                if name not in data:
    77987798                    data[name] = {}
    7799 #end patch           
    7800             G2frame.dataWindow.GetSizer().Add(
    7801                 wx.StaticText(G2frame.dataWindow,wx.ID_ANY,'Select one phase to see its restraints'))
     7799#end patch
     7800            if len(G2frame.GetPhaseNames()) == 1: # why force choice of a phase if there is only one?
     7801                item, cookie = G2frame.GPXtree.GetFirstChild(item)
     7802                phaseName = G2frame.GPXtree.GetItemText(item)
     7803                if phaseName not in data:
     7804                    data[phaseName] = {}
     7805                G2restG.UpdateRestraints(G2frame,data,phaseName)
     7806            else:
     7807                G2frame.GPXtree.Expand(item)
     7808                G2frame.dataWindow.GetSizer().Add(
     7809                    wx.StaticText(G2frame.dataWindow,wx.ID_ANY,'Select one phase to see its restraints'))
    78027810        elif G2frame.GPXtree.GetItemText(item).startswith('Hist/Phase'):
    78037811            #import imp
  • trunk/GSASIImapvars.py

    r5149 r5153  
    360360
    361361   For "**Hold**" entries,
    362      the “Hold” constraints are stored in global variables :data:`holdParmList` by calling
    363      :func:`StoreHold`; holds that are generated by this code are stored in :data:`newHolds`.
     362     User-supplied “Hold” constraints are stored in global variable :data:`holdParmList`.
     363     Initialized in :func:`InitVars`; set in :func:`StoreHold`. Type of hold is stored in
     364     :data:`holdParmType`.
    364365
    365366   **Equivalences** are stored using :func:`StoreEquivalence` into this module's globals
     
    410411Constraints cannot be processed without changes if any of the terms within have the following:
    411412
    412 * **Hold (Fixed) parameters**; **Unvaried parameters**; **Multiplier of zero**
    413 
    414   If all parameters in a constraint are either not refined, or are marked as "Hold", or have a multiplier
    415   that evaluates as 0.0, the constraint can be ignored.
    416 
    417   If all but one parameter in a constraint are either not refined, or are marked as "Hold", or have a multiplier
    418   that evaluates as 0.0, the constraint determines a static value for the parameter. The appropriate
    419   constant values are substituted into the constraint equation and the one remaining parameter
    420   is set as "Hold".
    421 
    422   If two or more parameter remain in a constraint after removing parameters that are not refined, or
    423   are marked as "Hold", or have a multiplier that evaluates as 0.0, the constraint can still be used.
    424   The appropriate constant values are substituted into the constraint equation, any zero multiplier
    425   terms set as "Hold" and the remaining terms in the constraint are used.
    426 
    427 * **Undefined parameters**
    428 
    429   If all parameters in a constraint are undefined, the constraint can be ignored.
    430 
    431   If some, but not all, parameters in a constraint are undefined, the constraint cannot be processed.
    432   The remaining parameters will be set as "Hold" and the constraint will be ignored. One exception:
    433   atom position constraints (p::dA[xyz]:#) will be assumed as zero.
     413* **Undefined parameters** or **Multiplier of zero**
     414
     415  If any parameters in a constraint are undefined or have a parameter multiplier of zero
     416  the constraint group is not used.
     417
     418  If some, but not all, parameters in a constraint are undefined or have a parameter
     419  multiplier of zero and remaining valid parameters will be set as "Hold".
     420  One exception: atom position constraints (p::dA[xyz]:#) will be assumed as zero.
     421
     422* **Hold (Fixed) parameters** and **Unvaried parameters**: New Var constraints
     423
     424  If any parameters in a new var constraint are either not refined, or are marked as "Hold"
     425  the constraint can not be varied. Any parameters in that group will be set as "Hold"
     426
     427* **Hold (Fixed) parameters** and **Unvaried parameters**: Constraint Equations
     428
     429  If any parameters in a constraint equation are either not refined, or are marked as "Hold"
     430  those parameters can be removed from the constraint, with an adjustment of the equation
     431  sum. 
    434432
    435433Constraint expressions ("Const" and "New Var") are sorted by routine :func:`GroupConstraints` into
     
    712710  variable                       explanation
    713711=============================  ===================================================================
    714 :data:`holdParmList`             a list of parameters that have been marked as "Hold".
    715                                  Unlikely to be used externally.                                 
    716                                  Set in :func:`StoreHold`. (Also see :data:`newHolds`)
     712:data:`holdParmList`             a list of parameters that have been marked as "Hold".
     713                                 Unlikely to be accessed outside this module.
     714                                 Initialized in :func:`InitVars`; set in :func:`StoreHold`.
     715
     716:data:`holdParmType`             The reason why a parameter has been marked as "Hold".
     717                                 Unlikely to be accessed outside this module.
     718                                 Initialized in :func:`InitVars`; set in :func:`StoreHold`.
    717719
    718720:data:`dependentVars`            a list of dependent variables in equivalences, compiled
     
    765767:data:`multdepVarList`          parameters used as dependent parameters in equivalences
    766768                                multiple times
    767 
    768 :data:`newHolds`                parameters to be added as "Hold"s
    769769
    770770:data:`unvariedParmsList`       parameters used in equivalences and constraints
     
    830830Set in :func:`StoreHold`. Initialized in :func:`InitVars`.
    831831'''
     832holdParmType = {}
     833'''The reason why a parameter has been marked as "Hold".
     834Initialized in :func:`InitVars`; set in :func:`StoreHold`.
     835'''
    832836dependentVars = []
    833837'''A list of dependent variables in equivalences, compiled from (:data:`dependentParmList`).
     
    861865multdepVarList = []
    862866'parameters used as dependents multiple times in equivalences'
    863 newHolds = []
    864 'parameters that will be added as "Hold"s based on use in equivalences and constraints'
    865867unvariedParmsList = []
    866868'parameters used in equivalences that are not varied'
     
    896898    consNum = 0 # number of the next constraint to be created
    897899    symGenList = [] # Flag if constraint is generated by symmetry
    898     global holdParmList
     900    global holdParmList,holdParmType
    899901    holdParmList = []
     902    holdParmType = {}
    900903
    901904def VarKeys(constr):
     
    10101013            warninfo['shown'] = cdict
    10111014            if warninfo['msg']: warninfo['msg'] += '\n'
    1012             warninfo['msg'] += '\nProblem with constraint: ' + _FormatConstraint(cdict,val)
     1015            if '_vary' in cdict:
     1016                warninfo['msg'] += '\nProblem with new var expression: ' + _FormatConstraint(cdict,cdict.get('_name','New Var'))
     1017            else:
     1018                warninfo['msg'] += '\nProblem with constraint equation: ' + _FormatConstraint(cdict,val)
    10131019        if warninfo['msg']: warninfo['msg'] += '\n'
    10141020        warninfo['msg'] += '  ' + msg
     
    10181024    global undefinedVars # parameters that are used in equivalences but are not defined
    10191025    undefinedVars = []
    1020     global newHolds # additional parameters that should be held
    1021     newHolds = []
    10221026    global groupErrors # parameters in constraints that cause grouping errors
    10231027    groupErrors = []
     
    10431047    # Hold, Unvaried & Undefined parameters
    10441048    skipList = []
     1049    invalidParms = []
    10451050    for cnum,(cdict,fixVal) in enumerate(zip(constrDict,fixedList)):
    10461051        valid = 0          # count of good parameters
     
    10891094                      (noWildcardList,"wildcard in non-sequential fit"),
    10901095                      (notDefList,"not defined")):
    1091             if l:
     1096            if l and cdict.get('_vary',True): # true for constr eq & varied New Var
    10921097                msg = "parameter(s) " + m + ': '
    10931098                for i,v in enumerate(l):
     
    10991104            skipList.append(cnum)
    11001105        elif problem: # mix of valid & refined and undefined items, cannot use this
    1101             warn('Invalid constraint',cdict)
    1102             skipList.append(cnum)
    1103             newHolds += [i for i in VarKeys(cdict) if i not in newHolds]
     1106            if cdict.get('_vary',True): # true for constr eq & varied New Var
     1107                warn('New Var constraint will be ignored',cdict)
     1108                skipList.append(cnum)
     1109            invalidParms += VarKeys(cdict)
    11041110        elif len(dropList) > 0: # mix of valid and problematic items, drop problem vars, but keep rest
    11051111            if GSASIIpath.GetConfigValue('debug'):
     
    11251131            del fixedList[i]
    11261132           
     1133    for i in invalidParms: StoreHold(i,"Used in invalid constraint")
    11271134    if warning: warning += '\n'
    11281135    warning += warninfo['msg']
     
    11911198                hasNewVar = True # there a New Var relationship in this group
    11921199                break
    1193         else: # only constraint equations, check for unvaried parameters in
     1200        else: # only constraint equations, check for unvaried parameters in one
    11941201            unvaried = False
    11951202            # this should not happen as they should have been removed
     
    11991206                    break
    12001207            if unvaried: # something is not varied: skip group & remove all parameters from varyList
    1201                 for var in depPrmList:
    1202                     if var not in newHolds: newHolds.append(var)
     1208                for var in depPrmList: StoreHold(var,'Unexpected: mixed use')
    12031209                if GSASIIpath.GetConfigValue('debug'):
    12041210                    print('Unexpected: Constraint group ignored (some parameters unvaried)')
     
    12301236                    consNum += 1
    12311237                    maplist.append(varname)
    1232             for var in depPrmList:
    1233                 if var not in newHolds: newHolds.append(var)
     1238            for var in depPrmList: StoreHold(var,'New Var use')
    12341239        # keep this group
    12351240        dependentParmList.append(depPrmList)
     
    12581263        for mv in varlist:
    12591264            if mv not in dependentVars: dependentVars.append(mv)
    1260             if mv not in newHolds: newHolds.append(mv)
     1265            StoreHold(mv,'dependent param')
    12611266    saveVaryList = copy.copy(varyList)  # save varyList so it can be used within module
    12621267
     
    12911296   
    12921297    warninfo = {'msg':'', 'shown':-1}
    1293     def warn(msg,cnum=None):
     1298    def warnEqv(msg,cnum=None):
    12941299        if cnum is not None and cnum != warninfo['shown']:
    12951300            warninfo['shown'] = cnum
     
    13001305        warninfo['msg'] += '  ' + msg
    13011306
    1302     global holdParmList # parameters set as "Hold"
    13031307    global depVarList # parameters used in equivalences as dependent parameters
    13041308    global indepVarList # parameters used in equivalences as independent parameters
     
    13071311    # lists of parameters used for error reporting
    13081312    global undefinedVars # parameters that are used in equivalences but are not defined
    1309     global newHolds # additional parameters that should be held
    13101313    global convVarList # parameters in equivalences that will be converted to constraints
    13111314    convVarList = [] # parameters in equivalences to be made into constraints
     
    13681371                    changed = True
    13691372                    msg = True
    1370                     warn("Independent parameter "+str(v)+' used in constraint',cnum)
     1373                    warnEqv("Independent parameter "+str(v)+' used in constraint',cnum)
    13711374                    if cnum not in convertList: convertList.append(cnum)
    13721375            for v in varlist:
     
    13741377                    changed = True
    13751378                    msg = True
    1376                     warn("Dependent parameter "+str(v)+' repeated',cnum)
     1379                    warnEqv("Dependent parameter "+str(v)+' repeated',cnum)
    13771380                    if cnum not in convertList: convertList.append(cnum)
    13781381                elif v in indepVarList:
    13791382                    changed = True
    13801383                    msg = True
    1381                     warn("Dependent parameter "+str(v)+' used elsewhere as independent',cnum)
     1384                    warnEqv("Dependent parameter "+str(v)+' used elsewhere as independent',cnum)
    13821385                    if cnum not in convertList: convertList.append(cnum)
    13831386                elif v in constrVarList+convVarList:
    13841387                    changed = True
    13851388                    msg = True
    1386                     warn("Dependent parameter "+str(v)+' used in constraint',cnum)
     1389                    warnEqv("Dependent parameter "+str(v)+' used in constraint',cnum)
    13871390                    if cnum not in convertList: convertList.append(cnum)
    13881391            if msg:
    1389                 warn('Converting to "Constr"',cnum)
     1392                warnEqv('Converting to "Constr"',cnum)
    13901393           
    13911394    global unvariedParmsList
     
    14071410        if gotHold:
    14081411            if holdList:
    1409                 msg = 'Some parameters set as "Hold"; setting remainder as "Hold": '
     1412                msg = '  Some parameters set as "Hold"; setting remainder as "Hold": '
    14101413                for i,var in enumerate(holdList):
    14111414                    if i != 0: msg += ", "
    14121415                    msg += var
    1413                 newHolds += [i for i in holdList if i not in newHolds]
    1414                 msg += ". "
     1416                    StoreHold(var,'Equiv fixed')
    14151417            else:
    1416                 msg = 'All parameters set as "Hold". '
    1417             msg += "\n Ignoring equivalence"
    1418             warn(msg,cnum)
     1418                msg = '  All parameters set as "Hold" '
     1419            msg += "\n   and ignoring equivalence"
     1420            warnEqv(msg,cnum)
    14191421            removeList.append(cnum)
    14201422            continue
     
    14331435        if gotNotVary:  # at least some unvaried parameters
    14341436            if gotVary:  # mix of varied and unvaried parameters
    1435                 msg = 'Some parameters not varied; setting remainder as "Hold": '
     1437                msg = '\nSome parameters not varied; setting remainder as "Hold": '
    14361438                for i,var in enumerate(holdList):
    14371439                    if i != 0: msg += ", "
    14381440                    msg += var
    1439                 newHolds += [i for i in holdList if i not in newHolds]
    1440                 msg += ". "
     1441                    StoreHold(var,'Equiv fixed')
    14411442            else:
    1442                 msg = 'No parameters varied. '               
    1443             msg += "\n Ignoring equivalence"
    1444             warn(msg,cnum)
     1443                msg = 'No parameters varied '
     1444            msg += "\nand ignoring equivalence"
     1445            warnEqv(msg,cnum)
    14451446            removeList.append(cnum)
    14461447            continue
     
    14551456                drop += 1
    14561457            elif m == 0:
    1457                 warn("Parameter "+str(v)+" has a zero multiplier, dropping",cnum)
     1458                warnEqv("Parameter "+str(v)+" has a zero multiplier, dropping",cnum)
    14581459                if v not in dropVarList: dropVarList.append(v)
    14591460                drop += 1
     
    14611462                holdList.append(v)
    14621463        if drop == len(varlist):
    1463             warn("No dependent parameters defined, ignoring equivalence",cnum)
     1464            warnEqv("No dependent parameters defined, ignoring equivalence",cnum)
    14641465            removeList.append(cnum)
    14651466            continue
     
    14791480                    if i != 0: msg += ", "
    14801481                    msg += var
    1481                 warn(msg,cnum)
     1482                warnEqv(msg,cnum)
    14821483                drop += 1
    14831484        if drop: # independent var and at least one dependent variable is defined
     
    14891490                    i += 1
    14901491                    msg += v
    1491             warn(msg,cnum)
     1492            warnEqv(msg,cnum)
    14921493            msg = "Some parameters not defined. Setting holds for: "
    14931494            for i,var in enumerate(holdList):
    14941495                if i != 0: msg += ", "
    14951496                msg += var
    1496             warn(msg,cnum)
    1497             newHolds += [i for i in holdList if i not in newHolds]
     1497                StoreHold(var,'Equiv fixed')
     1498            warnEqv(msg,cnum)
    14981499   
    14991500    # Convert equivalences where noted
     
    15811582        if constr[-1] == 'h':
    15821583            # process a hold
    1583             var = str(term[0][1])
     1584            var = str(terms[0][1])
    15841585            if '?' not in var:
    1585                 StoreHold(var)
     1586                StoreHold(var,'User supplied')
    15861587            else:
    15871588                ignored += 1
     
    15961597                if '?' not in var:
    15971598                    D[var] = term[0]
    1598             if len(D) > 1:
    1599                 # add extra dict terms for input variable name and vary flag
    1600                 if varname is None: # no assigned name, create one
    1601                     global consNum
    1602                     varname = str(consNum)
    1603                     consNum += 1
    1604                 else:
    1605                     varname = str(varname) # in case this is a G2VarObj
    1606                 if '::' in varname:
    1607                     D['_name'] = varname.replace('::','::nv-')
    1608                 else:
    1609                     D['_name'] = '::nv-' + varname
    1610                 D['_name'] = G2obj.MakeUniqueLabel(D['_name'],namedVarList)
    1611                 D['_vary'] = varyFlag == True # force to bool
    1612                 constrDict.append(D)
     1599            # add extra dict terms for input variable name and vary flag
     1600            if varname is None: # no assigned name, create one
     1601                global consNum
     1602                varname = str(consNum)
     1603                consNum += 1
    16131604            else:
    1614                 ignored += 1
    1615             #constFlag[-1] = ['Vary']
     1605                varname = str(varname) # in case this is a G2VarObj
     1606            if '::' in varname:
     1607                D['_name'] = varname.replace('::','::nv-')
     1608            else:
     1609                D['_name'] = '::nv-' + varname
     1610            D['_name'] = G2obj.MakeUniqueLabel(D['_name'],namedVarList)
     1611            D['_vary'] = varyFlag == True # force to bool
     1612            constrDict.append(D)
    16161613        elif constr[-1] == 'c':
    16171614            # process a constraint equation
     
    16471644    return constrDict,fixedList,ignored
    16481645
    1649 def StoreHold(var,symGen=False):
     1646def StoreHold(var,holdType=None):
    16501647    '''Takes a variable name and prepares it to be removed from the
    16511648    refined variables.
     
    16551652    by symmetry.
    16561653    '''
    1657     global holdParmList
     1654    global holdParmList,holdParmType
    16581655    if var not in holdParmList:
    16591656        holdParmList.append(var)
    1660 
     1657        if holdType: holdParmType[var] = holdType
    16611658   
    16621659def StoreEquivalence(independentVar,dependentList,symGen=True):
     
    19621959        s = ''
    19631960        for m,v in terms:
    1964             if v in holdParmList:
     1961            if v in holdParmList and (
     1962                    "User supplied" in holdParmType.get(v,'') or
     1963                    "symmetry" in holdParmType.get(v,'') or
     1964                    "rigid body" in holdParmType.get(v,'')):
    19651965                if s: s += ', '
    19661966                s += str(v)
    19671967        if s:
    19681968            if msg: msg += '; '
    1969             msg += "Parameters set as Hold: "+s
    1970             return False,msg,'Has holds: Nothing varied.'
     1969            msg += "Parameter(s) set as Hold: "+s
     1970            msg += "\nThis equivalence will be ignored; all parameters are held."
     1971            return False,msg,'Has holds: Not varied.'
    19711972               
    19721973        # unrefined parameters
     
    20132014        if v in unvariedParmsList: return False,"Parameter is not refined","Ignored"
    20142015    else:
    2015         # check for post-grouping errors
     2016        # check for post-grouping errors in new var & constr. eq. groups
    20162017        for m,v in terms:
    20172018            if v in groupErrors:
    20182019                return True,'Constraint singularity: see error listing','Singular'
    20192020        zeroList = []
    2020         tobeHold = []
     2021        toBeUsed = []
    20212022        undef = []
    20222023        unvar = []
    20232024        hold = []
    20242025        for m,v in terms: # check for zero multiplier, undefined, unvaried or hold
    2025             if m == 0:
    2026                 zeroList.append(str(v))
    2027             elif v in undefinedVars:
    2028                 undef.append(str(v))
    2029             elif v in unvariedParmsList and not (constrLst[-1] == 'f' and constrLst[-2]):
    2030                 unvar.append(str(v))
    2031             elif v in holdParmList:
    2032                 hold.append(str(v))
    2033             else:
    2034                 tobeHold.append(str(v))
     2026            if constrLst[-1] == 'f':    # new var expressions;
     2027                if m == 0:
     2028                    zeroList.append(str(v))
     2029                elif v in undefinedVars:
     2030                    undef.append(str(v))
     2031                elif (v in holdParmList and constrLst[-2] and
     2032                        "User supplied" in holdParmType.get(v,'') or
     2033                        "symmetry" in holdParmType.get(v,'') or
     2034                        "rigid body" in holdParmType.get(v,'')):                       
     2035                    hold.append(str(v))
     2036            else:                        # constraint equation
     2037                if m == 0:
     2038                    zeroList.append(str(v))
     2039                elif v in undefinedVars:
     2040                    undef.append(str(v))
     2041                elif v in unvariedParmsList:
     2042                    unvar.append(str(v))
     2043                elif v in holdParmList and holdParmType.get(v,'') != 'dependent param':
     2044                    hold.append(str(v))
     2045                else:
     2046                    toBeUsed.append(str(v))
     2047
    20352048        s = ''
    20362049        for v in zeroList:
     
    20532066        if s:
    20542067            if msg: msg += '; '
    2055             msg += "Unrefined parameter(s): "+s
     2068            msg += "Unrefined parameter(s) will be dropped: "+s
    20562069        s = ''
    20572070        for v in hold:
     
    20612074            if msg: msg += '; '
    20622075            msg += '"Hold" parameter(s): '+s
    2063         if undef and tobeHold:
     2076        if hold and constrLst[-1] == 'f':
     2077            if msg: msg += '; '
     2078            msg += "\nNew var with holds cannot be processed; constraint ignored."
     2079            note = 'Ignored'
     2080        elif undef and toBeUsed:
    20642081            s = ''
    2065             for v in tobeHold:
     2082            for v in toBeUsed:
    20662083                if s: s += ', '
    20672084                s += str(v)
     
    20692086            msg += "Adding Holds on "+s+"; Constraint Ignored."
    20702087            note = 'Ignored'
    2071         elif undef or (len(tobeHold) == 0 and (zeroList or unvar or hold)):
     2088        elif undef or (len(toBeUsed) == 0 and (zeroList or unvar or hold)):
    20722089            if msg: msg += '; '
    2073             msg += "Constraint Ignored."
     2090            msg += "No parameters remain. Constraint Ignored."
    20742091            note = 'Ignored'
    2075         elif len(tobeHold) == 1 and (zeroList or unvar or hold):
     2092        elif len(toBeUsed) == 1 and (zeroList or unvar or hold):
    20762093            if msg: msg += '; '
    20772094            msg += "One parameter is retained; converted to fixed value."
     
    20792096        elif zeroList or unvar or hold:
    20802097            if msg: msg += ': '
    2081             msg += 'Will be dropped. Constraint retained.'
    2082             note = 'Parameters removed'
     2098            msg += '\nConstraint adjusted for fixed values and retained.'
     2099            note = 'Parameter(s) removed'
    20832100    return False,msg,note
    20842101       
     
    21412158    s1 = ''
    21422159    for s2 in s:
    2143         if s1 != '': s1 += '\n\t'
     2160        if s1 != '': s1 += '\n  '
    21442161        s1 += s2
    21452162    return s1
     
    21712188    return s1
    21722189
    2173 def VarRemapShow(varyList=None,inputOnly=False):
     2190def VarRemapShow(varyList=None,inputOnly=False,linelen=60):
    21742191    '''List out the saved relationships. This should be done after the constraints have been
    21752192    defined using :func:`StoreEquivalence`, :func:`GroupConstraints` and :func:`GenerateConstraints`.
     
    21802197        varyList = saveVaryList
    21812198    s = ''
    2182     if len(holdParmList) > 0:
    2183         s += '\nUser-supplied Fixed Parameters:\n'
    2184         for v in holdParmList:
     2199    if len(dependentVars) > 0:
     2200        s += '\nDependent parameters, determined by constraints (also set as Hold):\n'
     2201        for v in sorted(dependentVars):
    21852202            s += '    ' + v + '\n'
    2186     if len(newHolds) > 0:
    2187         s1 = ''
    2188         s2 = ''
    2189         for v in newHolds:
    2190             if v in dependentVars:
    2191                 s1 += '    ' + v + '\n'
    2192             else:
    2193                 s2 += '    ' + v + '\n'
    2194         if s2:
    2195             s += '\nParameters to be Fixed based on constraints:\n'
    2196             s += s2
    2197         if s1:
    2198             s += '\nDependent parameters with values to be set from constraints:\n'
    2199             s += s1
     2203    first = True
     2204    for v in sorted(holdParmList):
     2205        if v in dependentVars: continue
     2206        if v in holdParmType: v += '\t'+holdParmType[v]
     2207        if first:
     2208            s += '\nParameters set as Hold:\n'
     2209        first = False
     2210        s += '    ' + v + '\n'
     2211       
    22002212    userOut = ''
    22012213    symOut = ''
     
    22432255                    lineOut += ' + '
    22442256                j += 1
    2245                 if len(lineOut) > 60:
     2257                if len(lineOut) > linelen:
    22462258                    ln += lineOut
    2247                     lineOut = '\n\t'
     2259                    lineOut = '\n  '
    22482260                if m == 1:
    22492261                    lineOut += '{}'.format(v)
     
    22512263                    lineOut += '({:.4g} * {})'.format(m,v)
    22522264            if mv in varyList:
    2253                 lineOut += ' **VARIED**'
     2265                lineOut += '\t *VARIED*'
    22542266            ln += lineOut
    22552267           
     
    22762288       
    22772289    s += '\nInverse parameter mapping relations:\n'
     2290    lineDict = {} # store so we can sort them
    22782291    for varlist,mapvars,invmultarr in zip(dependentParmList,indParmList,invarrayList):
     2292        varied = False
    22792293        for i,mv in enumerate(varlist):
    22802294            lineOut = '  {} = '.format(mv)
     
    22832297                if m == 0: continue
    22842298                if v == 0: continue
     2299                if v in varyList: varied = True
    22852300                if m < 0:
    22862301                    lineOut += ' - '
     
    22892304                    lineOut += ' + '
    22902305                j += 1
    2291                 if len(lineOut) > 60:
     2306                if len(lineOut) > linelen:
    22922307                    s += lineOut
    2293                     lineOut = '\n\t'
     2308                    lineOut = '\n  '
    22942309                if m == 1:
    22952310                    lineOut += '{}'.format(v)
     
    23002315                        lineOut += '({:.4g} * {})'.format(m,v)
    23012316            if j == 0: lineOut += '0'
    2302             s += lineOut + '\n'
     2317            if varied: lineOut += '\t *VARIED*'
     2318            lineDict[mv] = lineOut
     2319    for key in sorted(lineDict):
     2320        s += lineDict[key] + '\n'
    23032321    return s
    23042322
     
    24182436    '''
    24192437    # remove fixed parameters from the varyList
    2420     for item in holdParmList+newHolds:
     2438    for item in holdParmList:
    24212439        if item in varyList: varyList.remove(item)
    24222440           
  • trunk/GSASIIstrIO.py

    r5147 r5153  
    13141314                    if symHold is not None: #variable is held due to symmetry
    13151315                        symHold.append(name)
    1316                     G2mv.StoreHold(name)
     1316                    G2mv.StoreHold(name,'In rigid body')
    13171317        for equiv in equivs:
    13181318            if len(equivs[equiv]) > 1:
     
    14811481                            if symHold is not None: #variable is held due to symmetry
    14821482                                symHold.append(names[j])
    1483                             G2mv.StoreHold(names[j])
     1483                            G2mv.StoreHold(names[j],'Fixed by symmetry')
    14841484                    for equiv in equivs:
    14851485                        if len(equivs[equiv]) > 1:
  • trunk/help/gsasII.html

    r5052 r5153  
    38033803  crystallite size.
    38043804  </UL>
    3805   <p></p> 
     3805  <p></p>
     3806
    38063807<p class=MsoNormal style='margin-left:.5in'>
    3807     In addition, if constraints are defined, they create new global
     3808  The following types of constraints may be specified by users:</P>
     3809 
     3810<DL  style='margin-left:.75in'>
     3811  <DT><B>Holds</B>:
     3812  <DD>Use this to prevent a parameter from being refined. Most valuable
     3813  when refinement of a parameter is selected in a group for refinement
     3814  (such as x, y & z for an atom or unit cell parameters). For example
     3815  of the use of this, if the space group for a phase has a polar axis
     3816  (e.g. the <I>b</I>-axis in P2<sub>1</sub>), then origin with respect to
     3817  <I>b</I> is arbitrary and it is not possible to refine the
     3818  y coordinates for all atoms. Place a Hold on any one y coordinate to
     3819keep the structure from drifting up or down the y-axis during refinement.
     3820  </DD><p></p>
     3821
     3822  <DT><B>Equivalence assignments</B>:
     3823  <DD>Determines a set of parameters that should have
     3824  values with a specified ratio (except for atom coordinates, where the
     3825  ratios are specified for the applied shifts, not the actual
     3826  coordinate values) Examples for typical use are sets of atoms that
     3827  should be constrained to have the same displacement paramaters (aka
     3828  thermal motion,Uiso, etc.) or sets of profile coefficients
     3829    U,V,W across multiple data sets. Note that the first selected
     3830  parameter is treated as independent and the remainder are "slaved"
     3831  to that parameter as "dependent parameters." All parameters in an
     3832  equivalence must be varied. If any parameter is not varied or is
     3833  given a "hold," a warning is displayed and none of the parameters are
     3834    refined.
     3835  </DD><p></p>
     3836
     3837  <DT><B>Constraint Equations</B>:
     3838  <DD>Defines a set of parameters whose sum (with possible non-unitary multipliers)
     3839      will be equal to a constant. For example, a common use for this is to
     3840      specify the sum of occupancies for atoms sharing a site have a
     3841      sum fixed to unity or so that the sum of occupancies for an atom
     3842      type that is occurs on several sites is fixed to match a
     3843      compsition-determined value. Note that all parameters in the
     3844      equation are considered as "dependent parameters." If a
     3845  parameter in a constraint equation is held or is not varied, that
     3846  parameter is removed from the equation (the sum value is modified
     3847    accordingly). If no parameters remain the equation is ignored.
     3848    </DD><p></p>
     3849   
     3850    <DT><B>New Var assignment</b>
     3851    <DD>appear similar to constraint equations in that they define a
     3852      set of parameters and multipliers, but rather than specifying a
     3853      value for the expression, a new parameter is assigned to that
     3854      sum and these constraints have a very different function. This
     3855      replaces a degree of freedom from the original variables with a
     3856      new one that modifies the parameters where the shift is applied
     3857      according to the ratio specified in the expression. This can be
     3858      used to create new parameters that redefine the relationships
     3859        between items such as coordinates or magnetic moments. The new
     3860      parameter may optionally be named by the user.
     3861        The new var expression creates a new global parameter, where
     3862      that new parameter is independent,
     3863      while all the parameters in the expression are considered as
     3864      dependent. The settings of the refine flags for the dependent
     3865        parameters is not used. Only if the new var parameter is marked as
     3866      refine then it will be refined. However, if any dependent variable is set as "hold," the
     3867      new var parameter will not be refined. 
     3868    </DD><p></p>
     3869  </DL>
     3870 
     3871<p class=MsoNormal style='margin-left:.5in'>
     3872  Note that when new var and constraint equation constraints are defined, they create new global
    38083873  parameters. Constraints on these will be rare, but can be managed on
    38093874  the Globals tab. Finally, some constraints are defined automatically based on
    3810   restrictions determined by the space group. These constraimts can be
    3811   seen, but not changed, using the Sym-Generated tab.
     3875  restrictions determined by space group symmetry. These constraints can be
     3876  seen, but not changed, using the Sym-Generated tab. Other
     3877  constraints (holds) will be created when rigid bodies are
     3878  specified.
    38123879  </p>
    38133880
     
    38223889  <UL>
    38233890    <LI><B>Add Hold</B>:
    3824 select a parameter that you wish to remain fixed although other parameters of
    3825 the same type may be selected as a group for refinement. For example, if the
    3826 space group for a phase has a polar axis (e.g. the b-axis in P2<sub>1</sub>),
    3827 then one atom y-parameter is arbitrary and should be selected for a Hold to
    3828 keep the structure from drifting up or down the y-axis during refinement. If
     3891select a parameter that you wish to remain fixed. If
    38293892selected, a dialog box will appear showing the list of available parameters;
    38303893select one and then OK to implement it, Cancel will cancel the operation. The
     
    38323895    <p></p></LI>
    38333896
    3834     <LI><B>Add equivalence</B>: select a list of parameters that should have the same value (possibly with a
    3835 non-unitary multiplier for some). Examples are a list of atoms with the same
    3836 thermal motion <span class=SpellE>Uiso</span>, sets of profile coefficients
    3837 U,V,W across multiple data sets. If selected, a dialog box will appear with a
    3838 list of the available parameters. Select one and press OK; a second dialog box
    3839 will appear with only those parameters that can be made equivalent to the first
    3840 one. Choose those and press OK. Cancel in either dialog will cancel the
    3841 operation. The equivalenced parameters will show as an equation of the form M<sub>1</sub>*P<sub>1</sub>+M<sub>2</sub>*P<sub>2</sub>=0;
    3842 usually M1=1.0 and M2=-1.0, but can be changed via the ‘Edit’ button. The
    3843     keyword ‘EQUIV’ marks it as an equivalence.
     3897    <LI><B>Add equivalence</B>: Select the independent parameters and
     3898    press OK; a second dialog box will appear with only those
     3899    parameters that can be made equivalent to the first one. Choose
     3900    those and press OK. Cancel in either dialog will cancel the
     3901    operation. The equivalenced parameters will show as an equation of
     3902    the form
     3903    M<sub>1</sub>*P<sub>1</sub>+M<sub>2</sub>*P<sub>2</sub>=0; usually
     3904    M1=1.0 and M2=-1.0, but can be changed via the ‘Edit’ button. The
     3905    equation(s) are shown in the window tagged by ‘EQUIV’ to mark it
     3906    as an equivalence assignment.
     3907   
    38443908    <p></p></LI>
    38453909
    38463910    <LI><B>Add constraint</B>:
    3847 select a list of parameters whose sum (with possible non-unitary multipliers)
    3848 is fixed. For example, the sum of site fractions for atoms on the same site
    3849 could be fixed to unity. If selected, a dialog box will appear with a list of
     3911If selected, a dialog box will appear with a list of
    38503912the available parameters. Select one and press OK; a second dialog box will
    38513913appear with only those parameters that can be used in a constraint with the
     
    38533915operation. The equivalenced parameters will show as an equation of the form M<sub>1</sub>*P<sub>1</sub>+M<sub>2</sub>*P<sub>2</sub>+…=C;
    38543916the multipliers M1, M2, … and C can be changed via the ‘Edit’ button. The
    3855 keyword ‘CONSTR’ marks it as a constraint. A Delete button can be used to
    3856     remove it.
     3917    equation is shown in the window tagged by ‘CONSTR’ to mark it
     3918    as a constraint equation assignment.
    38573919    <p></p></LI>
    38583920   
    38593921    <LI><B>Add New Var</b>
    3860 this is very similar the “Add constraint” type except that the result of the
    3861 sum can be varied in the refinement. The keyword ‘New Var’ marks it as a
    3862 function; the ‘Refine?’ box indicates your choice to refine the result of the
    3863     sum.
     3922this behaves very much like the “Add constraint” menu command except
     3923    that it defines a new parameter rather than define a value for the
     3924    expression. That new var parameter can optionally have a named
     3925    assigned. The expression is displayed with the keyword ‘New Var’
     3926    to mark its type. Note that a ‘Refine?’ box is included for this
     3927    type of constraint.
    38643928    <p></p></LI>
    38653929
     
    38713935
    38723936    <LI><B>Show ISODISTORT modes</b>: Used after a CIF from the
    3873     ISODISTORT web site is read, which will define normal modes from
    3874     representational analysis.
     3937    ISODISTORT web site is read, which will display the values for the
     3938    normal modes from representational analysis from the coordinates.
    38753939    <p></p></LI>
    38763940  </UL></OL>
     
    38803944    <UL style='margin-left:1in'>
    38813945    <LI><B>Show Errors 
    3882     </B>: this button will appear if serious errors -- that would
     3946    </B>: this button will be active if serious errors -- that would
    38833947    prevent a refinement from being performed -- are encountered
    38843948    processing the constraints.
     
    38863950
    38873951    <LI><B>Show Warnings
    3888     </B>: this button will appear if correctable problems are
     3952    </B>: this button will be active if correctable problems are
    38893953    encountered in processing the constraints, such as a constraint
    38903954    being rejected because a parameter is not varied. These warning
     
    39113975Refinement Constraints</a></h5>
    39123976
    3913 <p class=MsoNormal style='margin-left:.75in'>
    3914 In sequential refinements, each histogram is treated individually and
    3915 it becomes possible to define constraints of form
     3977  <p class=MsoNormal style='margin-left:.75in'>
     3978  While all the general information on
     3979  constraints <a href='#Constraints'>(above)</A> applies to sequential refinements, the sequential
     3980  refinement is performed by fitting each histogram individually and
     3981  this affects how constraints are defined and processed for parameters keyed to
     3982  a particular constraint number. When sequential refinement is
     3983  selected (via the <a href="#Controls">Controls tree item</a>),
     3984  it becomes possible to define constraints of form
    39163985"<tt><i>p</i></tt>:*:<tt><i>name</i></tt>" and
    39173986":*:<tt><i>name</i></tt>" (where "<tt><i>p</i></tt>" is a phase
    39183987number and <tt><i>name</i></tt> is a parameter name). The "*" here is
    3919 called a wildcard and in a constraint or equivalence of this form will be
    3920 applied to all histograms.
    3921 </p><p class=MsoNormal style='margin-left:.75in'>&nbsp;
     3988called a wildcard and in a constraint or equivalence will cause that
     3989  to be used for every histogram in turn.
     3990
     3991</p><p class=MsoNormal style='margin-left:.75in'>&nbsp;
    39223992</p><p class=MsoNormal style='margin-left:.75in'>
    3923 When sequential refinement is selected (via the <a href="#Controls">Controls
    3924 tree item</a>), two additional controls are shown in the Constraints
    3925 window. The first, which is labeled wildcard use, offers three modes, 
     3993
     3994  In sequential refinement mode,
     3995two additional controls are shown in the Constraints
     3996  window. The first, which is labeled wildcard use,
     3997  specifies what is done when a specific histogram is referenced by
     3998  number in a constraint or equivalence by number rather than by
     3999  wildcard. This offers three modes, 
    39264000"Set hist # to *", "Ignore unless hist=*", and "Use as
    3927 supplied". These have the following meanings:
     4001supplied", which have the following meanings:
    39284002<DL style='margin-left:1.0in'>
    39294003  <DT><B>Set hist # to *</B></DT>
     
    39534027  </DD>
    39544028  </DL>
    3955 <p class=MsoNormal style='margin-left:.75in'>In sequential
    3956   refinements, constraints are processed for a single histogram at a
    3957   time. If debugging of constraints are needed, using the menu button
    3958   labeled "Selected histogram:" it is possible to select which
    3959   histogram from the sequential list will be used to look for
    3960   constraint errors or warnings.
     4029<p class=MsoNormal style='margin-left:.75in'>Also included when a sequential
     4030  refinements is selected is a menu button
     4031  labeled <B>"Selected histogram."</B> With this it is possible to look at
     4032  constraint problems when processing a specific
     4033  histogram.
    39614034</p>
    39624035
     
    50395112
    50405113<p class=MsoNormal style='tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
    5041 style='mso-fareast-font-family:"Times New Roman"'><!-- hhmts start -->Last modified: Mon Oct 25 13:55:12 CDT 2021 <!-- hhmts end --><o:p></o:p></span></p>
     5114style='mso-fareast-font-family:"Times New Roman"'><!-- hhmts start -->Last modified: Sun Jan 23 15:24:16 CST 2022 <!-- hhmts end --><o:p></o:p></span></p>
    50425115
    50435116</div>
Note: See TracChangeset for help on using the changeset viewer.