dara.search.core module

dara.search.core module#

Phase search module.

remote_expand_node(search_tree, nid)[source]#

Expand a node in the search tree.

Return type:

ObjectRef

search_phases(pattern_path, phases, pinned_phases=None, max_phases=5, wavelength='Cu', instrument_profile='Aeris-fds-Pixcel1d-Medipix3', express_mode=True, enable_angular_cut=True, phase_params=None, refinement_params=None, return_search_tree=False, record_peak_matcher_scores=False, rpb_threshold=None, peak_matching_strategy=PeakMatchingStrategy(matched_coeff=1.0, wrong_intensity_coeff=1.0, missing_coeff=-0.05, extra_coeff=-0.5))[source]#

Search for the best phases to use for refinement.

Parameters:
  • pattern_path (Path | str) – the path to the pattern file. It has to be in .xrdml, .xy, .raw, or .rasx format

  • phases (list[Path | str | RefinementPhase]) – the paths to the CIF files

  • pinned_phases (list[Path | str | RefinementPhase] | None) – the paths to the pinned phases, which will be included in all the results

  • max_phases (int) – the maximum number of phases to refine

  • wavelength (Union[Literal['Cu', 'Co', 'Cr', 'Fe', 'Mo'], float]) – the wavelength of the X-ray. It can be either a float or one of the following strings: “Cu”, “Co”, “Cr”, “Fe”, “Mo”, indicating the material of the X-ray source

  • instrument_profile (str | Path) – the name of the instrument, or the path to the instrument configuration file (.geq)

  • express_mode (bool) – whether to use express mode. In express mode, the phases will be grouped first before searching, which can significantly speed up the search process.

  • enable_angular_cut (bool) – whether to enable angular cut, which will run the search on a reduced pattern range (wmin, wmax) to speed up the search process.

  • phase_params (dict[str, ...] | None) – the parameters for the phase search

  • refinement_params (dict[str, ...] | None) – the parameters for the refinement

  • return_search_tree (bool) – whether to return the search tree. This is mainly used for debugging purposes.

  • record_peak_matcher_scores (bool) – whether to record the peak matcher scores. This is mainly used for debugging purposes.

  • rpb_threshold (float | None) – the RPB threshold. If None, it will be automatically determined based on the pattern’s SNR.

  • peak_matching_strategy (PeakMatchingStrategy | tuple[float, float, float, float]) – the coefficients for peak matching score calculation. Can be a PeakMatchingStrategy model or a tuple of four floats (matched_coeff, wrong_intensity_coeff, missing_coeff, extra_coeff). If None, the default coefficients will be used.

Return type:

list[SearchResult] | SearchTree