8.2 The GSAS-II GUI

When initially started, GSAS-II uses three windows. When used, it will commonly open “modal” dialogs, which are additional, usually small, windows that “lock” the application until information is entered. It occasionally may open other windows, such as web pages, that work independently of the rest of the program and may persist until that window is closed. The three windows are: * the main window, * the graphics window and * the console window, which will each be discussed in the following sections of this chapter.

8.2.1 The main GSAS-II window

The main GSAS-II window is used to show all the information associated with a GSAS-II project, which will contain a single fit or a series of fits. An example of that window is seen in Fig. 8.1.

PIC

Figure 8.1: An example of the main GSAS-II window where a powder diffraction entry was selected in the left-hand panel where the GSAS-II data tree is located.

Most input and and interactions with GSAS-II are performed in this window, with the exception of interactions performed with graphics, which will be discussed in the next section. The main window is divided into three sections. For most operating systems, the menu bar is at the top of the window, but on MacOS and a few varieties of Linux, it appears at the top of the screen. On all platforms, the rest of the window is split into two sections.

The section to the left is the GSAS-II data tree, where each entry shows a part of the project. In general, the data tree reflects the organization of the data structure that GSAS-II uses to save information on the project. Note that the data tree is hierarchical with two levels of entries, so that the indented entries are subentries of the parent above them. Data tree entries can have overall information. For example, the “Notebook” and “Constraints” which are found in all non-empty GSAS-II projects. Others can contain diffraction data, which will be labeled with a prefix such “PWDR” for powder data or “IMG” for diffraction images. Once a structure (phase) has been imported into a project, a data tree entry named “Phases” will be added to the tree with each phase as a child of that entry. There is no limit in GSAS-II to how many datasets and how many phases may be read into a project. There are other types of entries that can appear in the tree. The “Sequential Results” data tree entry will be discussed later in Chapter 21.

When an entry or subentry is selected in the data tree, the contents of that selected entry is shown to the window section to the right. We call that section the GSAS-II data window..

Each time a different entry is selected in the data tree, the contents of the data window change and, as well, the contents of the menu change as well, as commands relevant to the selected data tree entry are added. Such commands will appear between two vertical lines (between the “Export” and “Help” entries. We sometimes call these tree entry-specific menu commands the submenu. When describing menu commands in subsequent sections of the book, I will name them with the menu name followed by a slash and then the name of the entry in the menu. As an example, Help/Tutorials for the Tutorials menu command in the Help menu (which is used to access the GSAS-II tutorials) or using quotes where spaces are present, as in Help/“Citation information” (to see a list of papers that should be cited, depending on what parts of GSAS-II are used.) For menu entries that use a cascade to bring up a second level of menus, three names will be provided, such as Import/Phase/“from CIF file”.

Also note the yellow question mark button to the upper right. This is the “Help” button and will open a web page that describes the selected data tree entry and its associated window. Its appearance changes slightly with operating system.

In Fig. 8.2 a different type of data tree entry has been selected, here for a phase. There is enough phase-related information that it cannot be shown in a single window. When that is the case, the GSAS-II GUI will add a set of “notebook tabs”, which are found at the top of the data window and will also add a “Select tab” entry to the menu. It is possible to select a tab by clicking on, but when there are too many tabs to fit on the page, rather than using the arrows to scroll the list of tabs, the menu is probably easier to use. Each tab may have a separate help entry.

PIC

Figure 8.2: An example of the main GSAS-II window where a phase diffraction entry was selected in the data tree in left-hand panel. This selection changes the window contents to the right as well as section of the menu bar between the Export and Help entries (between the two vertical lines).

Most of the places where the GSAS-II GUI will accept input of numbers, which appear as rectangular boxes such as where the lattice constant values are visible in Fig. 8.2 use a special data entry “widget” developed for GSAS-II. These widgets will validate that valid number has been specified and if a range for the value has been defined that the value is within that range. If the value is not valid, the box background will change color to yellow and the text to red. These entry widgets also allow for input of expressions that will be evaluated. Thus, one can modify a value by adding or multiplying by a factor. More complex expressions can use ** for exponentiation, sqrt() for a square root, pi for \(\pi \) as well as cosd(), sind() and tand() for cosine, sine and tangent, all in degrees. [These can also be abbreviated as cos(), c(), sin(), s(), tan(), t(), and square root as sq().]

8.2.2 The GSAS-II graphics window

A design principle for GSAS-II is to use visualization to help make numerical values more clear and to provide you the ability to provide input graphically wherever appropriate. Many data tree entries will cause graphics to be generated. These graphics are placed in a separate window, which is called the GSAS-II graphics window. In cases where the data tree window has tabs, there may be a different graphics entry for the tab. The help entry for the data tree entry or tab will document the graphical display as well as the data window contents. The graphics may be 2D or 3D. An example of 2D graphics is shown in Fig. 8.3.

As an example of how the graphics window may accept graphical input, consider the example displayed in Fig. 8.3. This was generated by clicking on the main data tree entry for a powder diffraction pattern. Note the tick marks, the small vertical lines near the bottom of the plot that show the reflection positions for each of the two phases that are present. The location of these tick marks on the plot can be changed by clicking the mouse down on any tick mark and then while holding the mouse down, moving up or down vertically to a new location and releasing the mouse. This is called “dragging” the tick mark. The difference curve (the cyan line showing the observed pattern after subtracting the computed pattern) can be dragged as well. If instead, the Limits subentry for a powder pattern had been selected, one has access to set the range of data that will be used in the fit and a slightly different plot is shown. The limits can be changed by typing an entry into the appropriate control on the window or by dragging the green or red vertical line.

The toolbar at the bottom of the window provides controls that change the graphics display. It is documented in the GSAS-II help1 but a few items are worth a specific mention here. The button labeled “K” shows a menu of keystroke commands. As an example, there is a keystroke command “q”. This command will change the plot to display the pattern with the x-axis in Q rather than \(2\theta \). This command can be executed by pressing the “q” keyboard key while the graphics window is active or by selecting the “q” entry in the menu raised when the “K” button is pressed. If you use GSAS-II frequently, you will likely start to remember the keyboard shortcuts for options that you use often, but the “K” button will show you all available options and the help page may provide further explanations. The blue “?” button will open the help page. The green “P” button is used to create version of the current plot that is improved for publication.

PIC

Figure 8.3: The GSAS-II graphics window. Different plots and visualization information is shown here, depending on actions and selections in the main GSAS-II window. Some graphics are be interactive, responding to mouse actions and keyboard keys.

8.2.3 The GSAS-II console window

The final core window opened by GSAS-II is called the GSAS-II console window, as seen in Fig. 8.4. It is used for output of status information, such as information on the installed GSAS-II version and the Python and Python package versions that GSAS-II is using. More information is displayed when the “debug” preference option is set to True. The main purpose of this window is to capture information related to problems with GSAS-II. If an error is encountered when running GSAS-II, information about the error will likely appear here. If you are doing something wrong, I hope the console window will help you understand what the problem is. If it is an error in GSAS-II, this information is essential for debugging. We encourage you to report these errors and when you do please include the output in this console window, but also prefer to get a copy of the .gpx file and instructions on how to duplicate the error as well .

Note that the console window is only used for output from GSAS-II. You will never provide any input to the program in this window.

PIC

Figure 8.4: The GSAS-II console window. This is used for output only. Status and error messages may appear here. This window is not used for any input.