How to Import Data from DUBBLE Directly into Athena

The DUBBLE beamline, BM26 at the ESRF, uses the same data acquisition system as an old XAS beamline from the now-closed SRS at Daresbury Laboratory in England. The data files written out by this system are a bit peculiar. Rather than storing data as a function of energy, data are stored as a function of monochromator angle measured in millidegrees. Yup! Millidegrees! What's more, when their 9-element germanium detector (see here for beamline details) is used to collect data, the scalars from the elements of the detector are spread over several lines in a way that is guaranteed to confuse Ifeffit (and probably most plotting programs). Consequently, a data analysis program must either be aware of the details of the file format, or conversion to a simpler form is required. The Athena way of dealing with quirky data files is to use a so-called file type plugin. This is a short piece of code that can be dropped into the proper location on your computer. When Athena starts up, she will notice that the new plugin is there, import it, and make it available for use. The plugin provides two functions -- one is for recognizing a data file as boing of a certain type (in this case, as being from the DUBBLE beamline), the other is for converting the data into a temporary file in a format the Athena can easily import. Once installed and enabled, files from DUBBLE will be imported transparently into Athena using Athena's normal column selection dialog.

If you have data from the old SRS that you would like to import into Athena, please ask about this on the the Ifeffit mailing list. It will be simple to modify this plugin to handle SRS data, although I will need to see some examples in order to do the testing.

Installing on Windows

In these instructions, %APPDATA% = C:\Documents and Settings\bravel\Application Data\ on my computer. On your computer, bravel will be replaced by your login name.

  1. Put the DUBBLE.pm file in the folder %APPDATA%\horae\Ifeffit\Plugins\Filetype\Athena\ and name it DUBBLE.pm.

  2. Follow the instructions in the Athena document to verify that the plugin was installed and loaded correctly and is enabled for use by Athena.

Installing on Unix

In these instructions, $HOME = /home/bruce on my computer. On your computer, bruce will be replaced by your login name.

  1. Put the DUBBLE.pm file in the folder $HOME/.horae/Ifeffit/Plugins/Filetype/Athena/ and name it DUBBLE.pm.

  2. Follow the instructions in the Athena document to verify that the plugin was installed and loaded correctly and is enabled for use by Athena.

This procedure should work on the Mac also.

System-wide installation

The instructions above are intended for an individual user. If you would like to install the plugin in a way that will benefit all users of a computer system, albeit in a way that requires administrative access to the computer, follow these instructions.

Windows

Put the DUBBLE.pm file in the folder %IFEFFIT%\share\perl\Ifeffit\Plugins\Filetype\Athena\ and name it DUBBLE.pm. Here %IFEFFIT is the installation location of the Ifeffit package, for which the default is `C:\Program Files\Ifeffit\'.

Unix

First figure out the system-wide plugin location for Athena on your computer. This can be done by copying and pasting this one-liner into a terminal window

perl -e 'use Ifeffit::Group; $dir=$INC{"Ifeffit/Group.pm"}; $dir=~s{Group.pm}{}; print $dir."Plugins/Filetype/Athena/",$/'

Put the DUBBLE.pm file in that folder and name it DUBBLE.pm.

Instruct the users of that computer to follow the instructions in the Athena document to verify that the plugin is installed and loaded correctly and to enable it for use by Athena.

Using the plugin

You can verify that the plugin has been installed correctly and imported by Athena by checking the echo buffer, which can be found in the Edit menu. You should see a line stating that the DUBBLE plugin was loaded.

Athena's echo buffer

Once you have verified this and made sure that the plugin is enabled by following the instructions in the Athena document, simply import data as you normally would. The magic of converting the file to a usable form will happen transparently and you will be presented with the normal file selection dialog. Here is an example using some fluorescence data given to me by Eric Breynaert:

column selection dialog

Use the column selection dialog in the normal way. In the data files I was given by Eric and Qingping Wu, I0 was in column 3 and It was in column 4. So, transmission is imported by selecting column 3 for the numerator and column 4 for the denominator. I only had one example of fluorescence data using the 9-element Ge detector. In that file, it seemed as though element 1 was not functional. Thus, to import the MED data, I selected columns 8 through 15 for the numerator and column 3 as the denominator. (Don't forget to click the natural log button for your transmission data!)

DUBBLE data imported

What the plugin does

  1. A bit of lexical analysis of the text is performed to determine whether the file contains MED scalars. If so, the lines containing MED data are folded onto the same line as the rest of the measurements at each data point.
  2. The energy at each point is calculated from the mono angle using a Si lattice constant of 3.13543, which was provided to me by Eric Breynaert. You can see the full calculation for converting angle to energy at lines 114 and 115 of the plugin source file.
  3. The data are exported to a temporary file which will be deleted by Athena when you quit the program. This temporary file has all the same headers as the original file, except they are preceded by the hash character (#). The columns of data are separated by white space with energy in the first column, followed by the scalars that appear on the same line as the mono angle in the original file, followed as needed by the MED scalars.

Problems

I have tested this plugin against a limited set of data. If you have trouble using the plugin or if you suspect the plugin is doing the wrong thing, please send mail to the Ifeffit mailing list. If you post to the mailing list, I will look into your problem. Please do not send mail to me directly.

BruceRavel/Horae/DubbleBeamline (last edited 2011-06-05 16:28:18 by BruceRavel)