Skip to content

Commit 526f3b7

Browse files
committed
reorg PWDR plotting
1 parent f7e83d1 commit 526f3b7

File tree

9 files changed

+146
-121
lines changed

9 files changed

+146
-121
lines changed

MDhelp/docs/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ An index on the topics covered in these help pages is given below.
5252
* [ISODISTORT tab](./phaseisodistort.md)
5353
* [Dysnomia tab](./phasedysnomia.md)
5454
3. [Image (IMG)](./image.md) Data Tree entries
55-
4. Powder histogram (PWDR) [overview](./powder.md) and [parent PWDR data tree entry](./powderparent.md)
55+
4. Powder histogram (PWDR) [overview](./powder.md)
56+
* [Parent PWDR data tree entry](./powderparent.md)
5657
* [Comments](./powdercomments.md)
5758
* [Limits](./powderlimits.md)
5859
* [Background](./powderbkg.md)

MDhelp/docs/powder.md

Lines changed: 99 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,110 @@ Each powder diffraction dataset has a number of children (subdata tree items) in
1616
* [Unit Cells List](./powdercells.md)
1717
* [Reflection Lists](./powderrefs.md)
1818

19-
Clicking on the parent or on the subdata tree items, as well as [main (parent) entry for the histogram](./powderparent.md)
20-
them produces similar plots of the powder diffraction histogram, with different variations, as examples:
19+
Clicking on the parent or on the subdata tree items, as well as [main (parent) entry for the histogram](./powderparent.md) allows access to different parameters associated with the dataset and offers different menu commands. With the exception of the Instrument Parameters subtree item, which produces a different type of plot, showing peak widths, each PWDR subtree item produces similar plots of the powder diffraction histogram, with different variations:
2120

2221
* By selecting the Limits entry, range of data used, as well as possible excluded regions, can be set.
2322
* Selecting Reflection Lists allows display of reflection indices (hkl values) for a selected phase. Letting the mouse rest unmoved at the position of a reflection in \(2\theta\), TOF, Q, etc. (the vertical position does not matter) will cause these to be displayed. After a short delay a "tool tip" will appear with indices for any reflections close to the lateral mouse position.
24-
* Selecting Background allows a mouse to be used to define fixed points where a background curve can be fitted to those points.
23+
* Selecting Background allows a mouse to be used to define fixed points, where a background curve can be fitted to those points.
2524
* Selecting Peak List allows positions of peaks to be defined for use in direct peak fitting.
2625
* Selecting Unit Cells List can show the positions of reflections for an arbitrary set of unit cell parameters, optionally with space group extinctions applied.
2726

28-
One selection produces a different type of plot:
27+
* Selecting Instrument Parameters produces a different type of plot, which shows peak widths as a function of Q rather than the powder diffraction histogram.
2928

30-
* Selecting Instrument Parameters displays plot of peak widths as a function of Q rather than the powder diffraction histogram.
3129

