est.core.types.xasobject.XASObject#
- class est.core.types.xasobject.XASObject(spectra: numpy.ndarray | Sequence[Any] | None = None, energy: numpy.ndarray | None = None, configuration: dict | None = None, dim1: int | None = None, dim2: int | None = None, name: str = 'scan1', spectra_url: DataUrl | None = None, energy_url: DataUrl | None = None)[source]#
Bases:
object
Base class of XAS
- Parameters:
spectra – absorbed beam as a list of
Spectrum
or a numpy.ndarray. If is a numpy array, the axes should have the STANDARD_DIMENSIONS order.energy – beam energy
configuration – configuration of the different process
dim1 – first dimension of the spectra
dim2 – second dimension of the spectra
name – name of the object. Will be used for the hdf5 entry
spectra_url – path to the spectra data if any. Used when serializing the XASObject. Won’t read it from it.
energy_url – path to the energy / channel data if any. Used when serializing the XASObject. Won’t read it from it.
- attach_3d_array(attr_name: str, attr_value: DataUrl | numpy.ndarray)[source]#
Attach to each attribute the provided value
- property configuration: dict#
- property energy: ndarray#
energy as a numpy array in eV. :note: cannot be with unit because use directly by xraylarch and pymca
- property energy_url: DataUrl | None#
Url from where the energy is available. Used for object serialization
- property entry: str#
- static from_file(h5_file, entry='scan1', spectra_path='data/absorbed_beam', energy_path='data/energy', configuration_path='configuration', dimensions=None, timeout=1.0) XASObject [source]#
- get_spectrum(dim1_idx: int, dim2_idx: int) Spectrum [source]#
Util function to access the spectrum at dim1_idx, dim2_idx
- property n_spectrum: int#
return the number of spectra
- property normalized_energy#
- property spectra_url: DataUrl | None#
Url from where the spectra is available. Used for object serialization