API: techniques#
This page lists the calls that belong to one technique, each under the technique that uses it.
A fit that uses none of these techniques needs only API: everyday calls.
The batch index#
Diagnostics over a batch#
- rx.diagnostics_summary(
- results: Iterable[RefinementResult],
- deliverable: str | None = None,
- levels: dict[str, str] | None = None,
The diagnostics of a batch of results as counts: each code’s firing rate, the warning rows a result carries per purpose, and the codes ranked by their share of the warnings (WP-2037).
- class rx.DiagnosticsSummary#
The diagnostics of a batch of results as counts, from
diagnostics_summary.
- class rietx.report.batch.CodeTally#
One code’s firing over a batch.
The figure index#
Drawing a structure#
- viz.render_structure(
- structure,
- phase: int = 0,
- *,
- mode: str = 'ball',
- view='opening',
- up=None,
- turn: str | None = None,
- size=1000,
- supersample: int = 2,
- probability: float | None = None,
- bond_tolerance: float | None = None,
- max_atoms: int | None = None,
- exaggeration: float = 1.0,
- stick: float = 1.0,
- hidden=(),
- boundary: bool = True,
- cell: bool = True,
- polyhedra=None,
- axis_labels: bool = True,
- atom_labels: bool = False,
- outline: bool = False,
- background='white',
- path=None,
- dpi: float | None = None,
Draw one phase of a structure as the GUI’s structure viewer draws it.
- class rietx.viz.figure3d.StructureFigure#
What
render_structuredrew.
Figure report#
Selecting part of a structure#
- viz.keep(
- geometry: Mapping,
- mask,
- *,
- complete: bool | str = False,
The geometry with only the atoms
maskkeeps, every index consistent.
- viz.select(
- geometry: Mapping,
- *,
- species=None,
- element=None,
- label=None,
- site=None,
- boundary: bool | None = None,
The atoms of the named sites, as a boolean array over
atoms.
- viz.plane(
- geometry: Mapping,
- hkl,
- distance: float,
- *,
- width: float | None = None,
- inverse: bool = False,
- units: str = 'd',
The atoms on the origin side of the plane (hkl) at
distance.
- viz.sphere(geometry: Mapping, centre, radius: float) np.ndarray#
The atoms within
radiusÅ ofcentre, itself included.
- viz.component(
- geometry: Mapping,
- atom: int,
- *,
- via: str = 'bonds',
The connected piece of the figure holding
atom.
- viz.periodicity(geometry: Mapping, mask) int#
How many independent lattice directions the atoms
maskkeeps repeat in, 0 to 3.
- viz.recolour(geometry: Mapping, mask, colour) dict#
The geometry with the masked atoms, and the polyhedra centred on them, in
colour.
Plotting a pattern#
- viz.plot_pattern(
- data,
- *,
- path: str | None = None,
- two_theta_range: tuple[float, float] | None = None,
- x_axis: str = 'two_theta',
- wavelength: float | None = None,
- y_scale: str = 'linear',
- style: str = 'light',
- figsize: tuple[float, float] | None = None,
- font_size: float = 11.0,
- dpi: int = 300,
- title: str | None = None,
- model=None,
A measured pattern on its own, before any model exists.
The other programs’ files index#
Recipes and instrument files#
- rx.read_recipe(
- source: str | Path | dict,
- *,
- diagnostics: list[Diagnostic] | None = None,
Read a PowderLine
GSASII_Rietveldrecipe.
- rx.write_recipe_tables(
- refinement,
- out_dir: str | Path,
- *,
- phase_names: dict[str, str] | None = None,
Write a finished refinement as PowderLine’s four output tables.
- rx.read_gsas_prm(
- path: str | Path,
- *,
- profile_set: int | None = None,
- diagnostics: list[Diagnostic] | None = None,
Read a GSAS-I
.prminstrument-parameter file as a frozenInstrument.
- rx.write_gsas_prm(
- instrument: Instrument,
- path: str | Path,
- *,
- header: str = '',
- diagnostics: list[Diagnostic] | None = None,
Write
instrumenttopathas a GSAS-I.prm.
- rx.read_gsas_tof_iparm(
- path: str | Path,
- *,
- diagnostics: list[Diagnostic] | None = None,
Read a GSAS-I TOF instrument-parameter file:
{bank number: Instrument}.
- rx.read_gsas2_instprm(
- path: str | Path,
- *,
- bank: int | None = None,
- diagnostics: list[Diagnostic] | None = None,
Read a GSAS-II
.instprmfile as a frozenInstrument.
- rx.write_gsas2_instprm(
- instrument: Instrument,
- path: str | Path,
- *,
- diagnostics: list[Diagnostic] | None = None,
Write
instrumenttopathas a GSAS-II.instprm.
Other programs’ projects#
- rx.read_project_model(
- path: str | Path,
- *,
- diagnostics: list[Diagnostic] | None = None,
Read a refinement another program wrote, dispatching on content.
- rx.identify_project_format(path: str | Path) ProjectFormat#
Name the registered project format that claims
path.
- rx.read_topas_inp(
- path: str | Path,
- *,
- diagnostics: list[Diagnostic] | None = None,
Parse a
.inp.
- rx.write_topas_inp(
- structure: Structure,
- path: str | Path,
- *,
- diagnostics: list[Diagnostic] | None = None,
- p1_expand: bool | 'auto' = False,
- free=None,
- scale=None,
- instrument=None,
- pattern=None,
Write.
- rx.read_fullprof_pcr(path: str | Path) FullProfModel#
Parse a
.pcr.
- rx.write_fullprof_pcr(
- structure: Structure,
- path: str | Path,
- *,
- instrument: Instrument | None = None,
- diagnostics: list[Diagnostic] | None = None,
- write_zero_shift: bool = False,
Write a
.pcr.
- rx.read_gsas_exp(
- path: str | Path,
- *,
- diagnostics: list[Diagnostic] | None = None,
Read a GSAS-I
.EXPexperiment file.
- rx.write_gsas_exp(
- structure: Structure,
- path: str | Path,
- *,
- title: str = '',
- diagnostics: list[Diagnostic] | None = None,
Write
structuretopathas a GSAS-I.EXP.
- rx.read_gsas2_gpx(
- path: str | Path,
- *,
- diagnostics: list[Diagnostic] | None = None,
Read a GSAS-II
.gpxproject file.
- rx.write_gsas2_phase_cif(
- structure,
- path: str | Path,
- *,
- diagnostics: list[Diagnostic] | None = None,
Write the phase CIF GSAS-II imports.
The magnetic structure index#
Determining a magnetic structure#
- rx.solve_magnetic(
- refinement,
- data,
- *,
- phase: int = 0,
- sites: Sequence[str] | None = None,
- species: Sequence[str] | None = None,
- ion: str | dict[str, str] | None = None,
- g: float | dict[str, float] | None = None,
- k=None,
- top_k: int = 3,
- d_min: float = 1.5,
- magnitude: float = 2.0,
- plan: RefinementPlan | None = None,
- nuclear_group: str = 'parent',
- generator=None,
- tie_width: float = 6.0,
- k_trials: int = 2,
- k_tie_width: float = 10.0,
- cif_dir=None,
- tie_to_parent: bool = False,
Determine a magnetic structure from a converged nuclear fit, or abstain.
- class rx.MagneticSolution#
The ranked list, the criterion, and the verdict or the abstention.
- verdict: str#
- reason: str#
- criterion: str#
- phase: str#
- space_group: str#
- k: tuple[str, str, str] | None#
- k_route: str#
- k_reason: str#
- k_candidates: tuple[tuple[str, int, int], ...]#
- sites: tuple[str, ...]#
- n_residual_peaks: int#
- n_on_nuclear_lines: int#
- n_on_forbidden_lattice_points: int#
- n_unexplained: int#
- trials: tuple[MagneticTrial, ...]#
- tied: tuple[int, ...]#
- tie_width: float#
- d_min: float#
- nuclear_rwp: float | None#
- nuclear_gof: float | None#
- nuclear_r_magnetic: float | None#
- n_magnetic_channels: int#
- caveats: tuple[str, ...] = ()#
- k_trials: tuple[KTrialSummary, ...] = ()#
- diagnostics: tuple[Diagnostic, ...] = ()#
- subgroup_audit: tuple[SubgroupAudit, ...] = ()#
- subgroup_note: str = ''#
- class rx.MagneticTrial#
One powder-equivalence class, refined once, with what the data said.
- class_index: int#
- representative: str#
- members: tuple[str, ...]#
- site: str#
- irrep: str#
- direction: str#
- bns_number: str#
- uni_number: int | None#
- msg_type: int | None#
- free_amplitudes: int#
- determinable_amplitudes: int | None#
- status: str#
- refusal: str | None = None#
- rwp: float | None = None#
- gof: float | None = None#
- delta_bic: float | None = None#
- r_magnetic: float | None = None#
- n_moment_parameters: int | None = None#
- n_free_parameters: int | None = None#
- moments: tuple[MomentRow, ...] = ()#
- held: tuple[str, ...] = ()#
- anti_translation_drift: float | None = None#
- n_starts: int | None = None#
- n_minima: int | None = None#
- start: str | None = None#
- fit_status: str | None = None#
- reference_status: str | None = None#
- class rx.MomentRow#
One site’s refined moment inside one trial.
Displacive mode amplitudes#
- rietx.crystallography.representation.distortion.mode_amplitudes(
- parent,
- child,
- transform,
- *,
- reference: str = 'average',
- tolerance: float = 1.5,
Decompose a child structure into
A_τper (k, irrep, direction), in Å.
- class rietx.crystallography.representation.distortion.ModeDecomposition#
A child decomposed against its parent into
A_τper (k, irrep, direction).
- class rietx.crystallography.representation.distortion.ModeAmplitude#
One irrep’s share of a child’s distortion, in Å.
- rietx.crystallography.representation.distortion.distortion_basis(
- parent,
- child,
- transform,
- *,
- reference: str = 'average',
Every symmetry-adapted mode a child of
parentadmits, in Å.
Displacive candidates of a parent#
- rietx.crystallography.magnetic.isotropy.distortion_candidates(
- parent,
- k,
- sites=None,
Every displacive candidate of
parentatk, with its child and modes in Å.