Custom Spectroscopy tasks#

How to use

These tasks come from ewoksbm08 ewoksid12 ewoksid14 ewoksid16a ewoksid24. It can be installed with

pip install ewoksbm08 ewoksid12 ewoksid14 ewoksid16a ewoksid24

ℹ️ These tasks are used at the following ESRF beamlines: BM08, BM23, ID12, ID14, ID24

ReadXasHdf5#

Read one XAS scan with XDI structured metadata.

Identifier:
ewoksbm08.tasks.read_xas.ReadXasHdf5
Task type:
class
Inputs:
filename* : str

Bliss HDF5 file name.

entry_name* : str

NeXus entry name.

Examples:
  • '1.1'
  • '5.2'
mono_counter* : str

Counter of the energy or theta value of the monochromator.

crystal_motor* : str

Motor that selects the monochromator crystal.

optional_counters : list[str | None]= None

Counters other than the energy to be added to the XDI data.

optional_mca_counters : list[str | None]= None

MCA counters (ROI’s) other than the energy to be added to the XDI data.

livetime_normalization : float | None= None

Live-time normalization in seconds for ‘optional_mca_counters’ (None: no normalization, <=0 the median of the elapsed time).

skip_mca : dict[str, list[int | None]]= None

Skip detectors from MCA controllers.

Examples:
  • {'d08xmap': [1, 3]}
retry_timeout : float | None= 0.0

Timeout when trying to read data from HDF5.

mono_edge_theoretical : float | None= None

The theoretical edge position in ‘mono_counter’ units.

mono_edge_experimental : float | None= None

The experimental edge position in ‘mono_counter’ units.

Outputs:
xdi_data : ewoksbm08.io.types.XdiData

SaveXasXdi#

Save one XAS scan as an XDI file.

Identifier:
ewoksbm08.tasks.save_xas.SaveXasXdi
Task type:
class
Inputs:
filename* : str

XDI file name.

xdi_data* : ewoksbm08.io.types.XdiData

XDI data to be saved.

Outputs:
output_filename : str

XDI file name.

Additional models#

XdiData#

Fields:
column_names* : list[str]
column_data* : list[numpy.ndarray]
xdi_metadata* : ewoksbm08.io.types.XdiMetadata

XdiMetadata#

Fields:
Scheme : str= XDI/1.0 GSE/1.0
Title : str= Data collected at BM08-LISA of ESRF preproccessed with the beamline Calibration Tool
Facility* : ewoksbm08.io.types.XdiFacility
Beamline* : ewoksbm08.io.types.XdiBeamline
Scan : ewoksbm08.io.types.XdiScan | None= None
Mono : ewoksbm08.io.types.XdiMono | None= None
Sample : ewoksbm08.io.types.XdiSample | None= None

XdiFacility#

Fields:
name : str= ESRF
xray_source : str= bending magnet
current : float | None= None
fillingMode : str | None= None

XdiBeamline#

Fields:
name : str= BM08-LISA

XdiScan#

Fields:
start_time : str | None= None
end_time : str | None= None

XdiMono#

Fields:
name : str | None= None
d_spacing : float | None= None
notes : str | None= LNT cooled

XdiSample#

Fields:
name : str | None= None

XdiData#

Fields:
column_names* : list[str]
column_data* : list[numpy.ndarray]
xdi_metadata* : ewoksbm08.io.types.XdiMetadata

XdiMetadata#

Fields:
Scheme : str= XDI/1.0 GSE/1.0
Title : str= Data collected at BM08-LISA of ESRF preproccessed with the beamline Calibration Tool
Facility* : ewoksbm08.io.types.XdiFacility
Beamline* : ewoksbm08.io.types.XdiBeamline
Scan : ewoksbm08.io.types.XdiScan | None= None
Mono : ewoksbm08.io.types.XdiMono | None= None
Sample : ewoksbm08.io.types.XdiSample | None= None

XdiFacility#

Fields:
name : str= ESRF
xray_source : str= bending magnet
current : float | None= None
fillingMode : str | None= None

XdiBeamline#

Fields:
name : str= BM08-LISA

XdiScan#

Fields:
start_time : str | None= None
end_time : str | None= None

