Changeset 1340


Ignore:
Timestamp:
May 10, 2014 8:12:27 PM (9 years ago)
Author:
toby
Message:

complete parametric fitting and tutorial

Location:
trunk
Files:
75 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIexprGUI.py

    r1325 r1340  
    9898    :param list depVarDict: a dict of choices for the dependent variable to be
    9999      fitted to the expression and their values. Ignored if None (default).
     100    :param list ExtraButton: a list with two terms that define [0]: the label
     101      for an extra button and [1] the callback routine to be used when the
     102      button is pressed. The button will only be enabled when the OK button can be
     103      used (meaning the equation/expression is valid). The default is None, meaning this
     104      will not be used.
     105    :param list usedVars: defines a list of previously used variable names. These names
     106      will not be reused as defaults for new free variables.
     107      (The default is an empty list).
    100108    '''
    101109    def __init__(self, parent, parmDict, exprObj=None,
    102110                 header='Enter restraint expression here',
    103111                 wintitle='Expression Editor',
    104                  fit=True,VarLabel=None,depVarDict=None):
     112                 fit=True,VarLabel=None,depVarDict=None,
     113                 ExtraButton=None,usedVars=[]):
    105114        self.fit = fit
    106115        self.depVarDict = depVarDict
     
    136145        self.dependentVar = None
    137146        'name for dependent variable selection, when depVarDict is specified'
    138        
     147        self.usedVars = usedVars
     148        'variable names that have been used and should not be reused by default'
     149
    139150        # process dictionary of values and create an index
    140151        for key in parmDict:
     
    202213        self.mainsizer.Add((-1,5),0,wx.EXPAND,1)
    203214
     215        bSizer = wx.BoxSizer(wx.HORIZONTAL)
    204216        btnsizer = wx.StdDialogButtonSizer()
     217        if ExtraButton:
     218            self.ExtraBtn = wx.Button(self, wx.ID_ANY, ExtraButton[0])
     219            self.ExtraBtn.Bind(wx.EVT_BUTTON,self.OnExtra)
     220            self.ExtraCallBack = ExtraButton[1]
     221            self.ExtraBtn.Disable()
     222            bSizer.Add(self.ExtraBtn, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 2)
     223        else:
     224            self.ExtraBtn = None
     225        bSizer.Add((1,1), 1, wx.ALIGN_CENTER|wx.ALL|wx.EXPAND, 0)
    205226        self.OKbtn = wx.Button(self, wx.ID_OK)
    206227        self.OKbtn.SetDefault()
     
    210231        btnsizer.AddButton(btn)
    211232        btnsizer.Realize()
    212         self.mainsizer.Add(btnsizer, 0, wx.ALIGN_CENTER|wx.ALL|wx.EXPAND, 5)
     233        bSizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
     234        self.mainsizer.Add(bSizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND, 5)
    213235        self.SetSizer(self.mainsizer)
    214236        self.CenterOnParent()
     
    237259        #self.mainsizer.Fit(self)
    238260
     261    def OnExtra(self,event):
     262        exprObj = G2obj.ExpressionObj()
     263        exprObj.LoadExpression(
     264            self.expr,
     265            self.exprVarLst,
     266            self.varSelect,
     267            self.varName,
     268            self.varValue,
     269            self.varRefflag,
     270            )
     271        if self.depVarDict:
     272            exprObj.SetDepVar(self.dependentVar)
     273        self.ExtraCallBack(exprObj)
     274        # put results back into displayed dialog
     275        resDict = dict(exprObj.GetVariedVarVal())
     276        for v,var in self.varName.items():
     277            varname = "::" + var.lstrip(':').replace(' ','_').replace(':',';')
     278            val =  resDict.get(varname)
     279            if val:
     280                self.varValue[v] = val
     281        wx.CallAfter(self.ShowVars())
     282
    239283    def Show(self,mode=True):
    240284        '''Call to use the dialog after it is created.
     
    282326        self.RestartTimer()
    283327        self.OKbtn.Disable()
     328        if self.ExtraBtn: self.ExtraBtn.Disable()
    284329        event.Skip()
    285330        return
     
    467512        self.varSelect[v] = sel
    468513        if sel == 0:
    469             self.varName[v] = str(v)
     514            sv = G2obj.MakeUniqueLabel(v,self.usedVars)
     515            self.varName[v] = sv
    470516            self.varValue[v] = self.varValue.get(v,0.0)
    471517        else:
     
    518564        '''
    519565        self.OKbtn.Disable()
     566        if self.ExtraBtn: self.ExtraBtn.Disable()
    520567        self.varSizer.Clear(True)
    521568        self.errbox = wxscroll.ScrolledPanel(self,style=wx.HSCROLL)
     
    559606            return
    560607        self.exprVarLst,pkgdict = ret
     608        wx.CallAfter(self.Repaint,exprObj)
     609           
     610    def Repaint(self,exprObj):
     611        'Redisplay the variables and continue the validation'
    561612        self.ShowVars() # show widgets to set vars
    562613        msg = self.CheckVars()
     
    593644        self.setEvalResult("Expression evaluates to: "+str(s)+depVal)
    594645        self.OKbtn.Enable()
     646        if self.ExtraBtn: self.ExtraBtn.Enable()
    595647       
    596648if __name__ == "__main__":
  • trunk/GSASIIgrid.py

    r1335 r1340  
    25292529        self.SequentialMenu.Append(menu=self.SequentialPfit, title='Parametric Fit')
    25302530        self.SequentialPfit.Append(
    2531             id=wxADDPARFIT, kind=wx.ITEM_NORMAL,text='Add function',
    2532             help='Add a new function to minimize')
     2531            id=wxADDPARFIT, kind=wx.ITEM_NORMAL,text='Add equation',
     2532            help='Add a new equation to minimize')
    25332533        self.SequentialPfit.Append(
    2534             id=wxDELPARFIT, kind=wx.ITEM_NORMAL,text='Delete function',
    2535             help='Delete a function for parametric minimization')
     2534            id=wxDELPARFIT, kind=wx.ITEM_NORMAL,text='Delete equation',
     2535            help='Delete an equation for parametric minimization')
    25362536        self.SequentialPfit.Append(
    2537             id=wxEDITPARFIT, kind=wx.ITEM_NORMAL,text='Edit function',
    2538             help='Edit an existing parametric minimization function')
     2537            id=wxEDITPARFIT, kind=wx.ITEM_NORMAL,text='Edit equation',
     2538            help='Edit an existing parametric minimization equation')
    25392539        self.SequentialPfit.Append(
    2540             id=wxDOPARFIT, kind=wx.ITEM_NORMAL,text='Fit to function(s)',
     2540            id=wxDOPARFIT, kind=wx.ITEM_NORMAL,text='Fit to equation(s)',
    25412541            help='Perform a parametric minimization')
    25422542        self.PostfillDataMenu()
     
    38683868            UpdateSeqResults(G2frame,data,G2frame.dataDisplay.GetSize()) # redisplay variables
    38693869
     3870    # PATCH: this routine can go away eventually
    38703871    def CreatePSvarDict(seqnum,name):
    38713872        '''Create a parameter dict (parmDict) for everything that might be used
     
    40174018        G2frame.dataFrame.SequentialPfit.Enable(wxDOPARFIT,val)
    40184019
    4019     def DelParFitEq(event):
    4020         'Ask the user to select function to delete'
    4021         choices = Controls['SeqParFitEqs'].keys()
    4022         selected = ItemSelector(
    4023             choices,G2frame.dataFrame,
    4024             multiple=True,
    4025             title='Select functions to remove',
    4026             header='Delete function')
    4027         if selected is None: return
    4028         for item in selected:
    4029             del Controls['SeqParFitEqs'][choices[item]]
    4030         EnableParFitEqMenus()
    4031         if Controls['SeqParFitEqs']: DoParEqFit(event)
    4032        
    4033     def EditParFitEq(event):
    4034         'Edit an existing parametric equation'
    4035         choices = Controls['SeqParFitEqs'].keys()
    4036         if len(choices) == 1:
    4037             selected = 0
    4038         else:
    4039             selected = ItemSelector(
    4040                 choices,G2frame.dataFrame,
    4041                 multiple=False,
    4042                 title='Select a function to edit',
    4043                 header='Edit function')
    4044         if selected is not None:
    4045             dlg = G2exG.ExpressionDialog(
    4046                 G2frame.dataDisplay,indepVarDict,
    4047                 Controls['SeqParFitEqs'][choices[selected]],
    4048                 depVarDict=depVarDict,
    4049                 header="Edit this minimization function's formula")
    4050             newobj = dlg.Show(True)
    4051             if newobj:
    4052                 calcobj = G2obj.ExpressionCalcObj(newobj)
    4053                 del Controls['SeqParFitEqs'][choices[selected]]
    4054                 Controls['SeqParFitEqs'][calcobj.eObj.expression] = newobj
    4055             EnableParFitEqMenus()
    4056         if Controls['SeqParFitEqs']: DoParEqFit(event)
    4057 
    4058     def AddNewParFitEq(event):
    4059         'Create a new parametric equation to be fit to sequential results'
    4060         dlg = G2exG.ExpressionDialog(
    4061             G2frame.dataDisplay,indepVarDict,
    4062             depVarDict=depVarDict,
    4063             header='Enter a function to minimize in the parametric fit')
    4064         obj = dlg.Show(True)
    4065         dlg.Destroy()
    4066         if obj:
    4067             calcobj = G2obj.ExpressionCalcObj(obj)
    4068             Controls['SeqParFitEqs'][calcobj.eObj.expression] = obj
    4069             EnableParFitEqMenus()
    4070         if Controls['SeqParFitEqs']: DoParEqFit(event)
    4071            
    40724020    def ParEqEval(Values,calcObjList,varyList):
    40734021        '''Evaluate the parametric expression(s)
     
    40834031        return result
    40844032
    4085     def DoParEqFit(event):
     4033    def DoParEqFit(event,eqObj=None):
    40864034        'Parametric fit minimizer'
    40874035        varyValueDict = {} # dict of variables and their initial values
    40884036        calcObjList = [] # expression objects, ready to go for each data point
    4089         for expr in Controls['SeqParFitEqs']:
    4090             obj = Controls['SeqParFitEqs'][expr]
     4037        if eqObj is not None:
     4038            eqObjDict = {eqObj.expression:eqObj}
     4039        else:
     4040            eqObjDict = Controls['SeqParFitEqs']
     4041        for expr in eqObjDict.keys():
     4042            obj = eqObjDict[expr]
    40914043            # assemble refined vars for this equation
    40924044            varyValueDict.update({var:val for var,val in obj.GetVariedVarVal()})
     
    41124064        # varied parameters
    41134065        varyList = varyValueDict.keys()
    4114         varyValues = [varyValueDict[key] for key in varyList]
    4115         result = so.leastsq(ParEqEval,varyValues,full_output=True,   #ftol=Ftol,
    4116                             args=(calcObjList,varyList)
    4117                             )
     4066        values = varyValues = [varyValueDict[key] for key in varyList]
     4067        if not varyList:
     4068            print 'no variables to refine!'
     4069        else:
     4070            try:
     4071                print 'Fit Results'
     4072                result = so.leastsq(ParEqEval,varyValues,full_output=True,   #ftol=Ftol,
     4073                                    args=(calcObjList,varyList)
     4074                                    )
     4075                values = result[0]
     4076                covar = result[1]
     4077                if covar is None:
     4078                    raise Exception
     4079                for i,(var,val) in enumerate(zip(varyList,values)):
     4080                    print '  ',var,' =',G2mth.ValEsd(val,np.sqrt(covar[i,i]))
     4081            except:
     4082                print 'Fit failed'
     4083                return
    41184084        # create a plot for each parametric variable
    4119         values = result[0]
    4120         covar = result[1]
    4121         print 'Fit Results'
    4122         for i,(var,val) in enumerate(zip(varyList,values)):
    4123             print '  ',var,' =',G2mth.ValEsd(val,np.sqrt(covar[i,i]))
    4124         for fitnum,expr in enumerate(Controls['SeqParFitEqs']):
    4125             obj = Controls['SeqParFitEqs'][expr]
     4085        for fitnum,expr in enumerate(sorted(eqObjDict)):
     4086            obj = eqObjDict[expr]
    41264087            obj.UpdateVariedVars(varyList,values)
    41274088            calcobj = G2obj.ExpressionCalcObj(obj)
     
    41374098                    )
    41384099                fitvals.append(calcobj.EvalExpression())
    4139             G2plt.PlotSelectedSequence(G2frame,[indx],GetColumnInfo,SelectXaxis,
    4140                                            fitnum,fitvals)
    4141                                
     4100            G2plt.PlotSelectedSequence(
     4101                G2frame,[indx],GetColumnInfo,SelectXaxis,
     4102                fitnum,fitvals)
     4103
     4104    def SingleParEqFit(eqObj):
     4105        DoParEqFit(None,eqObj)
     4106
     4107    def DelParFitEq(event):
     4108        'Ask the user to select function to delete'
     4109        choices = sorted(Controls['SeqParFitEqs'].keys())
     4110        txtlst = [Controls['SeqParFitEqs'][i].GetDepVar()+' = '+i for i in choices]
     4111        selected = ItemSelector(
     4112            txtlst,G2frame.dataFrame,
     4113            multiple=True,
     4114            title='Select a parametric equation to remove',
     4115            header='Delete equation')
     4116        if selected is None: return
     4117        for item in selected:
     4118            del Controls['SeqParFitEqs'][choices[item]]
     4119        EnableParFitEqMenus()
     4120        if Controls['SeqParFitEqs']: DoParEqFit(event)
     4121       
     4122    def EditParFitEq(event):
     4123        'Edit an existing parametric equation'
     4124        choices = sorted(Controls['SeqParFitEqs'].keys())
     4125        txtlst = [Controls['SeqParFitEqs'][i].GetDepVar()+' = '+i for i in choices]
     4126        if len(choices) == 1:
     4127            selected = 0
     4128        else:
     4129            selected = ItemSelector(
     4130                txtlst,G2frame.dataFrame,
     4131                multiple=False,
     4132                title='Select a parametric equation to edit',
     4133                header='Edit equation')
     4134        if selected is not None:
     4135            dlg = G2exG.ExpressionDialog(
     4136                G2frame.dataDisplay,indepVarDict,
     4137                Controls['SeqParFitEqs'][choices[selected]],
     4138                depVarDict=depVarDict,
     4139                header="Edit the formula for this minimization function",
     4140                ExtraButton=['Fit',SingleParEqFit])
     4141            newobj = dlg.Show(True)
     4142            if newobj:
     4143                calcobj = G2obj.ExpressionCalcObj(newobj)
     4144                del Controls['SeqParFitEqs'][choices[selected]]
     4145                Controls['SeqParFitEqs'][calcobj.eObj.expression] = newobj
     4146                EnableParFitEqMenus()
     4147                if Controls['SeqParFitEqs']: DoParEqFit(event)
     4148
     4149    def AddNewParFitEq(event):
     4150        'Create a new parametric equation to be fit to sequential results'
     4151
     4152        # compile the variable names in previous freevars to avoid accidental name collisions
     4153        usedvarlist = []
     4154        for eq,obj in Controls['SeqParFitEqs'].items():
     4155            for var in obj.freeVars:
     4156                if obj.freeVars[var][0] not in usedvarlist: usedvarlist.append(obj.freeVars[var][0])
     4157
     4158        dlg = G2exG.ExpressionDialog(
     4159            G2frame.dataDisplay,indepVarDict,
     4160            depVarDict=depVarDict,
     4161            header='Define an equation to minimize in the parametric fit',
     4162            ExtraButton=['Fit',SingleParEqFit],
     4163            usedVars=usedvarlist)
     4164        obj = dlg.Show(True)
     4165        dlg.Destroy()
     4166        if obj:
     4167            calcobj = G2obj.ExpressionCalcObj(obj)
     4168            Controls['SeqParFitEqs'][calcobj.eObj.expression] = obj
     4169            EnableParFitEqMenus()
     4170            if Controls['SeqParFitEqs']: DoParEqFit(event)
     4171                                           
    41424172    def GridSetToolTip(row,col):
    41434173        '''Routine to show standard uncertainties for each element in table
     
    43714401                calcobj.UpdateDict(PSvarDict)
    43724402            else:
    4373                 PSvarDict,unused,unused = CreatePSvarDict(0,histNames[0])
     4403                # PATCH: this routine can go away eventually once parmDict is always in
     4404                # sequential refinement
     4405                PSvarDict,unused,unused = CreatePSvarDict(seqnum,name)
    43744406                calcobj.SetupCalc(PSvarDict)
    43754407            valList.append(calcobj.EvalExpression())
     
    43904422    else:
    43914423        print 'Sequential refinement needs to be rerun to obtain ESDs for PseudoVariables'
     4424        # PATCH: this routine can go away eventually
    43924425        PSvarDict,unused,unused = CreatePSvarDict(0,histNames[0])
    43934426    # Also dicts of dependent (depVarDict) & independent vars (indepVarDict)
  • trunk/GSASIIobj.py

    r1338 r1340  
    12471247        'Vol' : 'Unit cell volume',
    12481248        # Atom vars (p::<var>:a)
    1249         'dA([xyz])' : 'change to atomic coordinate, \\1',
     1249        'dA([xyz])$' : 'change to atomic coordinate, \\1',
    12501250        'A([xyz])$' : '\\1 fractional atomic coordinate',
    12511251        'AUiso':'Atomic isotropic displacement parameter',
     
    12711271        'Polariz\.' : 'Polarization correction',
    12721272        'SH/L' : 'FCJ peak asymmetry correction',
    1273         '([UVW])' : 'Gaussian instrument broadening \\1',
    1274         '([XY])' : 'Cauchy instrument broadening \\1',
     1273        '([UVW])$' : 'Gaussian instrument broadening \\1',
     1274        '([XY])$' : 'Cauchy instrument broadening \\1',
    12751275        'Zero' : 'Debye-Scherrer zero correction',
    12761276        'nDebye' : 'Debye model background corr. terms',
     
    15651565# shortcut routines
    15661566exp = np.exp
    1567 sind = lambda x: np.sin(x*np.pi/180.)
    1568 tand = lambda x: np.tan(x*np.pi/180.)
    1569 cosd = lambda x: np.cos(x*np.pi/180.)
    15701567sind = sin = s = lambda x: np.sin(x*np.pi/180.)
    15711568cosd = cos = c = lambda x: np.cos(x*np.pi/180.)
     
    15851582        self.assgnVars = {}
    15861583        '''A dict where keys are label names in the expression mapping to a GSAS-II
    1587         variable. The value is a list with a G2 variable name and derivative step size.
     1584        variable. The value a G2 variable name.
    15881585        Note that the G2 variable name may contain a wild-card and correspond to
    15891586        multiple values.
  • trunk/help/SequentialTutorial.htm

    r1307 r1340  
    11311131 <w:wrap type="square" anchorx="margin" anchory="margin"/>
    11321132</v:shape><![endif]--><![if !vml]><img width=271 height=93
    1133 src="SequentialTutorial_files/image002.jpg" align=right hspace=12 v:shapes="Picture_x0020_1"><![endif]>Use
    1134 the Import/Phase/from CIF file menu item to read the phase information </p>
     1133src="SequentialTutorial_files/image002.png" align=right hspace=12 v:shapes="Picture_x0020_1"><![endif]>Use
     1134the <B>Import/Phase/from CIF file menu item</B> to read the phase information </p>
    11351135
    11361136<p class=MsoListParagraphCxSpMiddle><o:p>&nbsp;</o:p></p>
     
    11401140style='mso-list:Ignore'>3.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    11411141</span></span></span><![endif]>In the file browser dialog window that is
    1142 created, change the file type from “CIF file” to “zip archive” and select <span
    1143 style='font-family:Courier'>SeqTut.zip</span> file (change the file directory
     1142created, <B>change the file type from “CIF file” to “zip archive”</B> and <B>select <span
     1143style='font-family:Courier'>SeqTut.zip</span> file</B> (change the file directory
    11441144to <b style='mso-bidi-font-weight:normal'><span style='font-family:"Calibri","sans-serif";
    11451145mso-ascii-theme-font:major-latin;mso-hansi-theme-font:major-latin'>Exercises/sequential</span></b>).
    11461146Another dialog window will be created showing all the files in the zip archive.
    11471147To simplify the view to only show the phase files, type “<span class=SpellE>cif</span>”
    1148 (or “CIF” – case is ignored) into the filter. Select the <span
     1148(or “CIF” – case is ignored) into the filter. <B>Select the <span
    11491149style='font-family:Courier'>CuCr2O4.cif</span> and the <span class=SpellE><span
    1150 style='font-family:Courier'>CuO.cif</span></span> input files. Press OK. </p>
     1150style='font-family:Courier'>CuO.cif</span></span> input files. Press OK.</B> </p>
    11511151
    11521152<p class=MsoListParagraphCxSpMiddle><o:p>&nbsp;</o:p></p>
     
    11571157</span></span></span><![endif]>You will be asked sequentially for the name for
    11581158each phase. The defaults (CuCr2O4 and <span class=SpellE>CuO</span>) are fine,
    1159 so OK can be pressed for each question.<span style='mso-spacerun:yes'> 
     1159so <B>OK can be pressed for each question</B>.<span style='mso-spacerun:yes'> 
    11601160</span>(Note that if files CuCr2O4.cif or the <span class=SpellE>CuO.cif</span>
    11611161already exist, you will be asked to OK overwriting them.)</p>
     
    11781178 <v:imagedata src="SequentialTutorial_files/image003.png" o:title=""/>
    11791179 <w:wrap type="square" anchorx="margin" anchory="margin"/>
    1180 </v:shape><![endif]--><![if !vml]><img width=284 height=119
    1181 src="SequentialTutorial_files/image004.jpg" align=right hspace=12 v:shapes="Picture_x0020_21"><![endif]><span
     1180</v:shape><![endif]--><![if !vml]><img
     1181src="SequentialTutorial_files/image004.png" align=right hspace=12 v:shapes="Picture_x0020_21"><![endif]><span
    11821182style='mso-spacerun:yes'> </span>Read in the ~7 K dataset (OH_00.fxye) using
    1183 Import/Powder Data/from GSAS powder data file to open a file browser. Again
    1184 select “zip archive” and the downloaded <span style='font-family:Courier'>SeqTut.zip</span>
    1185 file. Select file <span style='font-family:Courier'>OH_00.fxye</span> (use of
    1186 the filter can again be helpful) and press OK. </p>
     1183<B>Import/Powder Data/from GSAS powder data file</B> to open a file browser. Again
     1184<B>select “zip archive” and the <span style='font-family:Courier'>SeqTut.zip</span>
     1185file. Select file <span style='font-family:Courier'>OH_00.fxye</span></B> (use of
     1186the filter can again be helpful) and <B>press OK</B>. </p>
    11871187
    11881188<p class=MsoListParagraphCxSpMiddle><!--[if gte vml 1]><o:wrapblock><v:shape
     
    12121212style='mso-ignore:vglayout' clear=ALL>
    12131213You will be shown the first few lines from the file. Confirm that the selected
    1214 file is correct by pressing OK. </p>
     1214file is correct by <B>pressing OK.</B> </p>
    12151215
    12161216<p class=MsoListParagraphCxSpMiddle><span style='mso-fareast-language:EN-US;
     
    12321232style='mso-list:Ignore'>6.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    12331233</span></span></span><![endif]>Map the phases to the data: After reading in the
    1234 dataset, a window used to select phases is shown. Select both phases and press
    1235 OK.<span style='mso-spacerun:yes'>  </span></p>
     1234dataset, a window used to select phases is shown. <B>Select both phases and press
     1235OK.</B><span style='mso-spacerun:yes'>  </span></p>
    12361236
    12371237<p class=MsoListParagraphCxSpMiddle><span style='mso-fareast-language:EN-US;
     
    12651265initially.<span style='mso-spacerun:yes'>  </span>To illustrate how constraints
    12661266are used, we will refine both phase fractions, but constrain their sum to be
    1267 one. To set up the constraint, click on the Constraints item in the data tree
    1268 and the Select tab/”Histogram/Phase” menu<span style='mso-spacerun:yes'> 
    1269 </span>item, and then click on the Edit/Add constraint menu item.</p>
     1267one. To set up the constraint, <B>click on the Constraints item</B> in the data tree
     1268and the <B>Select tab/”Histogram/Phase” menu<span style='mso-spacerun:yes'> 
     1269</span>item</B>, and then <B>click on the Edit/Add constraint menu item.</B></p>
    12701270
    12711271<p class=MsoListParagraphCxSpMiddle><span style='mso-fareast-language:EN-US;
     
    12741274 mso-wrap-style:square'>
    12751275 <v:imagedata src="SequentialTutorial_files/image013.png" o:title=""/>
    1276 </v:shape><![endif]--><![if !vml]><img width=104 height=72
    1277 src="SequentialTutorial_files/image014.jpg" v:shapes="Picture_x0020_5"><![endif]></span><span
     1276</v:shape><![endif]--><![if !vml]><img
     1277src="SequentialTutorial_files/image014.png" v:shapes="Picture_x0020_5"><![endif]></span><span
    12781278style='mso-spacerun:yes'> </span></p>
    12791279
    1280 <p class=MsoListParagraphCxSpMiddle>In the next window, select the phase
    1281 fraction for the first phase <span style='font-family:Courier'>0:0:Scale</span>
     1280<p class=MsoListParagraphCxSpMiddle>In the next window, <B>select the phase
     1281fraction for the first phase <span style='font-family:Courier'>0:0:Scale</span></B>
    12821282(the second, <span style='font-family:Courier'>1:0:Scale,</span> would work
    12831283too) </p>
     
    12921292style='mso-spacerun:yes'> </span></p>
    12931293
    1294 <p class=MsoListParagraphCxSpMiddle>In the next window, select either the other
     1294<p class=MsoListParagraphCxSpMiddle>In the next window, either <B>select the other
    12951295phase fraction (<span style='font-family:Courier'>1:0<span class=GramE>:Scale</span>)</span><span
    12961296style='mso-ascii-font-family:Cambria;mso-ascii-theme-font:minor-latin;
    1297 mso-hansi-font-family:Cambria;mso-hansi-theme-font:minor-latin'> or select all
     1297mso-hansi-font-family:Cambria;mso-hansi-theme-font:minor-latin'></B> or select all
    12981298phases (</span><span style='font-family:Courier'>all:0:Scale</span><span
    12991299style='mso-ascii-font-family:Cambria;mso-ascii-theme-font:minor-latin;
     
    13291329<p class=MsoNormal><o:p>&nbsp;</o:p></p>
    13301330
    1331 <p class=MsoListParagraphCxSpFirst>Click on the first phase (CuCr2O4) click on
    1332 the refine unit cell option (on the General tab). (You will likely need to
    1333 click on the triangle to the left of the Phase entry to “open” the tree item.</p>
    1334 
    1335 <p class=MsoListParagraphCxSpMiddle><span style='mso-fareast-language:EN-US;
    1336 mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_12" o:spid="_x0000_i1051"
    1337  type="#_x0000_t75" style='width:405pt;height:62.25pt;visibility:visible;
    1338  mso-wrap-style:square'>
    1339  <v:imagedata src="SequentialTutorial_files/image021.png" o:title=""/>
    1340 </v:shape><![endif]--><![if !vml]><img width=540 height=83
    1341 src="SequentialTutorial_files/image022.jpg" v:shapes="Picture_x0020_12"><![endif]></span></p>
    1342 
    1343 <p class=MsoListParagraphCxSpMiddle>We also want to refine the phase fraction
    1344 for this phase, so move to the Data tab, click on “show PWDR OH_00.fxye Bank 1”
    1345 and click on the Phase fraction box to cause that to be refined.<span
     1331<p class=MsoListParagraphCxSpFirst><B>Click on the first phase</B> (CuCr2O4) <B>click on
     1332the refine unit cell option</B> (on the General tab). (You will likely need to
     1333click on the triangle to the left of the Phase entry to “open” the tree item.
     1334We also want to refine the phase fraction
     1335for this phase, so <B>move to the Data tab, click on “show PWDR OH_00.fxye Bank 1”</B>
     1336and <B>click on the Phase fraction box</B> to cause that to be refined.<span
    13461337style='mso-spacerun:yes'>  </span></p>
    13471338
     
    13501341 style='width:260.25pt;height:99pt;visibility:visible;mso-wrap-style:square'>
    13511342 <v:imagedata src="SequentialTutorial_files/image023.png" o:title=""/>
    1352 </v:shape><![endif]--><![if !vml]><img width=347 height=132
    1353 src="SequentialTutorial_files/image024.jpg" v:shapes="_x0000_i1050"><![endif]></span></p>
     1343</v:shape><![endif]--><![if !vml]><img
     1344src="SequentialTutorial_files/image024.png" v:shapes="_x0000_i1050"><![endif]></span></p>
    13541345
    13551346<p class=MsoListParagraphCxSpMiddle>Repeat this with the second phase (<span
    1356 class=SpellE>CuO</span>), by clicking on that phase in the data tree. Then
    1357 click on the General tab and on the refine unit cell option. We also want to
    1358 refine the phase fraction for this phase, so move to the Data tab, click on
    1359 “show PWDR OH_00.fxye Bank 1” and click on the Phase fraction box to cause that
    1360 to be refined.<span style='mso-spacerun:yes'>  </span>Also click on the single
    1361 (isotropic) <span class=SpellE>microstrain</span> term for this second phase.</p>
     1347class=SpellE>CuO</span>), by <B>clicking on the second phase</B> in the data tree. Then
     1348<B>click on the General tab</B> and on <B>the refine unit cell</B> option. We also want to
     1349refine the phase fraction for this phase, so <B>move to the Data tab, click on
     1350“show PWDR OH_00.fxye Bank 1”</B> and <B>click on the Phase fraction box</B> to cause that
     1351to be refined.<span style='mso-spacerun:yes'>  </span>Also <B>click on
     1352the single microstrain</B>
     1353(isotropic) term for this second phase.</p>
    13621354
    13631355<p class=MsoListParagraphCxSpMiddle><o:p>&nbsp;</o:p></p>
     
    13771369</v:shape><![endif]--><![if !vml]><img width=346 height=123
    13781370src="SequentialTutorial_files/image026.png" align=right hspace=12 v:shapes="Picture_x0020_14"><![endif]>Also
    1379 click on the Background entry for the PWDR OH_00.fxye Bank 1 entry in the data
     1371<B>click on the Background entry</B> for the PWDR OH_00.fxye Bank 1 entry in the data
    13801372tree (you will likely need to click on the triangle to the left of the entry to
    13811373“open” the tree item.) Confirm that Background function should already be set
    13821374as <span class=SpellE>chebyshev</span> and the Refine flag should be checked.
    1383 Change the “No. <span class=SpellE>coeff</span>.” entry from 3 to 6 to
     1375<B>Change the “No. <span class=SpellE>coeff</span>.” entry from 3 to 6</B> to
    13841376introduce more background terms. </p>
    13851377
     
    13941386<p class=MsoListParagraphCxSpMiddle>Finally, note that the first broad peak in
    13951387these data is spurious. It is known to arise from the <span class=SpellE>kapton</span>
    1396 window in the cryostat used for sample cooling and was confirmed by collecting
     1388window in the cryostat used for sample cooling; this was confirmed by collecting
    13971389data without a sample. We could model this peak, but it is easier to simply
    1398 drop the data below the first peak at ~5 degrees. To do this, click on the
    1399 Limits entry for the PWDR OH_00.fxye Bank 1 entry in the data tree and in the <span
    1400 class=SpellE>Tmin</span>/changed box (to lower left) change the initial value
    1401 of 0.5 degrees to 3.0. <i style='mso-bidi-font-style:normal'><u>Important</u></i>:
     1390drop the data below the first peak at ~5 degrees. To do this, <B>click on the
     1391Limits entry</B> for the PWDR OH_00.fxye Bank 1 entry in the data tree and in the <span
     1392class=SpellE>Tmin</span>/changed box (to lower left) <B>change the initial value
     1393of 0.5 degrees to 3.0.</B> <i style='mso-bidi-font-style:normal'><u>Important</u></i>:
    14021394click on some other box in the window after editing the contents so that the
    14031395change registers. </p>
     
    14231415src="SequentialTutorial_files/image028.png" align=right hspace=12 v:shapes="Picture_x0020_15"><![endif]>Optional:
    14241416confirm that the initial parameters have been selected correctly for refinement
    1425 using the Calculate/View LS <span class=SpellE>parms</span> menu item. There
     1417using <B>the Calculate/View LS <span class=SpellE>parms</span> menu item</B>. There
    14261418will be 15 refined parameters: <span style='font-family:Courier'>0::A</span>x
    14271419(x=0,1,2) and <span style='font-family:Courier'>1::A</span>x (x=0,1,2,4), the
     
    14391431<p class=MsoListParagraphCxSpMiddle style='text-indent:-.25in;mso-list:l6 level1 lfo4'><![if !supportLists]><span
    14401432style='mso-fareast-font-family:Cambria;mso-bidi-font-family:Cambria'><span
    1441 style='mso-list:Ignore'>10.<span style='font:7.0pt "Times New Roman"'>&nbsp; </span></span></span><![endif]>Use
    1442 the Calculate/Refine menu item to initiate the refinement. Since the project has
     1433style='mso-list:Ignore'>10.<span style='font:7.0pt "Times New Roman"'>&nbsp; </span></span></span><![endif]><B>Use
     1434the Calculate/Refine menu item</B> to initiate the refinement. Since the project has
    14431435not been saved, you will be asked to select a name (and optionally a directory)
    14441436for the GSAS-II project (.<span class=SpellE>gpx</span>) file.<span
     
    14551447are several additional variables that should now be added. One should always
    14561448refine a zero correction or sample displacement parameter. In this case, the
    1457 best choice is the Sample X <span class=SpellE>displ</span>. <span class=GramE>parameter</span>
     1449best choice is to <B>add the Sample X <span class=SpellE>displ</span>. <span class=GramE>parameter</span></B>
    14581450on the Sample Parameters section of histogram PWDR OH_00.fxye Bank 1. (Note
    14591451that data range &gt;&gt;90 degrees is needed before the Sample Y <span
     
    14771469 <w:wrap type="square" anchorx="margin" anchory="margin"/>
    14781470</v:shape><![endif]--><![if !vml]><img width=375 height=174
    1479 src="SequentialTutorial_files/image030.png" align=right hspace=12 v:shapes="Picture_x0020_13"><![endif]>Clicking
    1480 on the PWDR OH_00.fxye Bank 1 entry shows the “Rietveld plot” and zooming in on
     1471src="SequentialTutorial_files/image030.png" align=right hspace=12 v:shapes="Picture_x0020_13"><![endif]><B>Clicking
     1472on the PWDR OH_00.fxye Bank 1 entry</B> shows the “Rietveld plot” and zooming in on
    14811473different regions of the pattern provides insight on how the fit could be
    14821474improved. The background is not well fit in the low angle range and examination
    14831475shows a “hump” of low-angle scattering from ~4.5 to 6 degrees. This is more
    14841476easily fit by adding a background peak than extra terms to the background
    1485 function. Select the Background item in histogram PWDR OH_00.fxye Bank 1 and
    1486 change the “Peaks in Background” from 0 to 1.<span style='mso-spacerun:yes'> 
    1487 </span>Change the peak position to the approximate peak center (5.25 degrees)
    1488 and set the intensity and Gaussian width (sig) to be refined.<span
     1477function. <B>Select the Background item</B> in histogram PWDR OH_00.fxye Bank 1 and
     1478<B>change the “Peaks in Background” from 0 to 1.</B><span style='mso-spacerun:yes'> 
     1479</span><B>Change the peak position</B> to the approximate peak center (5.25 degrees)
     1480and <B>set the intensity and Gaussian width (sig) to be refined</B>.<span
    14891481style='mso-spacerun:yes'>  </span><i style='mso-bidi-font-style:normal'><u>Important</u></i>:
    14901482note that one must click on another box to ensure that input is recorded. </p>
     
    15131505in other projects I might postpone this until later, we can also start on
    15141506improving the peak fit. We will do this by varying the sample broadening for
    1515 the major phase (since the instrumental terms are very good.) Click on the
    1516 first phase (CuCr2O4) and Data tab, click on the <span class=SpellE>Cryst</span>.
    1517 <span class=GramE>Size and <span class=SpellE>microstrain</span> parameters to
     1507the major phase (since the instrumental terms are very good.) <B>Click on the
     1508first phase (CuCr2O4)</B> and <B>Data tab</B>, <B>click on the <span class=SpellE>Cryst</span>.
     1509<span class=GramE>Size and <span class=SpellE>microstrain</span> parameters</B> to
    15181510add those parameters to the fit.</span><span style='mso-spacerun:yes'>  </span></p>
    15191511
     
    15291521style='mso-fareast-font-family:Cambria;mso-bidi-font-family:Cambria'><span
    15301522style='mso-list:Ignore'>12.<span style='font:7.0pt "Times New Roman"'>&nbsp; </span></span></span><![endif]>We
    1531 can now include the position flag for the background peak in the refinement. Do
     1523can now <B>include the position flag for the background peak</B> in the refinement. Do
    15321524this using the Background item, as before. Be sure to click on some other box
    15331525after clicking on the refine flag, so that the setting is recorded. </p>
     
    15421534style='mso-spacerun:yes'>  </span>Trial and error will show that the 010
    15431535direction works best. Click on the first phase (CuCr2O4) and Data tab and
    1544 select uniaxial for the <span class=SpellE>Mustrain</span> model and use “0 1
    1545 0” for the Unique axis, <span class=GramE>HKL .</span> <span class=GramE>Select
    1546 refinement for both Equatorial and Axial <span class=SpellE>mustrain</span>.</span>
     1536<B>select uniaxial</B> for the <span class=SpellE>Mustrain</span> model and <B>use “0 1
     15370” for the Unique axis</B>, <span class=GramE>HKL .</span> <span class=GramE><B>Select
     1538refinement for both Equatorial and Axial <span class=SpellE>mustrain</span>.</span></B>
    15471539</p>
    15481540
     
    15621554 mso-wrap-style:square'>
    15631555 <v:imagedata src="SequentialTutorial_files/image033.png" o:title=""/>
    1564 </v:shape><![endif]--><![if !vml]><img width=453 height=340
    1565 src="SequentialTutorial_files/image034.jpg" v:shapes="Picture_x0020_15"><![endif]></span></p>
     1556</v:shape><![endif]--><![if !vml]><img
     1557src="SequentialTutorial_files/image034.png" v:shapes="Picture_x0020_15"><![endif]></span></p>
    15661558
    15671559<h2>Step 2: Prepare for sequential fit. </h2>
     
    16001592style='mso-fareast-font-family:Cambria;mso-bidi-font-family:Cambria'><span
    16011593style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    1602 </span></span></span><![endif]>Click on the first phase (CuCr2O4) and on the
    1603 General tab, click on the refine unit cell option to turn off refinement. </p>
     1594</span></span></span><![endif]><B>Click on the first phase (CuCr2O4) and on the
     1595General tab</B>, click on the refine unit cell option to <B>turn off refinement</B>. </p>
    16041596
    16051597<p class=MsoListParagraphCxSpMiddle><span style='mso-spacerun:yes'> </span><span
     
    16161608style='mso-fareast-font-family:Cambria;mso-bidi-font-family:Cambria'><span
    16171609style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    1618 </span></span></span><![endif]>On the Data tab, click on the D11, D22 and D33
    1619 terms to refine the lattice strain terms. While here, to simplify convergence
     1610</span></span></span><![endif]>On the Data tab, <B>click on the D11, D22 and D33
     1611terms</B> to refine the lattice strain terms. While here, to simplify convergence
    16201612for the sequential refinement, where lattice constants change significantly,
    1621 turn off the refinement of the three peak width terms and the phase fraction. </p>
     1613<B>turn off the refinement of the three peak width terms and the phase fraction</B>. </p>
    16221614
    16231615<p class=MsoListParagraphCxSpMiddle><span style='mso-spacerun:yes'> </span><span
     
    16341626style='mso-fareast-font-family:Cambria;mso-bidi-font-family:Cambria'><span
    16351627style='mso-list:Ignore'>3.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    1636 </span></span></span><![endif]>Click on the second phase (<span class=SpellE>CuO</span>)
    1637 and on the General tab, click on the refine unit cell option to turn off
     1628</span></span></span><![endif]><B>Click on the second phase</B> (<span class=SpellE>CuO</span>)
     1629and on the <B>General tab</B>, click on the <B>refine unit cell option</B> to turn off
    16381630refinement. </p>
    16391631
    16401632<p class=MsoListParagraphCxSpMiddle><o:p>&nbsp;</o:p></p>
    16411633
    1642 <p class=MsoListParagraphCxSpMiddle>On the Data tab for <span class=SpellE>CuO</span>,
    1643 click on the D11, D22, and D33 terms to refine the lattice strain terms and
    1644 turn off refinement of the phase fraction.<span style='mso-spacerun:yes'> 
     1634<p class=MsoListParagraphCxSpMiddle>On the <B>Data tab</B> for <span class=SpellE>CuO</span>,
     1635<B>click on the D11, D22, and D33 terms</B> to refine the lattice strain terms and
     1636<B>turn off refinement of the phase fraction</B>.<span style='mso-spacerun:yes'> 
    16451637</span>We could refine the D13 term (which corresponds to the <span
    16461638class=SpellE>CuO</span> &#946;* angle), but we do not expect this to change
     
    16641656style='mso-fareast-font-family:Cambria;mso-bidi-font-family:Cambria'><span
    16651657style='mso-list:Ignore'>4.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    1666 </span></span></span><![endif]>Also at this stage, turn off the all the
    1667 background refinement terms by clicking on Background on the histogram tree
     1658</span></span></span><![endif]>Also at this stage, <B>turn off the all the
     1659background refinement terms</B> by clicking on Background on the histogram tree
    16681660item and removing checks from all items (be sure to click elsewhere in the
    16691661window before going on to the next step.) </p>
     
    16971689</v:shape><![endif]--><![if !vml]><img width=237 height=312
    16981690src="SequentialTutorial_files/image044.png" align=right hspace=12 v:shapes="Picture_x0020_33"><![endif]>Likewise,
    1699 for the histogram Sample Parameters turn off and the Sample Displacement
    1700 parameter by clicking on the Sample Parameters item in the histogram entries.</p>
     1691for the histogram Sample Parameters, <B>turn off the Sample Displacement
     1692parameter</B> by clicking on the Sample Parameters item in the histogram entries.</p>
    17011693
    17021694<p class=MsoListParagraphCxSpMiddle><o:p>&nbsp;</o:p></p>
     
    17421734</v:shape><![endif]--><![if !vml]><img width=214 height=209
    17431735src="SequentialTutorial_files/image046.png" align=right hspace=12 v:shapes="Picture_x0020_17"><![endif]>The
    1744 remaining datasets are read using Import/Powder Data/from GSAS powder data file
    1745 to open a file browser. Again select “zip archive” and the downloaded <span
    1746 style='font-family:Courier'>SeqTut.zip</span> file. Select all the .<span
    1747 class=SpellE>fxye</span> files except <span style='font-family:Courier'>OH_00.fxye</span>
     1736remaining datasets are read <B>using Import/Powder Data/from GSAS powder data file</B>
     1737to open a file browser. Again <B>select “zip archive” and the downloaded <span
     1738style='font-family:Courier'>SeqTut.zip</span></B> file. <B>Select all the .<span
     1739class=SpellE>fxye</span> files</B> except <span style='font-family:Courier'>OH_00.fxye</span>
    17481740(use of the filter can again be helpful to show just the data file; press Set
    17491741All and then unselect the one unneeded file). </p>
     
    17511743<p class=MsoListParagraphCxSpMiddle><o:p>&nbsp;</o:p></p>
    17521744
    1753 <p class=MsoListParagraphCxSpMiddle>This time one must select the instrument
    1754 parameter file. </p>
     1745<p class=MsoListParagraphCxSpMiddle>This time one must <B>select the instrument
     1746parameter file</B>. </p>
    17551747
    17561748<p class=MsoListParagraphCxSpMiddle><span style='mso-fareast-language:EN-US;
     
    17651757<p class=MsoListParagraphCxSpMiddle><o:p>&nbsp;</o:p></p>
    17661758
    1767 <p class=MsoListParagraphCxSpMiddle>Set all data sets to use the two phases, as
     1759<p class=MsoListParagraphCxSpMiddle><B>Set all data sets to use the two phases</B>, as
    17681760before in step 1 #6. </p>
    17691761
     
    18291821 <v:imagedata src="SequentialTutorial_files/image051.png" o:title=""/>
    18301822 <w:wrap type="square" anchorx="margin" anchory="margin"/>
    1831 </v:shape><![endif]--><![if !vml]><img width=93 height=44
    1832 src="SequentialTutorial_files/image052.jpg" align=right hspace=12 v:shapes="Picture_x0020_19"><![endif]>Copy
    1833 the histogram parameters from the first histogram to the new ones: Click on the
    1834 original PWDR OH_00.fxye Bank 1 entry. Use menu command Commands/Copy <span
    1835 class=SpellE>params</span>. </p>
     1823</v:shape><![endif]--><![if !vml]><img
     1824src="SequentialTutorial_files/image052.png" align=right hspace=12 v:shapes="Picture_x0020_19"><![endif]>Copy
     1825the histogram parameters from the first histogram to the new ones: <B>Click on the
     1826original PWDR OH_00.fxye Bank 1 entry</B>. Use menu command <B>Commands/Copy <span
     1827class=SpellE>params</span></B>. </p>
    18361828
    18371829<p class=MsoListParagraphCxSpMiddle><o:p>&nbsp;</o:p></p>
     
    18551847The Instrument Parameters have not been changed in this exercise and are all
    18561848read from the same instrument parameter file, but there is no harm in copying
    1857 them, so the default entries do not need to be changed. Press OK. Note that all
     1849them, so the default entries do not need to be changed. <B>Press OK</B>. Note that all
    18581850parameters are copied except measurement information such as setting angles,
    18591851temperature, etc. </p>
     
    18621854
    18631855<p class=MsoListParagraphCxSpMiddle>An additional dialog window is shown which
    1864 asks which histograms should receive the parameters. Press Set All to select
    1865 all remaining histograms and then press OK. </p>
     1856asks which histograms should receive the parameters. <B>Press Set All</B> to select
     1857all remaining histograms and then <B>press OK.</B> </p>
    18661858
    18671859<p class=MsoListParagraphCxSpMiddle><o:p>&nbsp;</o:p></p>
     
    18891881style='mso-fareast-font-family:Cambria;mso-bidi-font-family:Cambria'><span
    18901882style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    1891 </span></span></span><![endif]>Click on the first phase (CuCr2O4) and on the
    1892 Data tab. The press the Copy Button;</p>
     1883</span></span></span><![endif]><B>Click on the first phase</B> (CuCr2O4) and on the
     1884<B>Data tab</B>. The press the <B>Copy Button</B>;</p>
    18931885
    18941886<p class=MsoListParagraphCxSpMiddle><span style='mso-fareast-language:EN-US;
     
    19051897originating dataset in the list, and there is no harm in copying parameters to
    19061898all histograms (including the origin), this is a good chance to show how the
    1907 toggle button is used. Select only the “OH_00.fxye” entry. Then press the
    1908 Toggle All button to invert the selections. Then press OK.</p>
     1899toggle button is used. <B>Select only the “OH_00.fxye”</B> entry. Then press the
     1900<B>Toggle All</B> button to invert the selections. Then <B>press OK</B>.</p>
    19091901
    19101902<p class=MsoListParagraphCxSpMiddle><o:p>&nbsp;</o:p></p>
     
    19351927style='mso-fareast-font-family:Cambria;mso-bidi-font-family:Cambria'><span
    19361928style='mso-list:Ignore'>3.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    1937 </span></span></span><![endif]>Copy the Phase/Histogram parameters within the
    1938 second phase by clicking on it (<span class=SpellE>CuO</span>) in the data tree
    1939 (and possibly on the Data tab.) The press the Copy Button and select the
    1940 histograms as done in the previous step</p>
     1929</span></span></span><![endif]><B>Copy the Phase/Histogram parameters within the
     1930second phase</B> by clicking on it (<span class=SpellE>CuO</span>) in the data tree
     1931(and possibly on the Data tab.) The press the <B>Copy Button</B> and <B>select the
     1932histograms</B> as done in the previous step</p>
    19411933
    19421934<p class=MsoListParagraphCxSpLast><o:p>&nbsp;</o:p></p>
     
    19701962</v:shape><![endif]--><![if !vml]><img width=217 height=209
    19711963src="SequentialTutorial_files/image064.png" align=right hspace=12 v:shapes="Picture_x0020_24"><![endif]>First,
    1972 select the Controls item in the data tree and press the Select data button. </p>
     1964<B>select the Controls item</B> in the data tree and press the <B>Select data button</B>. </p>
    19731965
    19741966<p class=MsoListParagraphCxSpMiddle><span style='mso-fareast-language:EN-US;
     
    19821974<p class=MsoListParagraphCxSpMiddle>This opens a window where all histograms
    19831975can be selected (it would be equally valid to skip the first histogram, since
    1984 that has already been fully fit). Press OK and note that the Controls window now
     1976that has already been fully fit). <B>Press OK</B> and note that the Controls window now
    19851977lists the number of datasets in the sequential refinement and two new controls.
    19861978</p>
     
    20051997 <w:wrap type="square" anchorx="margin" anchory="margin"/>
    20061998</v:shape><![endif]--><![if !vml]><img width=360 height=128
    2007 src="SequentialTutorial_files/image068.png" align=right hspace=12 v:shapes="Picture_x0020_34"><![endif]>Check
    2008 the “Copy results to next histogram” checkbox. This is essential. If this is
     1999src="SequentialTutorial_files/image068.png" align=right hspace=12 v:shapes="Picture_x0020_34"><![endif]><B>Check
     2000the “Copy results to next histogram” checkbox</B>. This is essential. If this is
    20092001not selected, then every refinement will start with the current parameters
    20102002(which are all identical, since they were set with the Copy operations.) The
     
    20252017style='mso-fareast-font-family:Cambria;mso-bidi-font-family:Cambria'><span
    20262018style='mso-list:Ignore'>3.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    2027 </span></span></span><![endif]>Change the number of cycles to 10. This is
     2019</span></span></span><![endif]><B>Change the number of cycles to 10.</B> This is
    20282020important, so that refinements have enough cycles to fully adjust to the
    20292021changes in lattice parameters before being used as the starting point for the
     
    20472039 <v:imagedata src="SequentialTutorial_files/image069.png" o:title=""/>
    20482040 <w:wrap type="square" anchorx="margin" anchory="margin"/>
    2049 </v:shape><![endif]--><![if !vml]><img width=106 height=69
    2050 src="SequentialTutorial_files/image070.jpg" align=right hspace=12 v:shapes="Picture_x0020_28"><![endif]>Start
    2051 the sequential refinement with the Calculate/Sequential refine</p>
     2041</v:shape><![endif]--><![if !vml]><img
     2042src="SequentialTutorial_files/image070.png" align=right hspace=12 v:shapes="Picture_x0020_28"><![endif]>Start
     2043the sequential refinement with the <B>Calculate/Sequential refine</B></p>
    20522044
    20532045<p class=MsoListParagraphCxSpMiddle><o:p>&nbsp;</o:p></p>
     
    21952187</p>
    21962188
    2197 <p class=MsoListParagraphCxSpMiddle>After clicking on OK, the Sequential
     2189<p class=MsoListParagraphCxSpMiddle><B>After clicking on OK</B>, the Sequential
    21982190Results item in the data tree is automatically selected, which displays a
    21992191summary of the refinement results as a large table. </p>
     
    22382230<p class=MsoListParagraphCxSpMiddle>Before going farther, it is useful to
    22392231review the trends in the lattice parameters as a sanity check. This can be done
    2240 by double-clicking on a column of the table, such as the 0::b parameter, which
     2232by <B>double-clicking on a column of the table</B>, such as the 0::b parameter, which
    22412233displays this plot:</p>
    22422234
     
    22692261</v:shape><![endif]--><![if !vml]><img width=213 height=207
    22702262src="SequentialTutorial_files/image079.png" align=right hspace=12 v:shapes="Picture_x0020_43"><![endif]>Pressing
    2271 the “K” icon or pressing the “s” key brings up a menu where the x-axis can be selected
     2263the “K” icon or <B>pressing the “s” key</B> brings up a menu where the x-axis can be selected
    22722264as temperature. If the plot fails to update, click on another column and then
    22732265return to the original column. </p>
     
    22802272 mso-wrap-style:square'>
    22812273 <v:imagedata src="SequentialTutorial_files/image080.png" o:title=""/>
    2282 </v:shape><![endif]--><![if !vml]><img width=389 height=296
    2283 src="SequentialTutorial_files/image081.jpg" v:shapes="Picture_x0020_45"><![endif]><span
    2284 style='mso-spacerun:yes'> </span></span></p>
     2274</v:shape><![endif]--></span></p>
    22852275
    22862276<p class=MsoListParagraphCxSpLast><o:p>&nbsp;</o:p></p>
     
    22962286style='mso-fareast-font-family:Cambria;mso-bidi-font-family:Cambria'><span
    22972287style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    2298 </span></span></span><![endif]>Restore the background parameters as before for
    2299 any one histogram and then use the File/Copy flags menu item to copy these
     2288</span></span></span><![endif]><B>Restore the refinement of background parameters</B> as before for
     2289any one histogram and then <B>use the File/Copy flags</B> menu item to copy these
    23002290refinement flags (only) to all other histograms (not in this case, since all
    23012291values are the same, the same result would be obtained from the File/Copy menu
     
    23272317 <v:imagedata src="SequentialTutorial_files/image084.png" o:title=""/>
    23282318 <w:wrap type="square" anchorx="margin" anchory="margin"/>
    2329 </v:shape><![endif]--><![if !vml]><img width=75 height=47
    2330 src="SequentialTutorial_files/image085.jpg" align=left hspace=12 v:shapes="Picture_x0020_48"><![endif]><span
     2319</v:shape><![endif]--><![if !vml]><img
     2320src="SequentialTutorial_files/image085.png" align=left hspace=12 v:shapes="Picture_x0020_48"><![endif]><span
    23312321style='mso-fareast-language:EN-US;mso-no-proof:yes'><!--[if gte vml 1]><v:shape
    23322322 id="Picture_x0020_49" o:spid="_x0000_i1034" type="#_x0000_t75" style='width:158.25pt;
    23332323 height:152.25pt;visibility:visible;mso-wrap-style:square'>
    23342324 <v:imagedata src="SequentialTutorial_files/image086.png" o:title=""/>
    2335 </v:shape><![endif]--><![if !vml]><img width=211 height=203
    2336 src="SequentialTutorial_files/image087.jpg" v:shapes="Picture_x0020_49"><![endif]></span></p>
     2325</v:shape><![endif]--><![if !vml]><img
     2326src="SequentialTutorial_files/image087.png" v:shapes="Picture_x0020_49"><![endif]></span></p>
    23372327
    23382328<p class=MsoNormal><o:p>&nbsp;</o:p></p>
     
    23412331style='mso-fareast-font-family:Cambria;mso-bidi-font-family:Cambria'><span
    23422332style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    2343 </span></span></span><![endif]>Likewise, include the Sample X displacement
    2344 parameter and again use the Command/Copy flags menu item. </p>
     2333</span></span></span><![endif]>Likewise, <B>include the Sample X displacement</B>
     2334parameter and again use the <B>Command/Copy flags menu item.</B> </p>
    23452335
    23462336<p class=MsoListParagraphCxSpMiddle><o:p>&nbsp;</o:p></p>
     
    23612351style='mso-fareast-font-family:Cambria;mso-bidi-font-family:Cambria'><span
    23622352style='mso-list:Ignore'>3.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    2363 </span></span></span><![endif]>For Phase parameters add the three broadening
    2364 terms for the CuCr<sub>2</sub>O<sub>4</sub> phase and the press the “Copy
    2365 flags?” button. (Important: not the Copy button!) For the <span class=SpellE>CuO</span>
     2353</span></span></span><![endif]>For Phase parameters <B>add the three broadening
     2354terms</B> for the CuCr<sub>2</sub>O<sub>4</sub> phase and the <B>press the “Copy
     2355flags?” button</B>. (Important: not the Copy button!) For the <B><span class=SpellE>CuO</span>
    23662356phase, add the single sample broadening term and the remaining lattice
    2367 parameter via the D13 term.<span style='mso-spacerun:yes'>  </span>Again, use
    2368 the “Copy flags?” button. Note that an additional step is needed in order to
     2357parameter</B> via the D13 term.<span style='mso-spacerun:yes'>  </span>Again, <B>use
     2358the “Copy flags?” button</B>. Note that an additional step is needed in order to
    23692359vary Phase fractions, as will be discussed below. </p>
    23702360
     
    23762366 mso-wrap-style:square'>
    23772367 <v:imagedata src="SequentialTutorial_files/image090.png" o:title=""/>
    2378 </v:shape><![endif]--><![if !vml]><img width=332 height=241
    2379 src="SequentialTutorial_files/image091.jpg" v:shapes="Picture_x0020_52"><![endif]></span></p>
     2368</v:shape><![endif]--><![if !vml]><img
     2369src="SequentialTutorial_files/image091.png" v:shapes="Picture_x0020_52"><![endif]></span></p>
    23802370
    23812371<p class=MsoListParagraphCxSpMiddle><o:p>&nbsp;</o:p></p>
     
    23862376 mso-wrap-style:square'>
    23872377 <v:imagedata src="SequentialTutorial_files/image092.png" o:title=""/>
    2388 </v:shape><![endif]--><![if !vml]><img width=332 height=249
    2389 src="SequentialTutorial_files/image093.jpg" v:shapes="Picture_x0020_53"><![endif]></span></p>
     2378</v:shape><![endif]--><![if !vml]><img
     2379src="SequentialTutorial_files/image093.png" v:shapes="Picture_x0020_53"><![endif]></span></p>
    23902380
    23912381<p class=MsoListParagraphCxSpMiddle><o:p>&nbsp;</o:p></p>
     
    23952385style='mso-list:Ignore'>4.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    23962386</span></span></span><![endif]>Start the sequential refinement again with the
    2397 Calculate/Sequential refine menu item. The fits are significantly improved at
     2387<B>Calculate/Sequential refine menu item</B>. The fits are significantly improved at
    23982388higher temperatures, with <span class=SpellE>R<sub>wp</sub></span> values
    23992389between 13.8 and 17.</p>
     
    25122502<p class=MsoListParagraphCxSpMiddle><o:p>&nbsp;</o:p></p>
    25132503
    2514 <p class=MsoListParagraphCxSpMiddle>To set up the new constraint, click on the
    2515 Constraints item in the data tree and the Select tab/”Histogram/Phase”
    2516 menu<span style='mso-spacerun:yes'>  </span>item, and then click on the
    2517 Edit/Add constraint menu item. From the menu, we want one of the two x<span
     2504<p class=MsoListParagraphCxSpMiddle>To set up the new constraint, <B>click on the
     2505Constraints item</B> in the data tree and the <B>Select tab/”Histogram/Phase”
     2506menu<span style='mso-spacerun:yes'>  </span>item</B>, and then <B>click on the
     2507Edit/Add constraint</B> menu item. From the menu, we want one of the two <B>x<span
    25182508style='font-family:Courier'>:*<span class=GramE>:Scale</span></span> wild card
    2519 phase fractions. </p>
     2509phase fractions</B>. </p>
    25202510
    25212511<p class=MsoListParagraphCxSpMiddle><span style='mso-spacerun:yes'> </span><span
     
    25292519
    25302520<p class=MsoListParagraphCxSpMiddle>There will only be one possible matching
    2531 variable in the next window, so select that and press OK.</p>
     2521variable in the next window, so <B>select that and press OK</B>.</p>
    25322522
    25332523<p class=MsoListParagraphCxSpMiddle><span style='mso-fareast-language:EN-US;
     
    25572547
    25582548<p class=MsoListParagraphCxSpMiddle>These two constraints will interfere when
    2559 refining the first histograms, so press the delete button next to the first to
     2549refining the first histograms, so <B>press the delete button next to the first</B> to
    25602550remove it.</p>
    25612551
     
    25752565style='mso-list:Ignore'>6.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    25762566</span></span></span><![endif]>Start the sequential refinement again with the
    2577 Calculate/Sequential refine menu item. Three new columns appear at the end of
     2567<B>Calculate/Sequential refine menu item.</B> Three new columns appear at the end of
    25782568the table, <span class=GramE>for <span style='font-family:Courier'>::</span></span><span
    25792569style='font-family:Courier'>constr0</span> (generated by the constraint) and
     
    25982588<p class=MsoListParagraphCxSpMiddle><o:p>&nbsp;</o:p></p>
    25992589
    2600 <p class=MsoListParagraphCxSpMiddle>Click on the CuCr2O4 phase to and then the
    2601 atoms tab. Double-click on the refine label at the top of the atoms table, a
    2602 refinement controls dialog opens, select X to refine coordinates (only O has
    2603 coordinates not fixed by symmetry) and U to refine the atomic displacement (<span
    2604 class=SpellE>Uiso</span>) values.<span style='mso-spacerun:yes'>  </span>Press
    2605 OK. </p>
     2590<p class=MsoListParagraphCxSpMiddle><B>Click on the CuCr2O4 phase</B> to and then the
     2591atoms tab. <B>Double-click on the refine label</B> at the top of the atoms table, a
     2592refinement controls dialog opens, <B>select X to refine coordinates (only O has
     2593coordinates not fixed by symmetry) and U</B> to refine the atomic displacement (<span
     2594class=SpellE>Uiso</span>) values.<span style='mso-spacerun:yes'>  </span><B>Press
     2595OK.</B> </p>
    26062596
    26072597<p class=MsoListParagraphCxSpMiddle><span style='mso-fareast-language:EN-US;
     
    26332623style='mso-list:Ignore'>7.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    26342624</span></span></span><![endif]>Start the sequential refinement again with the
    2635 Calculate/Sequential refine menu item. The fits are significantly improved at
     2625<B>Calculate/Sequential refine menu item</B>. The fits are significantly improved at
    26362626higher temperatures, with <span class=SpellE>R<sub>wp</sub></span> values
    26372627between 13.8 and 16.4.</p>
    26382628
     2629<p>This completes the sequential refinement tutorial, although many
     2630more things could be attempted to further improve the refinement
     2631quality. Note that the results of this refinement are used for
     2632additional analysis in the <a href="ParametricFitting.htm">Parametric
     2633Fitting and Pseudo Variables for Sequential Fits</a> tutorial.
     2634
    26392635</div>
    26402636
  • trunk/help/gsasII.html

    r1336 r1340  
    23452345style='font-weight:normal'>Sequential refinement</span></a><o:p></o:p></strong></p>
    23462346
     2347<p class=MsoNormal><strong><a href="ParametricFitting.htm"><span
     2348style='font-weight:normal'>Parametric Fitting and Pseudo Variables</span></a><o:p></o:p></strong></p>
     2349
    23472350<p class=MsoNormal><strong><o:p>&nbsp;</o:p></strong></p>
    23482351
Note: See TracChangeset for help on using the changeset viewer.