# Changeset 2842

Ignore:
Timestamp:
May 29, 2017 3:23:29 PM (6 years ago)
Message:

cleanups: crash in show LS params; show constraint vars; set filters blank. Tutorials: set import to use download directory; Copy of phase/hist parms: remove current hist from selection; cleanup labels; Extensive revisions to SeqRef? tutorial

Files:
1 deleted
12 edited

Unmodified
Removed
• ## Tutorials/SeqRefine/SequentialTutorial.htm

 r2390 with a set of closely related models that evolve over the course of the measurements.  Sequential refinements can be performed in three different ways:

1.      with differing starting parameters for each histogram

2.      with the same starting parameters for each histogram

3.      where the resulting parameters after refinement with a histogram are used as the starting point for the next histogram.

be performed in two different ways:

A: Where the resulting parameters after refinement with a histogram are used as the starting point for the next histogram.
When this mode is used, the same parameters must be varied in each histogram (phase-based parameters, including those in the phase/data tab are forced to be the same, since there is only one set of these.) This is commonly used for an initial refinement.
B: Where parameters are not copied between histograms.
When this is done, the phase-based parameters from refinement with each histogram are still used as the starting point for the next, but histogram parameters may start all at the same place or may be started at different values, for example to continue a previous sequential refinement to convergence or with more parameters. Note that in this case different sets of parameters may be refined for each histogram.

In this example, we will fit a temperature series. Note that it is also possible to fit a temperature series as a combined refinement and, Hydrostatic/Elastic strain terms), but a combined refinement would average the atomic parameters across all temperatures. A sequential refinement allows each data set to determine the atomic parameters; their variation with temperature might be of interest.

If you have not done so already, start GSAS-II. Some of the pictures in this tutorial are from a Mac OSX machine; these illustrate the differences in menu location from Windows/Linux machines.

histogram to have differing atomic parameters; their variation with temperature might be of interest. Likewise, the parameters on the phase/data tab, such as size/microstrain coefficients, phase fractions, are also allowed to be different for each histogram, if varied.

This example assumes that one is already familiar with use of GSAS-II for simple refinements.

of GSAS-II for simple refinements and have started GSAS-II without a project.

Note that most of the screen images shown in this tutorial are taken from GSAS-II running on a Mac OS X machine; these illustrate that the menus are not located on the data tree or data editing windows.

Step 1: Fit a single temperature.

5.

6.  To illustrate how constraints are used, we will refine both phase fractions, but constrain their sum to be one. To set up the constraint, click on one. (A simpler alternate approach would be to refine only a single phase fraction.) To set up the constraint, click on the Constraints item in the data tree and the Select tab/Histogram/Phase item in the data tree. Then click on the Histogram/Phase tab in the data editing window. Then in the Edit Constr. menu item, and then click on click on the Edit/Add constraintEdit Constr/Add constraint equation menu item.