XdiMono#

Fields:
name : str | None= None
d_spacing : float | None= None
notes : str | None= LNT cooled

XdiSample#

Fields:
name : str | None= None

Hdf5ToAscii#

Save 1D data from Bliss HDF5 scans in ID12 ASCII files.

Identifier:
ewoksid12.tasks.hdf5_to_ascii.Hdf5ToAscii
Task type:
class
Inputs:
filename*
output_dir*
counters
has_subscan
retry_period
retry_timeout
scan_numbers
Outputs:
counters
output_filenames

Hdf5ToSpec#

Convert Bliss HDF5 scans to SPEC files, one file per scan and only MCA data.

Identifier:
ewoksid14.tasks.hdf5_to_spec.Hdf5ToSpec
Task type:
class
Inputs:
filename*
output_filename*
mca_calibration
mca_counter
retry_period
retry_timeout
scan_numbers
Outputs:
output_filenames

Hdf5ToSpec2#

Convert Bliss HDF5 scans to SPEC files, multiple scans per file and only 1D counters.

Identifier:
ewoksid14.tasks.hdf5_to_spec2.Hdf5ToSpec2
Task type:
class
Inputs:
filename* : str

Path to the HDF5 file. Can be absolute or relative.

Examples:
  • '/data/visitor/hc6232/id14/20250716/PROCESSED_DATA/MK103_235K_IV/session_HRM2_22Jul25.h5'
  • 'session_HRM2_01Apr25.h5'
output_filename* : str

Output filename for the extracted ASCII data. Can be absolute or relative.

Examples:
  • 'jul16.asc'
  • '/home/user/myname/output.asc'
scan_numbers : List[int] | None= None

List of scans to extract.

Examples:
  • [29, 30, 39, 40, 49, 50]
counter_names : List[str] | None= None

List of counters/motors to extract.

Examples:
  • ['bin2', 'bout2', 'eib1', 'pico2', 'df', 'di', 'epoch', 'timer']
scan_acq_times : List[float] | None= None

Acquisition time per point. Either a single-element list (applied to all scans), or a list matching the length of scan_numbers. When not provided try using the ‘timer’ counter.

Examples:
  • [8]
  • [8, 8, 10]
retry_timeout : float | None= None

Timeout for trying to read from the HDF5 file in seconds.

retry_period : float | None= None

Retry period for trying to read from the HDF5 file in seconds.

Outputs:
output_filename

PlanckRadianceFit#

Fit Black Body radiance with Planck’s law.

Identifier:
ewoksid24.tasks.fit.PlanckRadianceFit
Task type:
class
Inputs:
temp_data*
wavelength_max
wavelength_min
Outputs:
temp_data

ScanTemperaturePlot#

Save laser-heated DAC temperature plots as images.

Identifier:
ewoksid24.tasks.plot.ScanTemperaturePlot
Task type:
class
Inputs:
temp_down_data*
temp_up_data*
dpi
extend_plotrange_left
extend_plotrange_right
figsize
fontsize
output_directory
pause
show
two_color_difference
Outputs:
filenames

XasTemperaturePlot#

Save laser-heated DAC temperature XAS plots as images.

Identifier:
ewoksid24.tasks.plot.XasTemperaturePlot
Task type:
class
Inputs:
temp_down_data*
temp_up_data*
xas_data*
dpi
extend_plotrange_left
extend_plotrange_right
figsize
fontsize
output_directory
pause
show
two_color_difference
Outputs:
filenames

ScanTemperatureRead#

Read laser-heated DAC scan with temperature data.

Identifier:
ewoksid24.tasks.read.ScanTemperatureRead
Task type:
class
Inputs:
filename*
scan_number*
retry_period
retry_timeout
subscan_number
Outputs:
temp_down_data
temp_up_data

XasTemperatureRead#

Read laser-heated DAC XAS scan with temperature data.

Identifier:
ewoksid24.tasks.read.XasTemperatureRead
Task type:
class
Inputs:
filename*
scan_number*
energy_name
mu_name
retry_period
retry_timeout
subscan_number
Outputs:
temp_down_data
temp_up_data
xas_data