Result fields#
This page says what each field of a RefinementResult, a StageResult, a SeriesResult and a SeriesEntry holds, and what it means when it is empty.
A number in a field costs nothing until you read it, so a statistic that does not tell one fit from another is kept in a field and explained here, rather than raised as a diagnostic on every run.
The entries are generated from rietx.help.RESULT_FIELD_HELP, the one place each is written.
The refinement result and Sequential refinement show the same types in use.
Looking one up in code#
rietx.help.explain takes a result field, named Type.field, or a diagnostic code, and returns its entry.
The two kinds of name cannot collide, because a code has no dot in it.
A name this version does not describe, such as a code read from an older file, returns None.
from rietx.help import explain
entry = explain("RefinementResult.status")
print(entry.title)
print(explain("BOUND_HIT") is not None)
print(explain("NO_SUCH_CODE"))
Solver exit
True
None
RefinementResult#
What a fit returns: the answer, its statistics, its curves and what the engine found wrong with it.
RefinementResult.statusSolver exit. How the solver stopped:
converged,max_iterordiverged. It makes no claim that the fit is good, since a model that matches nothing can converge. Quality is indiagnostics, andusablereads both.RefinementResult.modeIntensity mode. How the fit treated the peak intensities.
rietveldcomputes them from the structure;lebailandpawleyextract them from the pattern and refine no structure.RefinementResult.parametersRefined parameters. Every parameter the fit determined: the free ones and the tied or derived ones that follow them, each with its value, its esd and whether it sits on a bound. A parameter no stage freed, or one the fit held because the data could not see it, is absent.
RefinementResult.statisticsAgreement indices. The agreement indices of the answer as Toby (2006) defines them: Rwp, Rp, Rexp, χ² and the goodness of fit, beside the point and parameter counts they rest on and the largest shift over esd in the last accepted step.
RefinementResult.stagesStage records. One record per stage the fit ran, in order, ending with the closing stage where the plan has one. Each says what the stage freed, what it held and why, and what it cost.
RefinementResult.diagnosticsFindings. Every finding the fit raised, each with a code, a level, a message, the paths it is about and a suggested action. A
warningis to be answered before quoting what it names; anerrormeans the values are not a refinement of this model.rietx.help.explainsays what a code means.RefinementResult.provenanceProvenance. What produced the result: the package and schema versions, the backend and its precision, the solver, the version of the report thresholds and when it was made.
RefinementResult.node_idHistory node. The history node this fit committed, which
Refinement.checkoutcan restore.Nonewhen the refinement ran with history disabled.RefinementResult.tree_idHistory tree. The history tree that node belongs to. A tree is pinned to one pattern by its data fingerprint.
Nonewhen the refinement ran with history disabled.RefinementResult.two_thetaFitted channels. The 2θ of every channel the fit used, in order. A channel outside the fit range or inside an excluded region is absent, so this can be shorter than the pattern file.
Unit deg 2θ
RefinementResult.y_obsObserved intensity. The observed intensity at each channel of
two_theta, in the pattern’s own intensity units. It is what the residual was computed against.RefinementResult.y_calcCalculated intensity. The calculated intensity at each channel at the refined values, background included. The weighted difference between
y_obsand this is what the fit minimised.RefinementResult.y_backgroundBackground curve. The background part of
y_calcat each channel: the whole declared background, any background humps included.RefinementResult.sigmaChannel weights. The σ each channel was weighted by: the file’s esd column where it has one, else the Poisson estimate, widened only where a measured background adds its own counting statistics. Read it through
RefinementResult.sig, which every weighted residual in the package divides by.RefinementResult.ticksReflection positions. Where the model puts each reflection, keyed by phase name: the Bragg angle plus the zero shift and the geometry’s own shift. Every emission line’s image is listed, so a Kα2 reflection has a tick of its own.
Unit deg 2θ
RefinementResult.tick_hklReflection indices. Which reflection each tick in
ticksis, as Miller indices h k l, paired with the positions by index. A satellite carries a fourth number, its order. A key is absent rather than empty where the ticks have no index, as for peaks declared by their centre.RefinementResult.qpaWeight fractions. The weight fraction of each modelled phase from the refined scales (Hill and Howard, 1987), with esds from the correlated scale block. The fractions are of the crystalline phases in the model, so they sum to one whatever else the specimen holds.
Nonein Le Bail and Pawley fits, and where the fractions could not be formed, whichQPA_UNAVAILABLEreports.RefinementResult.phase_agreementPer-phase R-factors. Each phase’s Bragg R-factor and structure-factor R-factor, with the number of reflections behind them (
optimize.statistics.structure_r_factors). The observed intensities are partitioned by the model’s own prediction, so a low value is not evidence that a phase is present. Empty outside Rietveld mode.RefinementResult.textureTexture evidence. For each phase with a spherical-harmonics texture, the texture index and the smallest pole-density multiplier over its reflections and over the whole sphere. A negative minimum is an unphysical texture, which
TEXTURE_NOT_POSITIVEreports. Empty when no phase declares one, outside Rietveld mode and in a joint fit.RefinementResult.data_supportObservations against parameters. How many independent observations the pattern holds: the reflections measured, the count corrected for overlap, and each per structural parameter (
optimize.statistics). It gates nothing.Nonefor a joint fit, and for a result recorded before the field.RefinementResult.absorptionAbsorption correction. The specimen absorption correction the fit applied, for a capillary or a flat plate, with the change in Biso it is equivalent to. That change, not Rwp, is what the correction buys.
Nonewhen no correction applied, and outside Rietveld mode.RefinementResult.restraintsRestraint deviations. Each soft restraint’s deviation from its target in units of its σ, and the pooled restraint χ². A large deviation is a restraint fighting the data, however good Rwp looks.
Nonewhen no phase declared restraints.RefinementResult.geometryBond geometry. Bond distances and angles of the refined structure, each with an esd propagated through the whole covariance beside the diagonal-only one. An esd that cannot be measured is absent rather than zero.
Noneoutside Rietveld mode and when the result did not come from a fit.RefinementResult.cell_volumesCell volumes. Each phase’s unit-cell volume with its esd through the covariance of the cell parameters, in every mode, since a Le Bail cell is a measurement too.
Nonewhen the result did not come from a fit.Unit ų
RefinementResult.microstructureSize and strain. Each phase’s coherent domain size and microstrain as physical numbers, with the Gaussian and Lorentzian readings given separately, the Scherrer constant used, and whether size and strain could be told apart. Empty when the fit had no compiled model to read a wavelength from.
RefinementResult.identifiabilityDegeneracy evidence. What the final Jacobian says about parameters the data cannot separate: how much of each structural column the background or an extra peak could imitate, the strongest correlations, the soft modes and the exchangeable pairs. A stored result keeps what the fit measured and cannot recompute it.
Nonewhen the result did not come from a fit that ran the guards.RefinementResult.parametricParametric coefficients. The coefficients of every parametric equation a joint fit refined, in the caller’s units at the equation’s reference, each with its esd from the joint covariance or
Nonewhere that gives none.Nonewhen no parametric equation was declared.RefinementResult.parametric_formParametric form tests. For each parametric equation, in declaration order, whether its form survives the data.
Noneexactly whenparametricis.RefinementResult.parametric_form_jointJoint parametric form test. The form test of every tested parametric equation at once: the χ² that freeing each equation’s target in every pattern would remove. It catches two wrong equations that each pass while the other is freed.
Noneunless two or more equations were tested.RefinementResult.parametric_equationsResolved parametric equations. Each parametric equation as the fit resolved it, with its coefficients’ covariance in the caller’s units, in declaration order.
RefinementResult.parametric_valueevaluates one at any coordinate.Noneexactly whenparametricis, and on a result written before the field.RefinementResult.n_extra_componentsDeclared extra components. How many additive non-Bragg components the instrument declared, background humps and sharp peaks together, whether or not any was freed.
0means none was declared;Nonemeans nothing counted, as in a joint fit or a result recorded before the field.RefinementResult.n_background_componentsDeclared background components. How many of the declared extra components land in the background. This is the background flexibility the caller granted, which a reader comparing two Rwp values needs to see.
0means none;Nonemeans nothing counted.RefinementResult.histogramsPer-histogram results. One slice per pattern of a multi-histogram joint fit, each with its own curves, statistics and diagnostics, while
statisticsis then the pooled figure. Empty for an ordinary fit.RefinementResult.for_histogramgives one slice in a single fit’s shape.
StageResult#
One stage’s record in RefinementResult.stages: what it freed, what it held and why, and what it cost.
StageResult.nameStage name. The stage’s name from the plan. The stage a plan appends to converge the answer is named by
strategy.staged.CLOSING_STAGE_NAME.StageResult.statusStage solver exit. How the solver stopped in this stage:
converged,max_iterordiverged. Earlier stages of a plan stop at a looser tolerance on purpose (ftol), so the last stage’s exit is the one about the answer.StageResult.n_iterationsResidual evaluations. The residual evaluations the stage’s solve made, the starting one included, and both solves where the stage solved twice. The name says iterations but the count is evaluations, the unit a stage’s
max_iterbudget is converted to throughNFEV_PER_ITERATION.StageResult.cost_initialStarting cost. The least-squares cost when the stage started: half the sum of squared weighted residuals over every row, the penalty and restraint rows included (
model.rows).StageResult.cost_finalFinal cost. The least-squares cost where the stage stopped, on the same terms as
cost_initial. The pair says how much the stage improved the fit.StageResult.freedParameters refined. The parameter paths this stage’s
turn_onpatterns freed, less any the stage held. A locked, tied or held path is never here, andParameterRow.held_becausesays why.StageResult.ftolTolerance the stage ran at. The relative cost-decrease tolerance this stage stopped at.
Nonemeans the solver’s own default, which the last stage of a plan takes; an earlier stage takes the plan’sintermediate_ftolunless it declares its own.StageResult.window_area_tolProfile window fraction. The fraction of each peak’s area this stage’s profile windows dropped.
Nonemeansmodel.forward.WINDOW_AREA_TOL, which every declared stage takes, and the closing stage runs at the plan’sclosing_window_tol.model.forward.recorded_window_tolturns this into whatcompile_modelneeds to reproduce the result’s curves.StageResult.n_constraint_truncationsSteps held on a constraint. How many solver steps were held on a linear-inequality constraint, such as the Stephens strain cone, because the step for the bounds alone crossed it. Always zero under the TRF solver. Nonzero in the last stage means the answer sits on a constraint face, which
CONSTRAINT_ACTIVEreports.StageResult.n_degenerate_cell_probesDegenerate cells refused. How many trial cells this stage’s residual refused as degenerate, with zero or negative volume, pushing the solver back rather than failing. The cell parameters carry no bounds of their own, so an underdetermined cell can reach one often. Zero means this stage never did.
StageResult.n_lapack_fallbacksDecompositions repeated. How many matrix decompositions this stage repeated with LAPACK’s QR-iteration driver because the default driver stopped without converging (
optimize.lapack). The answer is the one a converging build computes. Zero means none needed it.StageResult.heldHeld by the stage. Parameter columns this stage held fixed although its plan freed them, because the data could not determine them: the structural parameters of a phase too weak to see, for example. They are never in
freed, and the stage’s other fields say which test held which.StageResult.held_reachStopped with a held column. For each held column that drives other entries through a tie, the entries it stopped with it: holding a cubic
aalso stopsbandc. A column that moved nothing else is absent, soheldand these values together are every value the stage froze.StageResult.scale_b_heldDisplacements held against the scale. For each phase, by index, whose displacement parameters this stage held because the fitted range cannot separate them from the phase’s scale, the separation measured (
refine._scale_b_separation, againstrefine.SCALE_B_SEPARATION_FLOOR). An empty mapping is a stage that looked and held nothing;Nonemeans nobody looked, as in a joint fit.StageResult.width_twins_heldInstrument widths held. For each instrument width term this stage held because a free specimen width has the same angular dependence, the specimen columns it pairs with (
refine._width_twin_flats). The data see only the total width, so the instrument side is held where the stage found it. An empty mapping held nothing;Nonemeans a result stored before the field.StageResult.releasedReleased within the stage. Paths held at the start of the stage and freed again within it, because their phase rose above support while the stage solved, which then solved once more with them free. They refined, so they are not in
held.StageResult.moment_flat_axesFlat moment axes. For each magnetic site, keyed
phases.i.atoms.j, whose moment azimuth this stage held as part of a flat combination of its two angles, the flat rotation axis as a unit vector in crystal-axis components. Empty on every fit where no such site was held.StageResult.moment_turnedMoments turned. The sites of
moment_flat_axeswhose moment the stage turned about the flat axis before holding it, a move the data cannot see that changes the direction the fit reports. A site held where it was is inmoment_flat_axesalone.StageResult.blocked_by_holdBlocked by a hold. Paths this stage’s
turn_onmatched and did not free, because the caller declared a hold on them withRefinement.hold. A hold outranks a plan’s pattern and lasts untilRefinement.unhold. It feedsHOLD_BLOCKED_PLAN.StageResult.unknown_pathsPaths naming nothing. The literal paths in this stage’s
turn_on, and any retired spellings, that name no parameter of the model: a typo or a renamed path, so what the stage meant to refine did not refine. An empty list is a stage that was checked;Nonemeans nobody looked. It feedsSTAGE_PATH_UNKNOWN.StageResult.unreached_histogramsHistograms a stage missed. Joint fits only: for each histogram, by index, the patterns of this stage that matched rows on another histogram and none on this one. A single-histogram fit writes an empty mapping;
Nonemeans nobody looked. It feedsSTAGE_FREED_NOTHING.StageResult.seededRows lifted before solving. Each row this stage moved before solving, with the value it started at. A freed row sitting on a floor starts at the stage’s
seed, and an all-zero Stephens block is put on its isotropic ray bystrain_seed. An empty mapping lifted nothing;Nonemeans a result stored before the field.StageResult.moment_angle_testsStationary-angle tests. The stationary-angle test the stage’s covariance ran, one round per entry in order. An angle a round zeroed stayed free and kept its value but carries no esd.
Nonemeans no test ran, for example because no moment angle was free beside its modulus. It feedsMOMENT_ANGLE_STATIONARY.StageResult.cell_resetCells put back. The free cell parameters this stage put back at their starting values, because a cell parameter of their phase left the safety window while it solved (
params.vector.CELL_SAFETY_FRACTION).CELL_RUNAWAYnames them and says what followed. An empty list is every stage of an ordinary fit;Nonemeans a result stored before the field.StageResult.collapsedRestored and held. The free parameters this stage restored to their starting values and held, because its first solve found them flat: a phase whose scale fell under support, or a moment direction that stopped moving the pattern. Their first-solve values were a walk, not a measurement. A subset of
held;Nonemeans a result stored before the field.
SeriesEntry#
One pattern’s summary in SeriesResult.entries: what was fitted and how the chain reached it.
SeriesEntry.indexPosition in the series. The pattern’s position in the series as given, counting from zero. It is the series axis when no coordinate was given.
SeriesEntry.labelPattern label. The pattern’s name in the series: the label the run was given, else its source file’s name, made unique because it also names the pattern’s history file.
SeriesEntry.xSeries coordinate. The pattern’s series coordinate, such as a temperature, time or pressure, in the caller’s units.
Nonewhen the caller gave none, andindexis then the axis.SeriesEntry.statusPattern solver exit. The solver’s exit for the attempt kept on this pattern.
divergedafter the last rung of the ladder means the pattern is quarantined: it seeds no successor and joins no median, andSEQUENTIAL_UNRECOVEREDsays so.SeriesEntry.statisticsPattern agreement indices. The agreement indices of the kept attempt, the same table as
RefinementResult.statistics. Every entry the chain builds carries one;Nonemeans none was recorded.SeriesEntry.parametersPattern parameters. The refined parameters of the kept attempt, as
RefinementResult.parametersholds them.SeriesResult.trajectoryreads one path across every entry.SeriesEntry.qpaPattern weight fractions. The weight fractions of the kept attempt, as
RefinementResult.qpaholds them.Noneoutside Rietveld mode and where the fractions could not be formed.SeriesEntry.phase_agreementPattern R-factors. Each phase’s Bragg and structure-factor R-factors on this pattern, copied from its result. A low value on a weak phase is not evidence the phase is present, because the observed intensity is partitioned by the model’s own prediction. Empty outside Rietveld mode.
SeriesEntry.magneticMoment evidence. The evidence for each magnetic site’s moment on this pattern: whether the data support it, its esd and what the powder average cannot determine. A signed moment parameter alone draws an unsupported moment as a small one. Empty when no phase declares a moment or the pattern carries no magnetic term, and never because no moment was found.
SeriesEntry.diagnosticsPattern findings. The findings of this pattern’s own fit. Findings about the series as a whole are on
SeriesResult.diagnostics.SeriesEntry.n_iterationsPattern evaluations. The residual evaluations spent on this pattern over every attempt, each rung of the escalation ladder included. It is what a warm start actually buys, measured rather than assumed.
SeriesEntry.reseededWarm start rejected. Whether the warm start was rejected and the pattern refitted from the initial models, the
coldrung. A reseeded point can be a good fit, but it is not evidence that the trajectory is continuous there.SEQUENTIAL_RESEEDreports it.SeriesEntry.rwp_warmWarm attempt’s Rwp. The Rwp the first, warm attempt reached, recorded whenever the ladder escalated. With
reseededset too, a cold restart rescued the pattern; alone, the warm attempt stayed the best tried.Nonewhen the ladder did not escalate or the first attempt raised.SeriesEntry.rungWinning rung. Which attempt produced this entry’s values:
warm, a one-stage refit from the neighbour;warm_staged, the full plan from the warm state; orcold, the full plan from the initial models. The first pattern is alwayscold, having no neighbour to start from.SeriesEntry.rungs_triedRungs tried. Every rung attempted on this pattern, in ladder order. One entry means the pattern fitted first time;
n_iterationsis the cost of these less the ones inrungs_raised.SeriesEntry.rungs_raisedRungs that raised. The rungs whose fit raised an exception rather than returning, each with the exception’s type and message. The ladder escalates past a raised rung as past a diverged one. Empty wherever no rung raised.
SeriesEntry.rwp_fenceRwp fence. The Rwp limit the chain set at this pattern, from
reseed_factorand the Rwp of the patterns accepted before it (sequential._rwp_fence). An attempt above it climbs the ladder.Nonewhere no earlier pattern had been accepted, so no fence judged it.SeriesEntry.node_idPattern history node. The history node of this pattern’s kept fit. Each pattern has a tree of its own, pinned to it by its data fingerprint.
Nonewhen the series ran without history.SeriesEntry.tree_idPattern history tree. The history tree this pattern’s fit is in, one tree per pattern.
Nonewhen the series ran without history.
SeriesResult#
What a sequential refinement returns: one entry per pattern, and what the chain found about the series as a whole.
SeriesResult.modeSeries intensity mode. The intensity mode every pattern of the series was fitted in. One protocol over every pattern is what makes their trajectories comparable.
SeriesResult.entriesPattern summaries. One summary per pattern that returned a fit, in series order: its refined values, agreement indices, findings and how the chain reached it. Curves are not kept;
SequentialRefinement.results_holds each full result.SeriesResult.x_labelSeries axis name. The name of the series coordinate, such as temperature or time, for plots and trajectories. When no coordinate was given the pattern index is the axis, and this says so.
SeriesResult.directionChain direction. Which way the chain ran:
forward,backward, orboth, which runs it each way and compares the two trajectories. Underboththe entries are the forward chain’s and the comparison isSEQUENTIAL_PATH_DEPENDENT.SeriesResult.backwardReverse chain. The reverse chain’s own series result when
directionisboth, so the trajectory a path-dependence finding is about can be read.Nonefor a one-way run.SeriesResult.diagnosticsSeries findings. Findings about the series as a whole, such as path dependence, discontinuities, reseeds and patterns that failed. Each pattern’s own findings stay on its entry.
SeriesResult.discontinuitiesFlagged steps. Every
SEQUENTIAL_DISCONTINUITYfinding as fields, in the same order: the parameter, the two patterns it stepped between and the signed step. An empty list is a series that flagged nothing;Nonemeans a document written before the field.SeriesResult.relative_pathsPaths that are steps. The paths whose values are steps from where each fit began rather than positions, such as coordinate DOFs and rigid-body rotations. A comparison across patterns must not read them as positions.
Nonemeans a document written before the field.SeriesResult.angle_pathsMoment angle paths. The moment angle DOFs, whose differences across patterns are taken modulo a full turn. Recorded as
relative_pathsis, andNonemeans the same.SeriesResult.failuresPatterns that failed. Every pattern on which every rung of the ladder raised an exception, so the chain has no entry for it: its index, its label and the last exception. An empty list means every pattern returned a fit.
SeriesResult.n_failedFailure count. How many patterns failed outright, the length of
failures, for a caller that wants a number rather than a list to count.SeriesResult.provenanceSeries provenance. What produced the series: the package version, backend, solver, version of the report thresholds and when it ran.
Noneon the reverse chain inbackward, which carries none of its own.