xrd_tools.plugins.refinement_profex

Warning

This plugin allows you to perform a full pattern refinement of your measurement via Profex and thus requires a working installation of it on your machine.

Note

  • You should be familiar with the operation of Profex, since the full pattern refinement has to be carried out manually.

  • Export the data of refined structure(s) to CIF file(s) after the refinement, as described in the corresponding subsection of this Profex tutorial.

A xrd-tools refinement interface plugin that integrates Profex/BGMN.

class xrd_tools.plugins.refinement_profex.ProfexInterface(measurement_id: str, data: Series, dir_refinement: str, encoding: str, input_data_suffix: str = '', input_data_header: bool = False, input_data_delimiter: str = ' ', name_phases: str = 'phases')[source]

Profex/BGMN refinement interface.

Parameters:
  • measurement_id (str) – ID of the measurement to be refined with profex.

  • data (pd.Series) – Series containing the x/y data of the measurement. The index represents the 2θ angle in °.

  • dir_refinement (str) – Path to the refinement project directory.

  • encoding (str) – Encoding used in refinement input data file.

  • input_data_suffix (str) – Suffix appended to measurement_id to generate refinement input- and project- filenames. Since the input data filename (without extension) is used as project name by profex, it is recommended to provide no suffix for the refinement files.

  • input_data_delimiter (str) – Delimeter to be used for creation of refinement input data file (profex can not read-in comma separated values).

  • input_data_header (bool) – Option to ignore header for creation of refinement input data file.

create_input_data() None[source]

Create refinement input data for profex.

property file_refinement_input: str

Path to *.xy refinement input data file.

It is constructed as follows: <dir_refinement>/<measurement_id><suffix_data>.xy

property file_refinement_project: str

Path to *.dia refinement project file.

It is constructed as follows: <dir_refinement>/<measurement_id><suffix_data>.dia

get_cif_files() dict[str, str][source]

Get a dictionary with the name and the path to the cif files for a refined phases.

get_composition(mass_frac_prefix='Q') dict[uncertainties.core.AffineScalarFunc][source]

Get the composition of the refined sample.

get_phases() list[str][source]

Get a list with phases determined in the refined sample.

get_refined_data(i_calc: str, i_bg: str) DataFrame[source]

Get a pandas DataFrame containing the refined data series.

Parameters:
  • i_calc (str) – Column name for the calculated intensities.

  • i_bg (str) – Column name for the background intensities.

Returns:

A DataFrame with index set to 2θ and an index name as found in the provided data. The columns correspond to: - I_calc with column name provided as argument, - I_bg with column name provided as argument, and - a further column for each phase refined, named with its name as defined

in profex.

Return type:

pd.DataFrame

get_refinement_result() RefinementResult[source]

Get a RefinementResults object for the refinement of the measurement.

open_refinement() None[source]

Open the refinement project with profex.

Raises:

AppNotInstalledError – If profex is not installed on the machine.

xrd_tools.plugins.refinement_profex.register() None[source]

Register the module as xrd-tools refinement interface plugin at its factory.