Data reduction

The data reduction methods in the datared allow to obtain X-ray scattering difference patterns based on the result of the azimuthal integration as obtained in the previous section.

The data reduction proceeds as follows:

  1. Identify each scattering pattern with its associated time delay.

  2. Normalize each pattern based on the signal in a given q region.

  3. Computes the differences by subtracting the reference signal to each pattern.

  4. Computes the average of the differences for each time delay.

  5. Optionally, apply a filter to discard outliers.

Performing data reduction

Most of the work done by the datared.datared() function is automatic and the function can be used as follows:

import txs

# from previous section
dset = ...
azav = ...

dred = txs.datared.datared(azav, "<your reference delay, e.g. '-20us'>")

Plot the result

Helper functions are available in plot to quickly plot the data. For the difference patterns, plot.plot_diffs() may be used.

txs.plot_diffs(dred)

Resulting in a matplotlib figure:

Difference patterns at various time delays

The resulting dred object

The dred object is a Python dictionary containing the reduced dataset as well the content of the azav object generated in the last section

The import entries are:

  • q, the scattering angle amplitudes vector.

  • t, the time delays as strings.

  • diff_av, the averaged - and potentially filtered - difference patterns
    for each time delay. The axes of the array are (q, time delays).
  • diff_err, the errors associated with diff_av.

Additional options