About the calls most fits use#
A refinement in rietx usually needs seven calls: read the pattern, read the structure, build the instrument and its background, make a Refinement, fit, and plot.
Everything else in the API serves a particular task.
The tiers below count which rietx functions the seven tutorials and three worked examples call, out of ten scripts.
They count calls only, so reading a field such as RefinementResult.statistics does not appear, and neither does a result a notebook displays.
The API reference lists every name.
This is how the second tutorial makes the first six of the seven calls:
import rietx as rx
from rietx.examples import examples_dir
data = rx.read_pattern(examples_dir() / "FAP.XRA") # GSAS raw format
structure = rx.Structure.from_cif(examples_dir() / "fluorapatite.cif")
instrument = rx.Instrument.bragg_brentano(radiation="CuKa")
instrument.geometry.axial_sl.value = 0.02 # axial divergence
instrument.geometry.axial_hl.value = 0.02
instrument.background = rx.BackgroundChebyshev.with_terms(6)
ref = rx.Refinement(structure, instrument)
result = ref.fit(data, plan="mccusker_structural", two_theta_limits=(15, 130))
Every fit#
Seven or more of the ten scripts make these calls.
Call |
Scripts |
What it does |
|---|---|---|
|
10 |
holds the structure and instrument being refined |
|
9 |
runs a plan of stages against a pattern |
|
9 |
reads phases from a CIF |
|
8 |
builds a flat-plate laboratory instrument |
|
8 |
builds a Chebyshev background with a given number of terms |
|
8 |
draws the observed, calculated and difference curves |
|
7 |
reads a pattern file in any supported format |
Often#
Three or four of the ten make these calls.
Call |
Scripts |
What it does |
|---|---|---|
|
4 |
returns one refined parameter with its esd |
|
4 |
draws a pattern before any fit |
|
3 |
checks a raw pattern before a fit for humps, air scatter and lines from a stray wavelength |
|
3 |
says whether a fit is finished, and why |
|
3 |
calculates the pattern from the current models without refining |
|
3 |
returns the model to an earlier node of its history |
For a particular task#
Two of the ten scripts make each of these calls, or one does.
Task |
Calls |
|---|---|
Holding and tying parameters |
|
Reading the history |
|
Reading the report |
|
Working in a project |
|
Choosing a background |
|
A capillary instrument |
|
An unknown cell |
|
Calibrating the instrument |
|
A series of patterns |
|
Exporting and drawing |
|