Tip of the Week for Athena and Artemis

This page collects tips on using obscure but useful features of Athena and Artemis. The tip are collected blog-style. That is, newer tips are added to the beginning of the page. Check back each week to see what cobwebby corner of his codes Bruce has dusted off.

This effort has been retired. In the two months that worked on this page, I received only a single comment. When I stopped posting tips, I received no complaints. It would seem that this sort of thing is of little interest to my user community. - BR, 3 February 2006


(21 October, 2005) Artemis: Quickly plotting paths from the Feff interpretation page

There are several useful features bound to a right mouse click on the Feff interpretation page. One that use quite frequently is a quick and handy tool for making plots of the data along with a number of paths. In the picture below, you'll see that I have selected three paths from the Feff calculation. These are the ones highlighted in yellow. The easiest way to select three non-contiguous paths is to left-click while holding down the control key. Once the paths are selected, you can right click on any of them to display the context menu. The option for "Plot data and these paths in..." displays a submenu which allows you choose to make the plot in k, R, or back-transformed k space.

totw_pathsplot.png

I use this tool before a fit to examine which paths are likely to be improtant in the fit and after a fit to see how the paths actually contribute to the fit. This plots made by this tool can, of course, also be made by selecting the data and the paths form the the Data and Groups List, the pressing one of the red plot buttons. But I think you'll find this tool to be a friendly shortcut. (!)


(14 October, 2005) Athena: Automatic replotting

Next to many of the entry boxes in Athena are little buttons with a little blue X on them. When you can click one one of these buttons, a prompt in the echo area at the bottom of the Athena window tells you to click on a point in the plot. The point you click on is then inserted into the entry box and the plot is automatically remade.

For the background removal parameters, especially the pre-edge and normalization parameters, the automatic replot is very handy. When you use the blue X buttons associated with the FT kmin and kmax buttons, the automatic replotting is done in R-space. The R-space replotting has become a widely disliked feature of Athena. Indeed, it generated so many complaints that I made a special preference for disabling replotting after clicking those two buttons. To set it, go to the preferences dialog from the Settings menu and set the fft->pluck_replot variable to false.

If you really love the automated replotting, you might be interested in setting the general->autoreplot variable to true. This will cause data to be replotted whenever any change is made to any parameter. This is nice in that it provides immediate feedback to your changes. However, this feature is rather aggressive -- every key stroke made while editing a parameter will result in a replot. For instance, if you change a pre-edge parameter from -150 to -140 by backspacing through the 0 and the 5, then typing 4 and 0, the plot will be remade 4 times. Thus, I would only recommend using this feature if you have a fast computer. (!)


(7 October, 2005) Artemis: Selecting paths to plot automatically after a fit

You can tell Artemis to plot one or more paths along with the data and fit when a fit is complete. On the path page there is a button in the upper left hand corner which is labeled "Plot after the fit". Every path that has this button checked will be included in the after-fit plot -- any number of paths can be inlcuded this way in the after-fit plot.

This is particularly useful when you are tracking the behavior of particular paths as you make changes to your fitting model.

Here's a screen shot demonstrating this:

totw_plotpath.png

The right click menu on the Feff interpretation page provides another way of setting the after-fit buttons for paths. (!)


(23 September, 2005) Athena: Constraining parameters between data groups

One nice feature of Athena is that it allows the user to maintain parameters for background removal and Fourier transforms independently for each data set. Often, however, we find a value for a parameter that we like and want to use that value across data sets. Fortunately, Athena provides a flexible set of tools for doing so.

When the mouse passes over a parameter label, the text of that label changes color. If you click the right mouse button on a label, a special menu will pop up. Here is the menu that appears when you right-click on the k-weight label:

totw_param_athena.png

The first two items in that menu will export the k-weight value from the current data group to other groups. You can either export the value to every other group in the current project or you can restrict the export to only those groups which are marked. A marked group is one whose purple button has been clicked. See the tip from 9 September 2005 for a tip about marking groups.

