Package xdp :: Module xafs
[show private | hide private]
[frames | no frames]

Module xdp.xafs

A library of supporting classes and functions for writing XDP applications which process XAFS data.
Classes
EnergyShiftFunc Private utility class implementing the callback function for findEnergyShift().
XafsData XafsData objects represent XAFS experiment data from a file.

Function Summary
  findEnergyShift(base, other, start, end, dEnergy, amplitude, dMu)
Finds the delta-Energy, amplitude, and delta-Mu that fits two XAFS data sets, 'base' and 'other'.
  mean(xafsData)
Find the arithmetic mean XAFS experiemnt data by summing 'xafsData' using sum() and then dividing the result's Mu by the number of elements.
  rebin(xafsData, Eo, offset, estep, kstep)
Rebin the Energy and Mu columns of XafsData objects in the sequence 'xafsData', updating the elements of that sequence to reflect the rebinned values.
  shift(xafsData, start, end)
Perform energy shift correction relative to the first XafsData object of the sequence 'xafsData', updating the elements of that sequence to reflect the energy shifts.
  shiftRef(xafsData, start, end)
Perform energy shift correction using reference channels.
  sum(xafsData)
Sum XAFS experiemnt data by regridding Mu for each XafsData object in the 'xafsData' sequence to the first element of the sequence using linear interpolation and then summing the results.

Function Details

findEnergyShift(base, other, start, end, dEnergy, amplitude, dMu)

Finds the delta-Energy, amplitude, and delta-Mu that fits two XAFS data sets, 'base' and 'other'.

The xdp.Data object 'other' is fit the xdp.Data object 'base' using the columns 'Energy' and 'Mu'.

'start' and 'end' specify the range over which to fit, and may be set to None to perform automatic ranging.

'dEnergy', 'amplitude', and 'dMu' provide initial values for the corresponding parameters used in the nonlinear least squares fitting. The function used for this fitting looks something like:
   # from xdp.interpolate.linear import interpolate
   mu = interpolate(energy - dMu, energy2, mu2)
   return (mu * amplitude) + dMu
This functions returns a tuple of the form '(params, error)', where 'params' is a tuple containing the best fit values for the delta-Energy, amplitude, and delta-Mu and 'error' is the value of chi-squared for this fit.

mean(xafsData)

Find the arithmetic mean XAFS experiemnt data by summing 'xafsData' using sum() and then dividing the result's Mu by the number of elements.

The return value is an xdp.Data object containing the Energy column of the first XafsData object of 'xafsData' and the arithmetic mean of the Mu columns of all of 'xafsData'.

rebin(xafsData, Eo, offset, estep, kstep)

Rebin the Energy and Mu columns of XafsData objects in the sequence 'xafsData', updating the elements of that sequence to reflect the rebinned values.

'Eo', 'offset', 'estep', and 'kstep' are all parameters for an xdp.transformation.RebinTransform, and mean the same thing here.

shift(xafsData, start, end)

Perform energy shift correction relative to the first XafsData object of the sequence 'xafsData', updating the elements of that sequence to reflect the energy shifts.

The arguments 'start' and 'end' specify the energy range over which to perform the shift correction.

shiftRef(xafsData, start, end)

Perform energy shift correction using reference channels.

The arguments 'start' and 'end' specify the energy range over which to perform the shift correction.

sum(xafsData)

Sum XAFS experiemnt data by regridding Mu for each XafsData object in the 'xafsData' sequence to the first element of the sequence using linear interpolation and then summing the results.

The return value is an xdp.Data object containing the Energy column of the first XafsData object of 'xafsData' and the sum of the Mu columns of all of 'xafsData'.

Generated by Epydoc 2.1 on Wed Jul 20 11:51:05 2005 http://epydoc.sf.net