dara.generate_control_file module#

Generate a control file for BGMN.

copy_instrument_files(instrument_profile, working_dir)[source]#

Copy the instrument file (.geq) to the working directory.

Parameters:

working_dir (Path) – the working directory

Return type:

str

Returns:

The name of the instrument

copy_xy_pattern(pattern_path, working_dir)[source]#

Copy the xy pattern to the working directory.

Return type:

Path

generate_control_file(pattern_path, str_paths, instrument_profile, working_dir=None, *, n_threads=8, wmin=None, wmax=None, eps1=0.0, eps2='0_-0.05^0.05', wavelength='Cu')[source]#

Generate a control file for BGMN.

Parameters:
  • pattern_path (Path) – the path to the pattern file. It has to be in .xy format

  • str_paths (list[Path]) – the paths to the STR files

  • instrument_profile (str | Path) – the name of the instrument, if it is a path, it must be ended with .geq

  • working_dir (Path | None) – the working directory

  • n_threads (int) – the number of threads to use

  • wmin (float | None) – the minimum wavelength

  • wmax (float | None) – the maximum wavelength

  • eps1 (float | str) – the epsilon1 value, it is used to refine zero point

  • eps2 (float | str) – the epsilon2 value, it is used to refine sample height

  • wavelength (Union[Literal['Cu', 'Co', 'Cr', 'Fe', 'Mo'], float]) – the wavelength to use. If a float is provided, it is used as the wavelength in nm (synchrotron radiation). If a string is provided, it is the target material in X-ray tubes.

Return type:

Path

trim_pattern(xy_content)[source]#

Trim the pattern to remove negative intensities.

Return type:

ndarray