Sometimes it is helpful to constrain parameters "the other way". That is, to import a value from another data group. That is the purpose of the third item in the list. If one and only data group is marked, it is considered the standard. Selecting the third menu item will import the k-weight from that group.

Every parameter that changes color as the mouse passes over will have a menu like this one.

The labels written in blue text at the top of each group of parameters will also post a menu for a right click. Here is the menu for the Background Removel section of parameters:

totw_paramgroup_athena.png

The contents of this menu are very similar to the individual parameter menus and each item behaves in a similar manner. The difference is that the section menus will operate on every parameter in the section. Thus parameter constrain in Athena has different levels of granularity. You can constrain parameters on a one-by-one basis using the individual parameter menus. Or you can constrain groups of related parameters using the section menus. Finally, you will find entries in the Values menu in Athena's menubar which will constrain all parameters all at once.

These parameter constraints are a huge time saver. My normal way of using Athena with a set of data collected from a sample is to import the first scan and play around with its parameters until I find a set that I like. I then import the remaining data and use these tools to set their parameters. (!)


(16 September, 2005) Artemis: Features of the Guess, Def, Set page

Many of the most powerful features of the Guess, Def, Set page are hidden away in various menus. This week's tip is a run-down of the entries in the GDS menu at the top of the Artemis window and in the context menu that pops up when you right click on a parameter. (!)

See http://cars9.uchicago.edu/~ravel/software/doc/Artemis/artemis_gds.html for the GDS document page. Many of the topics described breifly here are discussed in more detail there.

The GDS Menu

totw_gds1.png

Grab all best fits: Replace the values of all guess parameters with their best fit values from the last fit

Annotate selected parameter: Set the annotation string for the parameter highlighted in yellow. This is the same as double clicking on a parameter.

Locate parameter: Write a report identifying all GDS parameters and all path parameters which use the selected parameter.

Show all parameters: write a report displaying all the parameters in a text palette. This is useful for having a display of the parameters while looking at, for instance, a path page in the main window.

Reset all variables: This tells Artemis to use initial guesses rather the most recent best fit values when making plots or summations of paths.

Convert all guesses to sets: This one is kind of self-explanatory.

Discard all variables: Throw everything away, leaving a blank GDS page.

Highlight parameters matching...: This will prompt for a regular expression (see the tip from 9 September 2005). All parameters whose names or math expressions match that regex will be highlighted in a garish green color. This is helpful as a visual aid for how particular parameters are used on the GDS page.

Clear parameter highlights: This removes all the green highlights.

Import variables from text file: This will prompt for a file containing parameter definitions. See the display from Show all parameters for the format. This is a good way to import parameter definitions from a feffit.inp file.

Export variables to text file: This writes a report like Show all parameters to a file, albeit without the fancy colors.

The last three items write informational messages to the echo area at the bottom of the Artemis window.

The right-click menu

Some of the items in this menu work on the extended selection. That means that you can highlight more than one parameter by using special mouse or mouse and keyboard sequences. Left click and drag will select all the parameters you drag over. Left click on one parameter followed by holding the shift key and left clicking on a second parameter will select all parameters between the two, inclusive. Holding the control key and clicking will select that parameter without unselecting any other parameter. When multiple parameetrs are selected, several of the following features will work on the entire set.

The menu shown below is popped up when you right click on a parameter.

totw_gds2.png

Move parameter: This allows you to relocate a parameter to an arbitrary spot in the list. You will be prompted for the name or number of a parameter and this parameter will be moved to a position eithert above or below that one. Parameters can also be moved up or down using alt-k and alt-j

Make parameter: Change the parameter type. This is particularly handy used with extended selection.

Build restraint from parameter: This will create a simple restraint using the penalty() function. A proper discussion of restraints is beyond the scope of this tip.

Copy parameter: Make a copy of this parameter and add it to the list, but using a unique name.

Insert separator: This will insert a visual separator into the list. This is simply a line of dashes. It serves no purpose in the fit, but helps provide some visual structure to the parameter list. The separator can be annoted like any parameter and its annotation will be displayed inside the line of dashes (as seen in the image).

Annotate and Find: These are described above.

Grab best fit: This is like the grab function described above, but only for the selected parameters.