style='font-family:"Calibri",sans-serif;mso-ascii-theme-font:major-latin; mso-hansi-theme-font:major-latin'>CuCr2O4) click on the , which should open the General Tab. Click on the Refine unit cell option (on the General tab). (On a Mac you will likely need to click on the triangle to the left of cell option (If the phases are not shown, click on the triangle to the left of the Phase style='font-family:"Calibri",sans-serif;mso-ascii-theme-font:major-latin; mso-hansi-theme-font:major-latin'>Data tab, click on show PWDR OH_00.fxye Bank 1 and click bold'>tab and click on the Phase

bold'>select the
Data tab, click on show PWDR OH_00.fxye Bank 1 and click on the tab and click on the Phase fraction box to cause that to be refined.  Also click on the single microstrain (isotropic) term for this second phase.

style='mso-bidi-font-weight:bold'>box to cause that to be refined.

style='font-family:"Calibri",sans-serif;mso-ascii-theme-font:major-latin; mso-hansi-theme-font:major-latin'>PWDR OH_00.fxye Bank 1
in the GSAS-II data tree (for a Mac, you will likely need to click on the triangle to the left of the entry to open the tree item.) Confirm that Background style='font-family:"Calibri",sans-serif;mso-ascii-theme-font:major-latin; mso-hansi-theme-font:major-latin'>Limits entry for entry for histogram PWDR OH_00.fxye Bank 1 and in the Tmin/changed mso-ascii-theme-font:major-latin;mso-hansi-theme-font:major-latin'>New Tmin box (to lower left) change it to 4.5. Important: you will have to select the data box (it will turn blue) and then enter the number (4.5) and then click on some other box in the window so that the change registers.

8.      Optional: mso-hansi-theme-font:major-latin'>4.5.

8. Optional: confirm that the initial parameters have been selected correctly for refinement using the   The file name SeqTut.gpx is assumed here. The refinement progresses quickly to a Rw of ~16%.

The refinement progresses quickly to a wR of ~17%.

style='font:7.0pt "Times New Roman"'>  There are several additional variables that should now be added. One should always refine a sample displacement parameter or perhaps instead a zero correction. In this case, the best choice is to add refine a sample displacement parameter or a zero correction. In most cases with Debye-Scherrer geometry, the best choice is to add the Sample X displ. ) and Gaussian width (sig) to be refined.  Important: note that one must click on another box to ensure that input is recorded.

style='mso-bidi-font-weight:bold'>) to be refined
.

style='mso-bidi-font-weight:bold'>tab, click on the Cryst. Sizesize
and microstrainBackground item, as before. Be sure to click on some other box after clicking on the refine flag, so that the setting is recorded.

item, as before.

Repeating the refinement causes the wR to

Likewise, introduce a peak broadening parameter for the second phase by clicking on CuO in the data tree and click on the single microstrain (isotropic) term for this second phase.

12. Repeating the refinement causes the wR to drop to ~14%. Clicking on the Covariance data tree item shows that the goodness of fit (GOF) is 1.16 (corresponding to a reduced χ2 of 1.2) with 23 refined parameters. While atomic parameters could now be refined, as shown in the plot, this is clearly a good enough place to start refinement with all the datasets.

color:black'>χ
2 <1.2) with 23 refined parameters. While atomic parameters could now be refined, we are already have a good enough fit to start a refinement with all the datasets, as the plot clearly shows.

On the Data tab, click on the D11, D22Data tab, click on the D11, D22 and D33Data window should look something like

window will appear similar to what is below:

style='font-family:"Calibri",sans-serif;mso-ascii-theme-font:major-latin; mso-hansi-theme-font:major-latin'>D13 term (which corresponds to the CuO β* angle), but we do not expect this to change much and expect the refinement to be relatively insensitive to this, due to the small number of CuO peaks that are in the pattern.)

CuO β* angle). However, due to the small number of the small number of CuO peaks that are in the pattern, the refinement to be relatively insensitive to this parameter and convergence will be more rapid if this is added to the refinement later.

4.      Also style='font:7.0pt "Times New Roman"'>      To also simplify the refinement at this stage, turn off the all the background refinement terms by clicking on Background on the histogram tree item and removing checks from all items (be sure to click elsewhere in the window before going on to the next step.)

histogram tree item and removing checks the four items that are refined (overall terms and peak intensity, position and sig.)

5.      One

Optional: One can confirm that the number of parameters is now 7 (3 Dxx terms for phase 1, 3 Dxx terms for phase 2 and a scale factor.) If the refinement is repeated, the fit quality does not change, since these parameters are completely equivalent to the previous. There may result in very non-zero values for the Dxx parameters, but these are much smaller than their uncertainties and are thus within noise of zero.

Step 3: Import the remaining datasets and duplicate information across Dxx terms for phase 2 and a scale factor.) Also, while it is not necessary, as a test it is possible to repeat the refinement. If this is done, the Dxx values will refine to values very close to zero (within the refinement uncertainties) indicating that the lattice parameters were already optimal and the quality of the fit (noted by wR or GOF) will be largely unchanged.

Step 3: Import the remaining datasets histograms.

