How to Import Data from Photon Factory or SPring8 Directly into Athena

The XAS beamlines at Photon Factory and SPring8 write data to files that cannot be read directly by Ifeffit and Athena. One reason is that the data are stored to disk as a function of monochromator angle, thus the data need to be converted to energy in order to be processed by Athena. 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 being of a certain type (in this case, as being from Photon Factory or SPring8), 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 Photon Factory or SPring8 will be imported transparently into Athena using Athena's normal column selection dialog.

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 PFBL12C.pm file in the folder %APPDATA%\horae\Ifeffit\Plugins\Filetype\Athena\ and name it PFBL12C.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 PFBL12C.pm file in the folder $HOME/.horae/Ifeffit/Plugins/Filetype/Athena/ and name it PFBL12C.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 PFBL12C.pm file in the folder %IFEFFIT%\share\perl\Ifeffit\Plugins\Filetype\Athena\ and name it PFBL12C.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 PFBL12C.pm file in that folder and name it PFBL12C.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

The procedure for using the plugin is described here. Of course, you will be looking to use the PFBL12C plugin rather than the DUBBLE plugin discussed on that page. But the procedure is the same.

What the plugin does

  1. The header is parsed to find the value of the mono d-spacing. The header is also commented out with the # character.

  2. The energy at each point is calculated from the mono angle using the d-spacing from the header. You can see the full calculation for converting angle to energy around line 100 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 target energy in the first column, followed by the obtained energy, followed by the scalars.

Problems

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/PhotonFactorySpring8 (last edited 2011-06-05 16:28:02 by BruceRavel)