Working with resonant anomalous surface diffraction (RASD) data

This is a brief description how to use the functions implemented in PDS to work with RASD data. At the moment there are three modules for integrating and analyzing RASD data.


Integrating RASD data

For the first step you use the "ana.rasd_data.rasd_data()" function. This function is especially designed to for data measured with the "raxr" spec command as it is used at GSECARS. It takes four arguments:

  1. spec_path (string containing the path to your spec file e.g. spec_path = 'D:/Data/APS/RASD')
  2. spec_file (string containing the name of the spec file e.g. spec_file = 'caco3_mar10d.spc')
  3. first_scan (integer number of the first scan in the spec file that belongs to your raxr scan)
  4. last_scan (integer number of the last scan in the spec file that belongs to your raxr scan)

To create an instance called "A" that has your data available for integration, you type in the PDS command line e.g.:

A = ana.rasd_data.rasd_data('D:/Data/APS/RASD','caco3_mar10d.spc', 24, 102)

For the integration of image data in "A" you simply use the PDS "CTR Data" application, you find at: PDS --> Applications --> CTR Data

In the CTR Data GUI's "CTR Data Name" scroll bar you select "A" and you can start the integration analogous to the integration of CTR Data (for a description of how to do that see the section about "Working with CTR Data") (some of the GUI functionalities, like selecting a point or a list of points from the plot or appending a scan, do not work for RASD Data)

Once you are happy with your data integration you can quit the CTR Data GUI. To go on with data analyses it is so far still necessary that you dump the results of the data integration to an Ascii file. For the instance "A" you can do that by calling:

A.write_RSD()

If you do not like the default file names created ('rasdHK_L.rsd') you may define your own file name:

A.write_RSD('yourfilename')


Analyzing RASD Data

After you have integrated all your RASD scans you still need to prepare some files containing additional information, before you can start the actual analyses of the RASD Data.

Non-resonant interface model

Along with your RASD data you need a valid interface model to calculate non-resonant structure factors. Therefore you need a bulk_file and a surface_file.

You'll have measured a full set of CTRs of your RASD sample, these should cover all the HK positions at which you have RASD data. Integrate (see "Working with CTR Data") and analyze (e.g. using ROD (so far not implemented in PDS)) the CTR data. After the CTR modeling you can produce files in ROD which are similar to the necessary bulk_file and surface_file using the:

ROD --> List --> Bulk

and the

ROD --> List --> Surface

commands.

element_symbol x y z DW

x, y, and z are in fractional coordinates, DW is the isotropic Debye-Waller-Factor in Angstroem**2.

element_symbol x y z  occ DW

x, y, and z are in fractional coordinates, occ is the occupancy of the site, DW is the isotropic Debye-Waller-Factor in Angstroem**2.

Make sure the surface model is defined in a way that the z-position of the actual crystal surface is at z = 0. As in ROD, the bulk unit cell must be defined so that it's z-coordinates are adjacent to the surface model.

f1f2 data

f1f2 data or f' and f" data is necessary to calculate the resonant structure factors.

Cromer Liberman (CL) f1f2

The easiest way to get CL f1f2 data is to use the "Hephaestus" program from Ifeffit: select f' & f" at the left side, type in the energy range of your RASD scans, select the smallest energy steps used in your RASD scans as energy grid (so far this is restricted to 1 eV), select plot both f' and f" and klick at your resonant element in the Periodic Table. Klick save data for ..., give a file name, and that's it.

You can use this file as f1f2_file in your RASD analysis.

But you can also use this file together with a XANES scan of a reference sample of your resonant element to produce experimental f1f2 data. That is especially recommended if the absorption edge of the resonant element shows a big whiteline and the shape of the experimental XANES deviates strongly from the Cromer-Liberman calculated f" as it is generated by Hephaestus.

experimental f1f2

The ana.rasd_ana.py module holds a function "ana.rasd_ana.f1f2()" you can use to calculate experimental f1f2 data. It needs the CL f1f2 data from Hephaestus and a normalized XANES scan of a reference sample of your resonant element (same oxidation state, similar speciation ...). CL f1f2 and normalized XANES must be in the same Energy range and use the same regular (1eV) Energy grid otherwise this function will crash or produce quite spectacular results. Other information it needs is the theoretical edge energy, e0 in eV (integer), an energy shift between the CL data and the experimental data, e0shift (also eV, also integer), a file name for the output file (default is 'exp.f1f2'), and a number n (default is 30) which marks the number of points used at each end of the scan to match your normalized XANES to the CL f", and the range of points around e0, which are not used to match the spectra . You can run the function like this:

ana.rasd_ana.f1f2(datafile = 'CL.f1f2' , expfile = 'XANES.nor' , e0 = 12658 , e0shift = 5 , output ='Se_exp.f1f2', n=50)

It seems to work best when the start of the absorption edges of the CL and the experimental f" match as exactly as possible, you may have to play around with e0shift (and in case with the Hephaestus option to convolute your CL f1f2 with a certain energy interval).

You can then use the output of this function, 'exp.f1f2' as f1f2_file in your RASD analysis.


The RASD analysis menu

The function rasd_menu() that creates the Rasd analysis menu is in pds/modules/menu/rasd_menu.py. When you call menu it is imported as rasd(). To start it you need to give it at least one argument, a list of strings with all the names of the files in which the results of your rasd data integration have been saved. This list might e.g. be called rasddata and be defined like this:

rasddata = ['rasd00_0.9.rsd','rasd00_1.1.rsd','rasd00_1.3.rsd',...,'rasd20_0.7.rsd',...,'rasd01_3.5.rsd']

The menu could then be started like this:

menu.rasd(rasddata)

It will interactively ask you for additional information:

  1. cell: is a unit cell definition, a list of eight floats [a,b,c,alpha,beta,gamma,delta1,delta2]. a, b, c, alpha, beta, and gamma are the lengths of your basis vectors and the angles between them in Angstroem and degrees. delta1 and delta2 are used for surfaces where there is no integer real space vector perpendicular to the surface. (If you don't know you may have a look into: Trainor et al. (2002) Journal of Applied Crystallography, 35, 696-701, but if you've never heard of it, it is most probably both zero in your case.)

  2. bulk_file: string containing the name of the bulk file explained above.

  3. surface_file: string containing the name of the surface file explained above.

  4. f1f2_file: string containing the name of the f1f2 file explained above, either CL or experimental.

  5. E0: absorption edge energy in eV.

If you don't want to go through all these steps every time you start the menu you may predefine all these variables and start the menu directly like this:

menu.rasd(rasddata, cell, bulk_file, surface_file, f1f2_file, 12663)

Then rasd_menu will jump over all these first steps and you get directly to the menu.

That means a "Figure 1" showing your first RASD scan and a fit to it should appear and something like this should be written to your PDS shell:

##########################################
Number of rasd scans   = 9
Current scan           = 0
Current scan AR        = 0.0966330298591
Current scan PR        = 0.465473173313
Current scan E0shift   = 0.0

( 1) PLot_norm       : Plot scan with (default) or without normalization
( 2) SETE0shift      : Set E0 shift for this scan
( 3) SETPRstart      : set a starting value for the resonant Phase (PR)
( 4) USEINFourier    : use AR and PR of this scan in Fourier synthesis (True/False)
( 5) USEINRefine     : use this scan in the structure refinement (True/False)
( 6) FourierParams   : Set Fourier synthesis parameters
( 7) RUNFourier      : Run Fourier synthesis
( 8) RefinementParams: Set simulated annealing parameters
( 9) RUNRefine       : Run simulated annealing structure refinement
(10) SELect          : Select scan
(11) Next            : Select next scan
(12) PRevious        : Select previous scan
(13) Done            : All Done
(14) Help            : Show menu options

The header information tells you:

  1. how many scans you have loaded (e.g. 9),
  2. which of these scans you are currently working on (if you have 9 scans this goes from 0 to 8)
  3. resonant amplitude, AR, of the fit to this scan
  4. resonant phase, PR, of the fit to this scan
  5. e0shift you applied to this scan.

Some more information is in the title of "Figure1".

You can choose the menu options just by typing the numbers before each option, or by typing the part of the option name written in capital letters, or by typing the whole option name.

Let's go quickly through the options.


So far that's it. This is just a first version of functions that can be used to integrate and analyze RASD data, but there's of course still a lot of space for improvement. So feel free to contribute any changes you want make or to report any bugs you discover.


Shortcuts

On my page I pasted some short scripts that proved to be handy to speed up the work with CTR and RASD data in PDS.

tdl/Modules/RasdData (last edited 2011-04-29 14:10:54 by FrankHeberling)