In this step we bring in the remaining data, duplicate the histogram parameters as well as the phase/histogram parameters and set up to perform a sequential fit.

In this step we bring in the remaining data and ensure that the two phases are linked to each new histogram.

Set all data sets to use the two phases, as before in step 1 #6.

all data sets to use the two phases, as before in step 1 #5.

Optional: src="SequentialTutorial_files/image121.png" align=right hspace=12 v:shapes="Picture_x0020_18">

Optional: Note that the default graphics mode is to display the last dataset read in.  If you want to see the entire style='font-family:"Calibri",sans-serif;mso-ascii-theme-font:major-latin; mso-hansi-theme-font:major-latin'>m: toggle multidata plot from the pop-up window). The U, D, R & L keys control the appearance of a waterfall plot. You can then select the C key for a contour plot of all the data; use U and D keys to change the contrast.

pop-up window). The u, d, r and l keys control the appearance of a waterfall plot. You can also use the c key to obtain a contour plot of all the data, as below; in this mode the u and d keys change the upper level on the color scale, changing the contrast of the plot.

Above, I have used the D to increase the contrast & zoomed in to a location that shows the effect of temperature on major-latin;mso-hansi-theme-font:major-latin'>d key to increase the contrast & zoomed in to a an angular location that shows the effect of temperature on the peak positions.

Step 4: Import the remaining datasets and duplicate information across histograms.

Step 4: Duplicate parameters across histograms and phase/histogram entries.

In this step we bring in the remaining data, duplicate the histogram parameters as well as the phase/histogram parameters and set up to perform a sequential fit.

In this step we make sure that the starting parameters are the same for all histogram as well as the phase/histogram parameters (in the Phase/Data tab).

1.      Copy the histogram parameters from the first histogram to the new ones: Select the original PWDR OH_00.fxye Bank 1 entry. Use menu command 1. Copy the histogram parameters to be the same in all histograms: In this case we have changed limits and varied background and sample parameter values in the first histogram. We will copy those values to all histograms. Select the original histogram, entry PWDR OH_00.fxye Bank 1 and then use the menu command Commands/Copy params.

This causes a dialog box where the sections to be copied are selected. We need to causes a dialog box where the different histogram parameters sets to be copied are selected. We need to duplicate the Sample Parameters between all histograms. The Instrument Parameters have not been changed in this exercise and are all read from the same instrument parameter file, but there is no harm in copying them, so the default entries do not need to be changed. Press Parameters between all histograms. (Note that the Instrument Parameters have not been changed in this exercise from what was read from the same instrument parameter file so they are already the same, but there is no harm in copying them, so the default entries do not need to be changed.) Press OK. Note that all parameters are copied except measurement information such as setting angles, temperature, etc.

major-latin;mso-hansi-theme-font:major-latin'>OK
. Note that this action will only copy the initial values the Sample Parameters section (including all that can be refined) but will not change values such as as setting angles, temperature, etc.

src="SequentialTutorial_files/image124.png" v:shapes="Picture_x0020_20">

That the copy has been performed can be demonstrated by examining any of the additional histogram plots (to see the changed lower limit), etc. Next we need to copy the Phase/Histogram parameters within each phase.

It can be confirmed that the copy has been performed by examining any of the additional histogram plots (to see the changed lower limit) or looking at Background or Sample Parameter values in the Data Editing window.