Discard: This is like the discard fucntion described above, but only for the selected parameters.


(9 September, 2005) Athena: Easily marking arbitrary groups

As data are imported in Athena, they are listed in the Data groups list. Each entry in list includes the name of the data set, the text of which acts something like a hyperlink in that clicking on that text will insert the analysis parameters for that group into the main window. Each entry also has a little purple check button which is used for "marking" the group. Much of Athena's functionality revolves around marked groups. For instance, the marked groups are the ones plotted when a purple plotting button is pressed and, merging is done on the set of marked groups. What's more, many of the data processing and data analysis chores recognize the marked groups.

Athena offers a number of simple tools for marking or unmarking groups. These are found in the Mark menu and also have keyboard bindings. Control-a marks all groups, control-u unmarks all groups, and control-i inverts the markings such that the marked groups become unmarked and the unmarked ones become marked.

There is one more tool which is considerably more powerful and flexible. In the Mark menu, this last marking tool it is called "Mark regex" and it is bound to control-r.

So, what does regex mean?

Regex is short for regular expression, which is a somewhat formal way of saying "pattern matching". When you "mark regex", you will be prompted for a string in the echo area at the bottom of the Athena window. This string is compared to the names of all the groups in the Data groups list. Those which match the string become marked and those which fail to match becom unmarked. Let me give you some examples. In a project file containing various vanadium standards, the Data groups list includes

These represent the various oxidation states of vanadium. The last item is an unknown sample which can be interpreted as a linear combination of the other five samples. There are two scans of each sample, as indicated by the .1 and .2.

To make plots of arbitrary combinations of spectra, you can certainly click the appropriate mark buttons on and off. Using regular expression marking is quicker and easier. I'll start with a couple simple examples. If you want to mark only the vanadium foil spectra, hit control-r and then enter foil. To mark the V2O3 and V2O5, but none of the others, hit control-r and enter V2.

In fact, you get to use the entire power of perl's regular expression language (see http://search.cpan.org/dist/perl/pod/perlre.pod for all the details). This means you can use "metacharacters" -- symbols which represent conceptual aspects of strings. Here are a few examples:

Regular expressions are a large and fascinating topic of study, but beyond the scope of this wiki entry. Check out the link above or http://sitescooper.org/tao_regexps.html for more information. Mastering Regular Expressions is a superb book on the subject.

Any regular expression that works in perl will work for marking groups in Athena. If you enter an invalid regular expression, Athena will tell you. Regular expression marking is a wonderful tool, especially for projects containing very many data sets. (!)


(2 September, 2005) Artemis: Customizing path labels

After running Feff from within Artemis, you are able to import paths for use in your fitting model. These paths are placed in the Data and Paths list and, by default, are given labels like Path 1: [Cu_1]. It is possible to customize the label string for your paths to show different (and perhaps more useful) information about each path.

This customization is done by setting a preference. In the Edit menu, select Edit preferences. Click on the little plus sign next to paths to open up the branch of parameters for customizing how paths are handled in Artemis. Click on the label parameter.

This parameter takes a string value. This string can contain special tokens that will be replaced with data relevant to each path. The default value is Path %i: [%p]. In this case the %i is replaced by the path index and the %p by a tokenized description of the path. The complete list of path label tokens are:

  1. %i: path index

  2. %I: index, padded to 4 chars

  3. %p: path geometry

  4. %r: R effective of the path

  5. %n: number of legs of the path

  6. %a: amplitude estimate

  7. %d: path degeneracy

  8. %s: special path (SS for a single scattering path and col. for a path that is collinear or nearly collinear)

To continue using the example of copper metal, setting paths->label to %r (%n) would yield 2.5527 (2) as the path label in the Data and Paths list.

Edit the paths->label parameter then the next time you run Feff, your path labels will contain the new information. (!)


cc-at-3.0.png

Except where otherwise noted, Bruce's content on the Ifeffit wiki is licensed under a Creative Commons Attribution 3.0 License


HoraeTipOfTheWeek (last edited 2009-10-09 19:46:34 by localhost)