dara.eflech_worker module#

class EflechWorker[source]#

Bases: object

Functionality for running peak detection using BGMN’s eflech and teil executables.

static generate_control_file(pattern_path, wavelength, instrument_name, *, wmin=None, wmax=None, possible_changes=None, epsilon=None, nthreads=None)[source]#
Return type:

Path

static get_background_breakpoints(ru, xy_content)[source]#

Get the background breakpoints from the teil output.

Parameters:
  • ru (int) – the degree of background, get from teil output

  • xy_content (ndarray) – the xy of the pattern

Return type:

list[dict[str, float]]

Returns:

the background breakpoints

static parse_par_file(par_file, wavelength)[source]#
Return type:

list[list[float]]

parse_peak_list(par_folder, wavelength)[source]#
Return type:

DataFrame

patch_control_file_after_teil(control_file_path, ru, xy_content)[source]#

Patch the control file after teil is run. If the divided pattern is still too large, we will divide it further to save the computation time.

Parameters:
  • control_file_path (Path) – the path to the control file

  • ru (int) – the degree of background, get from teil output

  • xy_content (ndarray) – the xy of the pattern

run_eflech(control_file_path, mode, working_dir, show_progress=False, timeout=1800)[source]#
Return type:

str | None

run_peak_detection(pattern, wavelength='Cu', instrument_profile='Aeris-fds-Pixcel1d-Medipix3', show_progress=False, *, wmin=None, wmax=None, epsilon=None, possible_changes=None, nthreads=8, timeout=1800)[source]#
Return type:

DataFrame