2.      Select the first phase (2. Next we need to copy the Phase/Histogram parameters (in Phase/Data tab) for each phase: Select the first phase (CuCr2O4) and its Data tab. Then press the tab. When this tab is first pressed, the first histogram linked to this phase (first entry in the list at the upper left) is automatically displayed and the parameters associated with this phase and histogram are displayed. These need to be copied to every other histogram. To do this select the Copy data button for PWDR OH_00.fxye Bank 1;

bold'> menu item from the Edit Phase menu. A dialog window then appears to select where to copy the parameters. Select all histograms by pressing the Set All button. Then press the OK button.

a dialog window appears to select where to copy the parameters. At present GSAS-II includes the originating dataset in the list, and there is no harm in copying parameters to all histograms (including the origin), but this is a good chance to show how the toggle button is used. Select only the OH_00.fxye entry. Then press the Toggle All button to invert the selections. Then press OK.

mso-no-proof:yes'>

It can be verified that the copy took place by clicking Show for additional banks.

by clicking on different histograms in the list on the upper left of the Data tab window.

style='mso-fareast-font-family:"Times New Roman"'>3.      Copy the Phase/Histogram parameters within the second phase by clicking on it (Repeat this copying the Phase/Histogram parameters within the second phase by clicking on it (CuO) in the data tree (and possibly on the Data tab.) Then press the Copy? button and select the histograms as done in the previous step

major-latin'>Data
tab.) Then click on the Edit Phase/Copy data menu item and again select all histograms and press OK as in the last step.

At this point we determine which histograms will be used in the fit and set that the resulting parameters from the results of each refinement will be used for the subsequent refinements.

At this point we set which histograms will be used in the fit and set option that the resulting parameters from the results of each refinement will be used for the next refinement.

(which are all identical, since they were set with the Copy operations.) The first few refinements will go well, but after the temperature has changed enough, the starting lattice parameters (determined from the cell and Dxx values) will be too far off and the refinements will fail.

enough, the starting lattice parameters (determined from the cell and with Dxx, where the latter values are near zero) will be too far off to align with the peaks and the refinements will fail.

major-latin'>Max cycles
to 10. This is important, so that refinements have enough cycles to fully adjust to the changes in lattice parameters before being used as the starting point for the next refinement.

major-latin;mso-hansi-theme-font:major-latin'>10.
By increasing the number of cycles, we allow the lattice parameters to to fully adjust to the current histogram.

Note that if the copy operations in Step 4 were not performed correctly, the parameters in each refinement will not agree and the refinement will stop the refined parameters in each refinement will not be the same and the refinement will stop with an error such as this:

(This error results if the parameters for the second phase were not copied in part 3 so that the phase fraction and strain broadening are retained for all R-factor, from each fit. This shows a steady increase with temperature, as might be expected if there were a systematic change in some sample parameters, such as strain or background or even atomic coordinates (which have not yet been fit). The Δχ2 value in the third column shows the such as strain or background or even atomic coordinates (all of which have not yet been individually fit). The Δχ2 value in the third column shows the percent improvement in χ2 seen in the last cycle of refinement. (If this changes from 4.1 to 4.0, then the value will be 100*(4.1-4.0)/4.0, or 2.5). Since the convergence criterion in the controls is 0.0001 (or 0.01%) we can see that only one refinement failed to converge. However, these shifts are still quite small, so that there is no reason to provide further cycles of refinement without adding new variable parameters.

(As an example, if χ2 were to change from 4.1 to 4.0, then the value will be 100*(4.1-4.0)/4.0, or 2.5). Since the default convergence criterion in the controls is 0.0001 (or 0.01%) small values, as shown above, indicate the refinement converged. It is good idea to make sure that shifts are small, if need be by running further cycles of refinement, before adding more parameters to be varied.

the K icon or pressing the simply pressing the s key brings up a menu where the x-axis can be selected as temperature. If the plot fails to update, click on another column and then return to the original column.

temperature. (If the plot fails to update, click on another column and then return to the original column.)

few steps.

1.      Restore the refinement of background parameters as before for any one histogram and then as before. Do this by selecting the Background tree item for any one histogram, set the flags, as below.

Then use the File/Copy flags menu item to copy these refinement flags (only) to all other histograms. NB: Copy would copy the parameter values as well; probably dont want to do that here.

major-latin;mso-hansi-theme-font:major-latin'>File/Copy
menu item would copy the parameter values as well the flags; in this case it would not matter, since all the background values are still the same, but in general this is probably not what you will want to do here.

2.      Likewise, include the Sample X displ parameter and again style='font:7.0pt "Times New Roman"'>      Likewise, resume varying the Sample X displacement parameter on the Sample Parameters tab for any one histogram and again use the Command/Copy flags menu item.

style='mso-bidi-font-weight:bold'>menu item to all other histograms.

3.      For Phase parameters add the three broadening terms for the CuCr2O4 phase and the press the Copy flags? button. (Important: not the Copy button!) For the CuO phase, add the single sample broadening term and the remaining lattice parameter via the D13 term.  Again, use the Copy flags? button. Note that an additional step is needed in order to vary Phase fractions, as will be discussed below.

style='font:7.0pt "Times New Roman"'>      For the Phase/histogram parameters add the three broadening terms for the CuCr2O4 (CuCr2O4; data tab) phase; then use the Edit Phase/Copy flags menu item so that they are varied for all histograms. Do not use "Edit Phase/Copy data" menu item, as this would reset all the lattice constant displacements to a single set of values, wiping out the results of the previous refinement.

For the CuO phase, add the single sample broadening term and the remaining lattice parameter via the D13 term.  Again, use the Copy flags? button.

5.      We can now add the phase fractions into the refinement, by clicking on the Phase fraction checkbox and Step 8: Sequential refinement constraints

1. We can now add the phase fractions into the refinement, by clicking on the Phase fraction checkbox and Copy Flags button for both phases. However, if the refinement is attempted it will fail as soon as the second histogram is refined with this error:

However, if the refinement is attempted at this point a subtle error will occur. If one looks at the phase fractions for all but the first histogram, the sum of the phase fractions will not add up to one. The reason for this is because the constraint we added in Step 1, section 6. only constrained the values of 0:0:Scale and 1:0:Scale.

One additional step is needed to switch the constraints to work properly. Note that constraint we defined before (on 0:0:Scale and 1:0:Scale) pertains only to the first histogram. Note that a constraint is ignored if none of the variables in it are included in the refinement, so this constraint only affects the first histogram, giving rise to the error above. We could set up a constraint for each histogram that has been added, but this would be rather tedious to set up. The alternate is to set up a constraint where a wildcard (*) is used. Wildcards only apply to

We could define a new constraint for each histogram (on 0:i:Scale and 1:i:Scale for i=1,2,...), but this would be rather tedious. We have an alternate way to define this using a single constraint where a wildcard (*) is used for the histogram number. Wildcards only apply to sequential fits and causes the current histogram number to be inserted for the * when each histogram is used.

menu item. From the menu, we want one of the two x:*:ScaleThe initial and the most recently defined constraints will then be shown.

constraints will then be shown. These two constraints do the same thing for the first histogram and do not interfere but it is best to remove the orignal constraint for simplicity.

press the Delete button for the first one to remove

To remove the initial constrain press the Delete button in front of the first constraint to remove it.

6.      Start

2. Start the sequential refinement again with the Calculate/Sequential style='mso-bidi-font-weight:normal'>1:*:Scale. Changes to the Rwp values are quite small, even though the value for Changes to the Rwp values are quite small, even though the phase fraction for the minor phase changes significantly. This indicates that the refinement is relatively insensitive to these values.

relatively insensitive to these values. This would be a good argument for fixing the value as a constant.

Step 9: Atomic parameter refinement

differently than the previous things we have refined. There is only one set of coordinates for each phase and these will be refined for each histogram, but are not saved individually, except in the summary table.  If we restart the refinement, the coordinates from the last histogram will be used to fit the first. The Reverse order are not saved individually, except in the summary table.

This means that after the sequential refinement has been run, the atomic parameters in the phase(s) will correspond to the last histogram. If we repeat the sequential refinement, the coordinates, etc. from the last histogram will be used to fit the first histogram. This may work fine, but if the values have changed significantly between the first and last histogram, there could be problems. The Reverse order checkbox on the Controls causes the sequential refinement to start with the last histogram, which would avoid this problem.

Select last histogram, which would avoid this issue.

1. Select the CuCr2O4

Note the change in the atom table.

Note the change in the atom table:

7.      Start

2. Start the sequential refinement again with the Calculate/Sequential refine menu item. The fits are significantly improved at higher temperatures, with Rwp values between 13.8 and 16.4. Be sure to save the project file by wp values between 13.8 and 16.4. As would be expected the Uiso values increase with temperature, but the Uiso values for the O atom are less than 0.0 at the lowest temperature. This indicates that these data are insufficient to determine atomic displacements accurately for such a relatively light atom.

This completes the sequential refinement tutorial, although several more things could be attempted to further improve the refinement quality. Be sure to save the project file by selecting the File/Save project menu item, since this will used in a later tutorial.

This completes the sequential refinement tutorial, although many more things could be attempted to further improve the refinement quality. In the Parametric

• ## trunk/GSASII.py

 r2831 Called from the Calculate/View LS Parms menu. ''' parmDict,varyList = self.MakeLSParmDict() try: parmDict,varyList = self.MakeLSParmDict() except: print('Error retrieving parameters') return parmValDict = {} for i in parmDict:
• ## trunk/GSASIIctrls.py

 r2806 print('No helpKey for current dataFrame!') helpType = self.HelpById.get(event.GetId(),helpKey) if helpType == 'Tutorials': if helpType == 'Tutorials': dlg = OpenTutorial(self.frame) dlg.ShowModal() class OpenTutorial(wx.Dialog): '''Open a tutorial, optionally copying it to the local disk. Always copy the data files locally. For now tutorials will always be copied into the source code tree, but it might be better to have an option to copy them somewhere else, for people who don't have write access to the GSAS-II source code location. '''Open a tutorial web page, optionally copying the web page, screen images and data file(s) to the local disk. ''' def __init__(self,parent=None): def __init__(self,parent): style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER wx.Dialog.__init__(self, parent, wx.ID_ANY, 'Open Tutorial', style=style) self.frame = parent # self.frame can be the tree window frame or the data editing window frame, set G2frame to the # tree either way if hasattr(self.frame,'G2frame'): self.G2frame = self.frame.G2frame else: self.G2frame = self.frame pnl = wx.Panel(self) sizer = wx.BoxSizer(wx.VERTICAL) G2MessageBox(self,'Error downloading tutorial','Download error') self.EndModal(wx.ID_OK) self.G2frame.TutorialImportDir = os.path.join(self.tutorialPath,tutorialCatalog[j][0],'data') def onSelectDownloaded(self,event): self.EndModal(wx.ID_OK) ShowWebPage(fullpath,self.frame) self.G2frame.TutorialImportDir = os.path.join(self.tutorialPath,tutorialCatalog[j][0],'data') def onWebBrowse(self,event): '''Make a list of all tutorials on web and allow user to view one. selected = listbox.GetSelection() dlg.Destroy() wx.Yield() # close window right away so user sees something happen if selected < 0: return return selected
• ## trunk/GSASIIgrid.py

 r2840 ''' def __init__(self,parent,title,parmDict,varyList,fullVaryList, size=(300,430)): size=(375,430)): wx.Dialog.__init__(self,parent,wx.ID_ANY,title,size=size, self.hapVars = list(set([' ',]+[item[2] for item in splitNames if item[0] and item[1]])) self.hapVars.sort() self.hisNum = '0' self.phasNum = '0' self.hisNum = ' ' self.phasNum = ' ' self.varName = ' ' self.listSel = 'Refined' self.parmChoice = parmSel.GetStringSelection() self.varName = ' ' wx.CallAfter(self.DrawPanel) wx.CallLater(100,self.DrawPanel) def OnPhasSel(event): self.phasNum = phasSel.GetValue() self.varName = ' ' wx.CallAfter(self.DrawPanel) wx.CallLater(100,self.DrawPanel) def OnHistSel(event): self.hisNum = histSel.GetValue() self.varName = ' ' wx.CallAfter(self.DrawPanel) wx.CallLater(100,self.DrawPanel) def OnVarSel(event): self.phasNum = ' ' self.hisNum = ' ' wx.CallAfter(self.DrawPanel) wx.CallLater(100,self.DrawPanel) def OnListSel(event): self.listSel = listSel.GetStringSelection() wx.CallAfter(self.DrawPanel) wx.CallLater(100,self.DrawPanel) if self.panel: self.panel.DestroyChildren() #self.panel.DestroyChildren() # Bad on Mac: deletes scroll bars sizer = self.panel.GetSizer() if sizer: sizer.DeleteWindows() mainSizer = wx.BoxSizer(wx.VERTICAL) num = len(self.varyList) parmSizer.Add(numSizer) varSizer = wx.BoxSizer(wx.VERTICAL) varSizer.Add(wx.StaticText(self.panel,label='Parameter')) if self.parmChoice in ['Phase',]: varSel = wx.ComboBox(self.panel,choices=self.phasVars,value=self.varName, varSel.Bind(wx.EVT_COMBOBOX,OnVarSel) if self.parmChoice != 'Global': varSizer.Add(wx.StaticText(self.panel,label='Parameter')) varSizer.Add(varSel,0) parmSizer.Add(varSizer,0) parmSizer.Add(varSizer,0) mainSizer.Add(parmSizer,0) listChoice = ['All','Refined'] # skip entries without numerical values if isinstance(self.parmDict[name],basestring): continue if 'Refined' in self.listSel and (name not in self.fullVaryList): continue if 'Refined' in self.listSel and (name not in self.fullVaryList ) and (name not in self.varyList): continue if 'Phase' in self.parmChoice: if self.phasNum != ' ' and name.split(':')[0] != self.phasNum: continue
• ## trunk/GSASIIphsGUI.py

 r2841 UseList = data['Histograms'] hist = G2frame.hist keyList = G2frame.GetHistogramNames(hist[:4]) keyList = G2frame.GetHistogramNames(hist[:4])[:] if hist in keyList: keyList.remove(hist) sourceDict = UseList[hist] if 'HKLF' in sourceDict['Histogram']: copyDict[name] = copy.deepcopy(sourceDict[name])        #force copy if UseList: dlg = G2G.G2MultiChoiceDialog(G2frame.dataFrame, 'Copy parameters', 'Copy parameters to which histograms?',keyList) dlg = G2G.G2MultiChoiceDialog(G2frame.dataFrame, u'Copy phase/histogram parameters\nfrom '+hist[5:][:35], 'Copy phase/hist parameters', keyList) try: if dlg.ShowModal() == wx.ID_OK: for bab in babNames: copyDict[name][bab] = sourceDict[name][bab][1] keyList = G2frame.GetHistogramNames(hist[:4]) keyList = G2frame.GetHistogramNames(hist[:4])[:] if hist in keyList: keyList.remove(hist) if UseList: dlg = G2G.G2MultiChoiceDialog(G2frame.dataFrame, 'Copy parameters', 'Copy parameters to which histograms?', keyList) dlg = G2G.G2MultiChoiceDialog(G2frame.dataFrame, u'Copy phase/histogram flags\nfrom '+hist[5:][:35], 'Copy phase/hist flags', keyList) try: if dlg.ShowModal() == wx.ID_OK: UseList = data['Histograms'] hist = G2frame.hist keyList = G2frame.GetHistogramNames(hist[:4]) keyList = G2frame.GetHistogramNames(hist[:4])[:] if hist in keyList: keyList.remove(hist) sourceDict = UseList[hist] copyDict = {} copyDict[parm] = copy.deepcopy(sourceDict[parm]) if UseList: dlg = G2G.G2MultiChoiceDialog(G2frame.dataFrame, 'Copy parameters', 'Copy parameters to which histograms?',keyList) dlg = G2G.G2MultiChoiceDialog(G2frame.dataFrame, u'Copy selected phase/histogram parameters\nfrom '+hist[5:][:35], 'Copy selected phase/hist parameters', keyList) try: if dlg.ShowModal() == wx.ID_OK:
Note: See TracChangeset for help on using the changeset viewer.