32-
Each of the PWDR data tree entries allows access to different parameters associated with the dataset and offers different menu commands.
30+
<H3 style="color:blue;font-size:1.1em">What are the general options for the plot?</H3>
31+
32+
<a name="PWDR_plot_actions"></a>
33+
<a name="PWDR_dragticks"></a>
34+
#### For all plots
35+
36+
* **Move mouse**: As the mouse cursor is moved across the plot, the plot status line will show the cursor position as \(2\theta\) (or TOF), d-spacing, Q and the intensity.
37+
* **Press keyboard keys** - See below. The "s" and "w" modes are commonly used.
38+
* **Drag tick marks** - Select any tick mark and while holding the left mouse button down, move them to where you want them to be displayed (press the s key for Sqrt(I) mode to reset to the defaults). With multiple phases, selecting the 2nd phase, etc. changes the vertical spacing between phases. Tick marks can be dragged only when the main PWDR or Reflection Lists tree items are selected.
39+
* **Drag the difference curve** - When the "normal" obs-calc plot is shown (as opposed to the "w" mode plot where (obs-calc)/sigma is displayed, select any point in the difference curve and while holding the left mouse button down move the curve to where you want it to be displayed (press the s key for Sqrt(I) mode to reset it to the default). The difference curve can be dragged only when the main PWDR or Reflection Lists tree items are selected.
40+
* **Display/edit histogram information** - By selecting different tree items within the current histogram, it is possible to display and, in some cases, edit information associated with the histogram. See above.
41+
* **Create a Publication-ready plot** - Press the green "P" button to generate a customizable version of the displayed plot that can be exported at high resolution, [as discussed below](#PWDR_publication).
42+
* **Highlight reflection positions** - By selecting the "Reflection Lists" tree item and a phase, if the mouse is moved to the region of a reflection in that phase, a "tool tip" (temporarily displayed text) with the indices for nearby reflections is displayed.
43+
* **Label reflection positions** - Right-clicking on a reflection tickmark (in the PWDR and "Reflection Lists" plots) will cause an hkl label with the indices for nearby reflection(s) to be displayed. Once a reflection label is shown, it can be dragged to a new position vertically with the left mouse button. Right-clicking on the label will delete it. All hkl labels can be deleted with a menu command. The hkl labels, including their positions, are saved in the GSAS-II project (.gpx) file.
44+
45+
The following key press characters have defined actions. These actions can also be initiated from the Key Press button on the plot toolbar. Not all actions are available for all PWDR subdata tree items.
46+
47+
<a name="PWDR_keylist"></a>
48+
#### For line plots
49+
50+
* **s: Sqrt(I) on/off** - changes the y-axis to be the square-root of the intensity. The tick mark and the difference curve location is reset.
51+
* **w: toggle diff plot mode** - for the pattern selected from the data tree, this will replace the difference (obs-calc) curve with the differences divided by their standard uncertainty (esd) values [(obs-calc)/sigma], which shows the significance of the deviations in the fit of the pattern. (Recommended for proper evaluation of the differences). In this mode both plots have separate zoom control.
52+
* **b: subtract background** - Subtracts the fitted background from the powder pattern. Pressing this again turns the mode off.
53+
* **n: log(I) on/off** - changes the y-axis to be the log10 of the intensity; difference curve is not shown for log(I) on.
54+
* **q: toggle Q plot** - changes the x-axis to Q. This will put multiple powder patterns taken at different wavelengths/types on the same x-axis scale.
55+
* **t: toggle d-space plot** - changes the x-axis d-space. This will put multiple powder patterns taken at different wavelengths/types on the same x-axis scale. May not be very useful with data over a wide range.
56+
* **e: set excluded region** - Defines a new excluded region: press the "e" key with the mouse on one side of the region. Move the mouse to the other side and press "e" again. The region markers (magenta dashed lines) can be dragged to new positions. Available only when the Limits tree entry is selected.
57+
* **f: toggle full length reflection tick marks** - Reflection positions are indicated when the main PDWR tree entry is selected, or when the "Reflection Lists" entry is selected by display of vertical lines. These lines can be shown as tick marks, short lines or thin vertical line the full length of the plot. The 'f' key toggles between the two modes.
58+
* **x: show excluded region** - Normally all observed data is plotted. When the "x" key is pressed, data inside excluded regions are not shown.
59+
* **g: grid lines** - Toggle drawing vertical and horizontal grid lines at all axis label positions. Applies to all plot modes.
60+
* **a: add magnification region** - Adds a magnification region to the plot and sets the magnification amount to x2. This can be edited (or deleted) in the table that is shown when the main PWDR tree entry is selected.
61+
* **.: scaling diagnostic** - When the '.' key is pressed, data are plotted as intensity*weight. Normally this = 1.0 for CW data and proportional to incident spectrum for normalized neutron TOF data. Does not include effect of selected weight factor but is equal to number of detectors in multidetector data.
62+
63+
#### For line plots with more than one powder pattern
64+
65+
* **c: contour on/off** - if multiple powder profiles, then a contour plot is shown of the observed intensities. Data sets of differing length are padded/trimmed to match the 1st pattern.
66+
* **S: set color Scheme** - Select the color map used for contour plots
67+
* **m: toggle single/multiple plot** - In single mode, this will show only the one selected from the data tree. In multiple “waterfall” mode all are superimposed; offset options (below) can be used to shift them. The selected one is displayed as points & curve for obs/calc; others as obs lines only.
68+
* **f: select data** - Allows a subset of the powder patterns to be plotted, rather than all.
69+
* **+,=: no selection** - For multiple powder profiles, only the observed curve is shown when this mode is turned on ('+' and '=' do exactly the same thing).
70+
* **/: normalize** - For multiple powder profiles, all diffraction datasets are normalized so that the maximum intensity is 1 (does not affect the data).
71+
72+
#### Offset modes for line plots in waterfall mode (multiple patterns only)
73+
74+
* **l: offset left** - For a waterfall plot of multiple powder profiles, increase the offset so that later plots are shifted more to the left relative to previous plots.
75+
* **r: offset right** - For a waterfall plot of multiple powder profiles, increase the offset to the right (or decrease the left offset.)
76+
* **d,D: offset down** - For a waterfall plot of multiple powder profiles, increase the offset down. (D does the same as d but to a much larger amount)
77+
* **u,U: offset up** - For a waterfall plot of multiple powder profiles, increase the offset up. (U does the same as u but to a much larger amount)
78+
* **o: reset offset** - For a waterfall plot of multiple powder profiles, reset to no offset.
79+
80+
#### For contour plots
81+
82+
* **d: lower contour max** - This lowers the level chosen for the highest contour color.
83+
* **D: lower contour min** - This lowers the level chosen for the lowest contour color; can be negative.
84+
* **u: raise contour max** - This raises the level chosen for the highest contour color
85+
* **U: lower contour min** - This lowers the level chosen for the highest contour color
86+
* **i: interpolation method** - This changes the method used to represent the contours. If selected a dialog box appears with all the possible choices. Default is 'nearest'; the other useful choice is 'bilinear', this will smooth out the contours.
87+
* **s: color scheme** - This changes the color scheme for the contouring. Default is 'Paired', black/ white options are 'Greys' and 'binary' (for black on white) or 'gray' (for white on black). Others can be very colorful (but not useful!)
88+
* **c: contour off/on** -This turns off contouring and returns to a waterfall plot with any offsets applied.
89+
* **t: temperature on/off** - Show “temperature” for y-axis; valid only if temperature is varied across data sequence and evenly spaced.
90+
* **s: toggle sqrt(I) plot** - Show sqrt(intensity) in contour plot
91+
92+
#### For display of reflections from magnetic unit space groups
93+
94+
These two key commands allow one to step through the output from k-SUBGROUPSMAG in Unit Cells List that are marked “Keep”.
95+
96+
* **j: show next; clear Keep flag** - Show the next magnetic space group in the list, clearing the "Keep" flag for the currently displayed space group. Use this to remove magnetic substructures from consideration that don't satisfy the reflection extinction conditions.
97+
* **k: show next** - Show the next magnetic space group in the list. The "Keep" flag for the currently displayed space group is unchanged.
98+
99+
<a name="PWDR_publication"></a>
100+
<a name="PublicationPlots"></a>
101+
### Publication Plots
102+
103+
When the green "P" button is pressed, a copy of the current powder diffraction plot is presented in a separate window. This can only be done with plots of a single histogram, not for waterfall or contour plots. The separate plot offers GUI controls to modify aspects of the plot, for example by changing colors, line widths, plot limits the contents or size of displayed text. The displayed plot, including any changes made, can be exported in a number of formats. These include a number of bitmap formats (JPEG, PNG, TIFF,...) that can then be imported into other programs; several formats offer vector graphics (Postscript, PDF, SVG), that will render at whatever resolution is desired, which can be of great value for posters or other applications where pixilation would be problematic; other formats are intended to be read into other software: Input for the Grace, Igor Pro and Origin programs is offered, as well as a generic .csv file that can be used with custom software. Note that Igor Pro and Origin are commercial products. (Origin export is only available on Windows and requires that Origin 2021 or later be installed on the computer where GSAS-II is installed.) The Grace program is open-source, runs on all major computing platforms, and is available in several versions.
104+
105+
**The `.csv` file** consists of 10 or more columns (depending on the number of phases included in the histogram). The columns are described below, noting that N is the total number of phases and if there are M data points in the histogram, will be M datapoints in each column except in the Phase, tick-pos, and Axis-limits columns.
106+
107+
1) Used: Indicates if the data point is inside the plot limits or is excluded from the fit. A value of 1 means the values are used and 0 means the data point is not used.
108+
109+
2) X: The x-values from the plot in the units used in the plot (2theta, Q,...). The units are noted in the header.
110+
111+
3) Obs: The observed diffraction intensity. This may be modified by scaling options or background subtraction, if that has been selected for the plot.
112+
113+
4) Calc: The computed diffraction intensity. This will usually be zero if "Used" is 0.
114+
115+
5) Bkg: The computed background value at the current "X" location, This will usually be zero if "Used" is 0.
116+
117+
6) Diff: The plotted difference curve. This will have the offset used in the plot.
118+
119+
6+i) Phase i: This has the reflection positions (tickmarks) in the same units as used for "X". There will be far fewer values for this than for the previous columns.
120+
121+
7+N) tick-pos: The name of each phase followed by the vertical position used to display the tickmarks for each phase. There will be 2N of these values.
122+
123+
8+N) diff/sigma: The uncertainty-weighted difference plot [(Obs-Calc)/sigma where sigma is the statistically expected uncertainty in the obs values, i.e. the standard uncertainty values]. Note that values where "Used" is 0 are meaningless, as the Calc value is 0, but the Obs and sigma values are from the data.
124+
125+
9+N) Axis-limits: Has four values, x-min, x-max, y-min and y-max as used as the limits for the plot.

