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

Module xdp.meansum

Write applications which sum and average datasets.
Classes
ExperimentData Experiment data loaded from a file for summing or averaging.
IVShiftFunc Private utility class implementing the callback function for findIVShift().
MeansumMapping Map experiment data onto independant and dependant values using Python expressions and Data.evaluate.

Exceptions
MeansumError Exception raised to indicate that some meansum-specific error occured.

Function Summary
  findIVShift(base, other, start, end, dX, amplitude, dY)
Finds the dX, amplitude, and dY that fits two data sets, 'base' and 'other'.
  mean(expData, grid, start, end)
Find the arithmetic mean of experiemnt data by summing 'expData' using sum() and then dividing the result's Y by the number of elements.
  shift(expData, start, end)
Perform energy shift correction relative to the first ExperimentData object of the sequence 'expData', updating the elements of that sequence to reflect the energy shifts.
  sum(expData, grid, start, end)
Sum experiment data by regridding Y for each ExperimentData object in the 'expData' sequence to the one-dimensional Numeric array 'dep' using linear interpolation and then summing the results.

Function Details

findIVShift(base, other, start, end, dX, amplitude, dY)

Finds the dX, amplitude, and dY that fits two data sets, 'base' and 'other'.

The xdp.Data object 'other' is fit the xdp.Data object 'base' using the columns 'X' and 'Y'.

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

'dX', 'amplitude', and 'dY' 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
   y = interpolate(x + dX, x2, y)
   return (y * amplitude) + dY
This functions returns a tuple of the form '(params, error)', where 'params' is a tuple containing the best fit values for the dX, amplitude, and dY and 'error' is the value of chi-squared for this fit.

mean(expData, grid, start, end)

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

The return value is an xdp.Data object containing an X column corresponding to 'grid' and the arithmetic mean of the regridded Y columns of all of 'expData'.

shift(expData, start, end)

Perform energy shift correction relative to the first ExperimentData object of the sequence 'expData', 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.

sum(expData, grid, start, end)

Sum experiment data by regridding Y for each ExperimentData object in the 'expData' sequence to the one-dimensional Numeric array 'dep' using linear interpolation and then summing the results.

The return value is an xdp.Data object containing an X column correspoding to 'grid' and the sum of the regridded Y columns of all of 'expData'.

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