est.core package

est.core.io module

simple helper function to link io module and XASObject

class est.core.io.XASReader

Bases: object

Simple reader of a xas file

static read_frm_url(input_information)
static read_from_file(file_path, energy_unit=<Unit('electron_volt')>, dimensions=(<Dim.DIM_2: 'dim 2'>, <Dim.DIM_1: 'dim 1'>, <Dim.DIM_0: 'dim 0'>), columns_names=None)
Parameters

file_path (str) –

Returns

.XASObject

class est.core.io.XASWriter

Bases: object

class to write the output file. In this case we need a class in order to setup the output file before

dump_xas(xas_obj, write_process=True)

write the XASObject into a hdf5 file.

Parameters
  • xas_obj – object to be stored

  • write_process (bool) – if True then store the process flow in the same file.

Type

Union[XASObject,dict]

property output_file
set_properties(properties)
est.core.io.read(spectra_url, channel_url, dimensions=(<Dim.DIM_2: 'dim 2'>, <Dim.DIM_1: 'dim 1'>, <Dim.DIM_0: 'dim 0'>), config_url=None, energy_unit=<Unit('electron_volt')>)
Parameters
  • spectra_url (DataUrl) – data url to the spectra

  • channel_url (DataUrl) – data url to the channel / energy

  • config_url (DataUrl) – data url to the process configuration

  • dimensions – way the data has been stored. Usually is (X, Y, channels) of (Channels, Y, X). If None, by default is considered to be (Z, Y, X)

Type

tuple

Returns

Return type

XASObject

est.core.io.read_frm_file(file_path, energy_unit=<Unit('electron_volt')>, dimensions: tuple = (<Dim.DIM_2: 'dim 2'>, <Dim.DIM_1: 'dim 1'>, <Dim.DIM_0: 'dim 0'>), columns_names: Union[None, dict] = None)
Parameters
  • file_path (str) – path to the file containing the spectra. Must ba a .dat file that pymca can handle or a .h5py with default path

  • dimensions (tuple) – dimensions of the input data. For ASCII file can be (X, Y) or (Y, X)

  • columns (Union[None,tuple]) – name of the column to take for .dat… files.

:return XasObject created from the input :rtype: XASObject

est.core.reprocessing module

some utils function for executing reprocessing

est.core.reprocessing.get_process_instance_frm_h5_desc(desc)
Parameters

desc (dict) – description of the process to instanciate

Returns

instance of the process to execute, configured from the description

est.core.types module