MDhelp/docs/powderbkg.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,5 @@ Any modification of the background representation will be immediately applied to
6767
<H3 style="color:blue;font-size:1.1em">What is plotted here?</H3>
6868

6969
The plot is the largely the same as for the parent PWDR Powder Histograms tree entry
70-
[with the same plot actions](./powderparent.md#PWDR_plot_actions) and [same key press commands](./powderparent.md#PWDR_keylist), except that tickmarks are not shown and the obs-calc position cannot be dragged.
70+
[with the same plot actions](./powder.md#PWDR_plot_actions) and [same key press commands](./powder.md#PWDR_keylist), except that tickmarks are not shown and the obs-calc position cannot be dragged.
7171
Specific to this plot are fixed background points. These can be added, deleted and moved. Once that is done the background parameters for the selected function can be fitted to the fixed points. NB: the number of fixed points must exceed the number of background parameters to be fitted. Not recommended for fitting sharp Bragg peak backgrounds unless sufficient fixed points are selected across each Bragg peak.

MDhelp/docs/powdercells.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ The "Make new phase" command creates a new phase from the selected unit cell and
6161
<H3 style="color:blue;font-size:1.1em">What can I do with the plot?</H3>
6262

6363
The plot is the largely the same as for the parent PWDR Powder Histograms tree entry
64-
[with the same plot actions](./powderparent.md#PWDR_plot_actions) and [same key press commands](./powderparent.md#PWDR_keylist), except that tickmarks are not shown and the obs-calc position cannot be dragged. The fit limits can be changed from the plot either here or in the Limits data tree. Change the upper and lower Tmin values by clicking on the appropriate vertical line and dragging it to the right or left. Reducing the maximum Q value (TOF min or 2θ max) can greatly speed the time needed to compute reflections from a unit cell.
64+
[with the same plot actions](./powder.md#PWDR_plot_actions) and [same key press commands](./powder.md#PWDR_keylist), except that tickmarks are not shown and the obs-calc position cannot be dragged. The fit limits can be changed from the plot either here or in the Limits data tree. Change the upper and lower Tmin values by clicking on the appropriate vertical line and dragging it to the right or left. Reducing the maximum Q value (TOF min or 2θ max) can greatly speed the time needed to compute reflections from a unit cell.
6565

6666
<a name="Laue_List"></a>
6767
### Visualization Laue classes

MDhelp/docs/powderindexppeaks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This window shows the list of peaks that will be used for indexing (see [Unit Ce
2020
<H3 style="color:blue;font-size:1.1em">What is plotted here?</H3>
2121

2222
The plot is the largely the same as for the parent PWDR Powder Histograms tree entry
23-
[with the same plot actions](./powderparent.md#PWDR_plot_actions) and [same key press commands](./powderparent.md#PWDR_keylist).
23+
[with the same plot actions](./powder.md#PWDR_plot_actions) and [same key press commands](./powder.md#PWDR_keylist).
2424
Specific to this plot are the peak positions that are shown as vertical solid blue lines. To show that a peak is selected, it is highlighted in yellow and, if "use" is selected, the blue line is made wider. The upper and lower data limits are shown as red and green dashed vertical lines, respectively. Tick marks aer not shown. Limits cannot be dragged from this data tree item.
2525

2626
<H3 style="color:blue;font-size:1.1em">What can I do with the plot?</H3>

MDhelp/docs/powderlimits.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ You can add an excluded region using the "Add excluded region" command in the "E
2525
<H3 style="color:blue;font-size:1.1em">What is plotted here?</H3>
2626

2727
The plot is the largely the same as for the parent PWDR Powder Histograms tree entry
28-
[with the same plot actions](./powderparent.md#PWDR_plot_actions) and [same key press commands](./powderparent.md#PWDR_keylist), except that tickmarks and the obs-calc position cannot be dragged. What is unique to the Limits subdata tree entry is that vertical lines are displayed for the fitting limits: green for the lower Tmin value and red for the upper Tmin value. Excluded regions are displayed with pairs of magenta vertical lines. All these vertical lines can be dragged to set limits or change excluded regions.
28+
[with the same plot actions](./powder.md#PWDR_plot_actions) and [same key press commands](./powder.md#PWDR_keylist), except that tickmarks and the obs-calc position cannot be dragged. What is unique to the plot associated with the Limits subdata tree entry is that the entire pattern is shown, including data outside the limits and regions that are ignored. Also, vertical lines are displayed for the fitting limits: green for the lower Tmin value and red for the upper Tmin value. Excluded regions are displayed with pairs of magenta vertical lines. All these vertical lines can be dragged to set limits or change excluded regions.
2929

3030
<H3 style="color:blue;font-size:1.1em">What can I do with the plot?</H3>
3131

0 commit comments

Comments
 (0)