toolbox_scs.routines.XAS

Toolbox for XAS experiments.

Based on the LCLS LO59 experiment libraries.

Time-resolved XAS and XMCD with uncertainties.

Copyright (2019-) SCS Team Copyright (2017-2019) Loïc Le Guyader <loic.le.guyader@xfel.eu>

Module Contents

Functions

xas(nrun[, bins, Iokey, Itkey, nrjkey, Iooffset, ...])

Compute the XAS spectra from a xarray nrun.

xasxmcd(dataP, dataN)

Compute XAS and XMCD from data with both magnetic field direction

toolbox_scs.routines.XAS.xas(nrun, bins=None, Iokey='SCS_SA3', Itkey='MCP3peaks', nrjkey='nrj', Iooffset=0, plot=False, fluorescence=False)[source]

Compute the XAS spectra from a xarray nrun.

Inputs:

nrun: xarray of SCS data bins: an array of bin-edges or an integer number of

desired bins or a float for the desired bin width.

Iokey: string for the Io fields, typically ‘SCS_XGM’ Itkey: string for the It fields, typically ‘MCP3apd’ nrjkey: string for the nrj fields, typically ‘nrj’ Iooffset: offset to apply on Io plot: boolean, displays a XAS spectrum if True fluorescence: boolean, if True, absorption is the ratio,

if False, absorption is negative log

Outputs:
a dictionnary containing:

nrj: the bin centers muA: the absorption sigmaA: standard deviation on the absorption sterrA: standard error on the absorption muIo: the mean of the Io counts: the number of events in each bin

toolbox_scs.routines.XAS.xasxmcd(dataP, dataN)[source]

Compute XAS and XMCD from data with both magnetic field direction Inputs:

dataP: structured array for positive field dataN: structured array for negative field

Outputs:

xas: structured array for the sum xmcd: structured array for the difference