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.

absorbed_beam() ndarray[source]#
attach_3d_array(attr_name: str, attr_value: DataUrl | numpy.ndarray)[source]#

Attach to each attribute the provided value

property configuration: dict#
copy() XASObject[source]#
deepcopy() XASObject[source]#
dump(h5_file: str)[source]#

dump the XAS object to a file_path within the Nexus format

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_dict(ddict: dict) XASObject[source]#
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

load_from_dict(ddict: dict) XASObject[source]#

load XAS values from a dict

property n_spectrum: int#

return the number of spectra

property normalized_energy#
property spectra: Spectra#
property spectra_url: DataUrl | None#

Url from where the spectra is available. Used for object serialization

to_dict() dict[source]#

convert the XAS object to a dict

By default made to simply import raw data.