Mastering XRR Fitting|Home/Chapter 23: Reporting a Fit Others Can Trust

Part 4 · Chapter 23

Reporting a Fit Others Can Trust

In This Chapter

  • What X-Ray Calc keeps after a fit, and what you must write down at once
  • The report, item by item, and where each value comes from
  • How to write the numbers, the spreads and the undetermined parameters
  • A complete report for CoC4
  • Which files to keep

A fit is judged by what is reported with it. A structure without its settings, its spread and its checks can’t be tested by anyone else, and often not by you a month later. The fitting procedure ends with a report of 22 items, every one filled. Its paper gives the reason: “Every item has to be filled, so a fit cannot be judged from a number the agent chose to show.” The same holds for a person. This chapter rewrites the 22 items for someone working in X-Ray Calc and fills them in for CoC4.

Why a report

The author’s own fits show why. When the procedure was tested against them, the project files of the author’s fits carried no χ² at all. The structure was there. The number that says how well it fits the curve was not.

A report makes three things visible. The first is how the curve was prepared and which settings shaped the fit. The second is how far repeated runs agree. The third is which checks the fit passed and which it failed. Each chapter from Chapter 10: Is this curve worth fitting? to Chapter 18: Writing the verdict produced some of these items. The report collects them in a fixed order.

What the program keeps, and what it doesn’t

File > Save project (Ctrl+S) writes an .xrcx file. The file keeps:

  • the structure: every value, its Min and Max, and the boxes that pair or freeze it;
  • the profiles and tables that a Polynomial or Irregular fit created;
  • the settings: λ, Δθ, R min, the mode, the polynomial order, Population, Iterations, the χ² weighting, Solve scale in χ² and its Window, Smooth;
  • the data as prepared for the fit, after normalizing, smoothing and trimming.

It also keeps a record of the last fit: χ², the plain χ², the solved scale factor, the date, the fit time, the device, the program version and the random seed. A new fit replaces the record. To repeat a fit, type its seed into the Seed box of the Advanced fitting settings dialog (the Advanced Settings button). The same seed repeats the fit exactly only on the same device. The project doesn’t hold the raw measurement.

The record describes the fit as it ran. A setting you change after the fit doesn’t enter it.

The report, item by item

Table 23-1 gives the 22 items of the procedure’s report in its order (§13), with what to write and where it comes from. Four items were written for the program’s command-line server. The table replaces each with what a GUI user can record: the limits table you used for the server’s preset, the seeds from your fit records for its seeds, and the saved projects for its job numbers.

Table 23-1: The report, item by item: the fitting procedure’s 22 items (§13), rewritten for X-Ray Calc. The last column names the chapter that produces the value, or the place in the program where you read it. A plain-text template of the same list is in xrr-fit-report-template.txt.xrr-fit-report-template.txt, which comes with the web edition.

ItemWhat to writeWhere it comes from
1the measurement and the instrument; the limits table you used, and its date; the substrateChapters 10, 12 and 15
2θmax and Imax; the background; from an .xrdml file, the peak count rate and the counting time; the highest visible order divided by ImaxChapter 11; the Chart Info bar
3the sensitivity map: one line per change, the feature it movesChapter 13
4the starting modelChapter 12; Structure > Edit as text ...
5the normalization; the scale solved in χ² or not, its window, the solved factor, clamped or not; any renormalizationChapter 14; the Chart Info bar
6smoothing: none, or how many passes and whyChapter 14
7R min, and how it was chosenChapters 11 and 14
8the fitting range in 2θ, and the reason for its endChapter 14
9Δθ and the χ² scan that chose it; the fringe contrast beside itChapter 16
10the χ² settings: PW χ², TW χ²Chapter 16
11Population, Iterations, Shake, SeedR; the number of runs and the seed of eachChapter 16
12Periodic and Polynomial, both fitted, with χ² and spreads; the period drift and its spread; the choice and why; the order and its coefficientsChapter 17
13the limits as first set and as used; every limit widened, and the value that forced itChapter 15; the Fitting Limits dialog
14the saved project of every runFile > Save project As ...
15χ² of the starting model and of the reported fitCalc > Run before the fit; the Chart Info bar after it
16the fitted structure: the best run with each spread; undetermined parameters; sums; densities as free parametersChapters 18, 20 and 21
17every value on a limit or near one, and what was doneChapters 15 and 18; Fit report
18the order tableChapter 18; Fit report
19the edge check and the fringe checkChapter 18; Fit report
20the residual by bandChapter 18; Fit report
21the verdict, check by check, with the calibration of each limitChapters 18 and 19
22the saved project of the reported fit, and its exported fit resultsFile > Save project As ...; Result > Export fit results...

Fill every item. Write “none” where nothing was done, such as a smoothing pass that was not run. An empty item reads as a step that was skipped.

Writing the numbers

The reported structure is the best run. Report the run with the lowest χ², with the spread of each parameter over the runs beside it. Don’t report a mean over the runs. The procedure’s reason: “a mean over seeds is a structure no seed found” (§8.4). The spread is the sample standard deviation over the runs. It says how well the fit fixes a parameter. It is not an error bar of the measurement (Chapter 16: Several runs, and their spread).

An undetermined parameter gets no number. When the spread is larger than the precision you would claim, write “undetermined” (§10.7; Chapter 18: What the runs don’t agree on). When two layers trade thickness, report their sum and say that the split is undetermined (Chapter 18: Two layers as a sum).

A density is a free parameter. List every density with the words “free parameter, not a result” (§13, item 16). A density on its bulk ceiling is reported at the ceiling. Give the reason the limit stayed there (Chapter 20: Reporting a density).

σ is reported as fitted. Don’t say which interface of a period is the rougher one, or on which side an interlayer sits, unless repeated fits of each assignment agree (§10.14; Chapter 18: Which interface is rougher?).

Every limit travels with its calibration. A verdict limit was set on certain curves, under certain settings. When your fit lies outside them, the verdict says so (§10.5).

Say what you chose. When the floored points outnumber the visible orders, R min is “a floor you have chosen rather than one you have measured” (§1.3; Chapter 11: The plateau and the background). Report the scale factor and its window with every fit (Chapter 14: Letting the fit solve the scale). Report both fits of the mode test. The fit you didn’t keep belongs in the report too (Chapter 17: Decide on the drift, not on χ²).

A single film reports its thickness, the total of the layers on the substrate, the deposition rate, and σ and ρ as undetermined (Chapter 21: Reporting a film). A graded stack reports what its runs agree on: a profile in Polynomial mode, the set of periods and the total in Irregular mode (Chapter 22: What the fit can tell you about each layer).

A complete report for CoC4

CoC4 is the Co/C multilayer that Chapters 10 to 20 prepared, fitted and judged. Table 23-2 is its report. Every number comes from those chapters or from the data files of their runs. The reported fit is the Polynomial fit of order 1 of Chapter 17, judged in Chapter 18.

Table 23-2: The report for CoC4. Lengths in Å, densities in g/cm³. Spreads are standard deviations over five runs. The runs were made with the X-Ray Calc 3.9.4.1250 and 3.9.4.1270 engines; they have no project files.

ItemCoC4
1CoC4 (Co/C, 20 periods on glass), measured on a laboratory diffractometer, .xrdml file from the fitting procedure's data deposit. Limits: one laboratory's table (Table 15-1). Substrate: glass as SiO2, 2.50 g/cm³, σ 3.8 Å, held.
2θmax at 2θ = 0.4165°. Imax 608 828 counts (3 459 250 counts/s for 0.176 s). Background: one count, a floor chosen rather than measured (1710 of 4899 points counted zero). Highest visible order: 8, with 4 counts, 6.6 × 10⁻⁶ of Imax.
3Table 13-1: the period ±2 %, the layer ratio ±2 Å, σ at 1 and 8 Å, each density ±15 %, a surface layer, N = 10 and 40, each with the feature it moves.
4Top: C 15 Å, σ 3 Å, ρ 0.9. Stack, N = 20: C 31.40 Å and Co 23.30 Å, σ 4 Å, ρ 2.0 and 8.0; D = 54.70 Å, the design scaled to the period of the orders.
5Data > Normalize (Auto): divided by 1.1877 at 2θ = 0.4165°. Scale solved in χ², window 0.2; solved ×0.877, inside the window. No renormalization.
6None.
7R min 1.38 × 10⁻⁶: one count divided by 1.1877.
82θ = 0.4165–13.37°: a quarter of the order spacing past order 8, the last visible order.
9Δθ = 0.014° by a scan of one run each: χ² 1.2779, 1.2479, 1.2334 and 1.2337 at 0.012, 0.013, 0.014 and 0.015°. Fringe contrast between orders 1 and 2: 2.17 measured, 1.75 fitted.
10PW χ² on; TW χ² None.
11Population 5000, 200 iterations, Shake on, SeedR on (Polynomial mode doesn't use it). Five runs.
12Period held: χ² 1.2341–1.2420. One period, free: 0.9751–0.9760. Order 1: 0.9588–1.0342, drift −0.39 ± 0.06 Å, more than twice its spread: a drift. Order 3: 0.7893–0.9384, drift +0.78 ± 0.41 Å, undecided. Reported: order 1, H of C and Co on the polynomial, σ and ρ paired; c₁ = −0.0320 Å per period for C and +0.0113 Å for Co.
13First set: Table 15-1. Widened: the contamination layer's σ from 1–10 to 0–10 Å (Chapter 15); then its H from 5–40 to 0.1–40 Å, σ to 0–15 Å, ρ from 0.6–1.4 to 0.2–1.8 (one round of the near-bound rule, Chapter 17).
14Five runs of each mode, stored as the data files of Chapter 17. In the GUI: the saved project of each run.
15χ² 5.563 for the starting model; 0.959 for the reported fit.
16Period 55.00 ± 0.05 Å at the surface, 54.61 ± 0.05 Å at the substrate. C 31.66 ± 0.36 → 31.05 ± 0.41 Å; Co 23.34 ± 0.32 → 23.55 ± 0.44 Å (how the drift divides between them is undetermined). σ of C and of Co: undetermined. ρ of C 2.04 and of Co 7.59: free parameters, not results. Contamination layer 11.42 ± 0.28 Å, σ undetermined, ρ 0.92 (a free parameter).
17The contamination layer's σ at 0, its lower limit, which can't be widened. No density on its ceiling.
18Orders 1–8, calculated / measured: 1.01, 0.96, 0.95, 1.13, 0.77, 1.11, 0.26, 0.28.
19Edge: 1.06, 1.01, 1.00 at 2θ = 0.543, 0.669 and 0.798°. Fringes: 2.17 measured, 1.75 fitted.
20Bands 1–8: −0.008, −0.018, −0.020, −0.034, −0.026, +0.026, +0.030, +0.043. No warning; the last three bands lie on the floor.
21χ²: pass. Orders 1–6: pass; orders 7 and 8: fail, with 4 to 5 counts in each peak, too few to test the 25 % band (Chapter 19). Edge: pass. Bands: no warning. Calibration: outside (8 orders against 4; Δθ 0.014° against 0.012°; scale window 0.2 against 0.7). Verdict: fail on orders 7 and 8, explained by the counts.
22The runs have no project: they were made with the program's engine. In the GUI: the project name and its exported fit results.

The report fails its verdict and still reports a structure. Both are true. The period and its drift are fixed, and so are the thicknesses. The weak orders at the end of the curve fail a limit that was set on curves with four orders, and the counts in those peaks explain the fail.

Keeping the files

Keep these together, under names that say what they hold:

  • the raw measurement, as it came from the instrument. The project keeps only the prepared curve.
  • the project of every run (File > Save project As …), with the run’s number in its name.
  • the exported fit results of the reported run (.json).
  • the report, with the Fit report text pasted in.
  • a picture of the chart, from Result > Save as graphics … (BMP, EMF or WMF) or Result > Copy as BMP.

What this means when you fit

  • Export the fit results before the next fit. The project keeps the record of its last fit only.
  • Fill all 22 items. Write “none” where nothing was done.
  • Report the best run, with the spread of each parameter. Never a mean over runs.
  • Write “undetermined” without a number where the runs don’t agree. Report a sum where only the sum is fixed.
  • Call every density a free parameter, and give its ceiling when it sits there.
  • State the calibration of every limit, and say where the fit lies outside it.
  • Report a fail with its cause. Don’t change a limit to make the fit pass.
  • Keep the raw file, every run’s project and the exported results together.

Sources

  • Fitting procedure (Penkov, Peng & Fu 2026): §13, the 22 report items, “every one filled”, in their order; §1.3, a floor “chosen rather than … measured”, quoted in part; §8.4, the spread over seeds a sample standard deviation and the reported structure the lowest-χ² seed, “a mean over seeds is a structure no seed found”, quoted; §10.5, every threshold with its calibration; §10.7–10.8, undetermined parameters and sums; §10.14, σ without a claim about the rougher interface; §11.1, density never a result; §9.7, the split of a drift between the layers not a reported quantity.
  • The methods paper on the procedure (Penkov, Peng & Fu 2026, arXiv:2609.28926): §4, the reason for the template (“Every item has to be filled, so a fit cannot be judged from a number the agent chose to show.”, quoted) and Table 2, where the report has no GUI equivalent; §7, the author’s project files carry no χ².
  • The procedure’s preset (skill-v5\presets\csmic-empyrean.json): acceptance.calibrated_under (CoC4 and CoC5, four orders, Δθ 0.012°, scale_solve_window 0.7), used for the calibration line of item 21.
  • The X-Ray Calc 3 source (release 3.9.4.1250): what File > Save project writes (the structure with its limits and flags, the settings, the prepared data and the record of the last fit); Result > Export fit results… and its fields; the Seed box of Advanced fitting settings; Result > Fit report … and Copy as text; Result > Export …, Save as graphics … (BMP, EMF, WMF), Copy as BMP, Copy as EMF; the Chart Info bar’s scale text (“solved x…”, “at bound”); the automatic save as <name>-fitted.xrcx, next to the project when no Fitting Output folder is set. X-Ray Calc Help: Results, Exporting Fit Results and Auto-Save Results; Fitting, the Seed row.
  • The CoC4 values of Table 23-2: Chapters 10–20 and the data files of their runs (engines 3.9.4.1250 and 3.9.4.1270): figures-src/ch17/coc4-final.json (the reported run, its thickness profiles and the widening round; c₁ computed from the profiles), figures-src/ch18/coc4-poly1-report.json (χ² at the start, 5.56331; the eight band means). The highest order’s share of I_max is computed on the page: 4 / 608 828.

Cross-references: Chapter 2: The main window; Chapter 7: Roughness, Interlayers, and a Dirty Surface; Chapter 10: Is this curve worth fitting?; Chapter 11: The plateau and the background; Chapter 13: Two rules for reading a curve; Chapter 14: Letting the fit solve the scale; Chapter 16: Several runs, and their spread; Chapter 17: Decide on the drift, not on χ²; Chapter 18: Writing the verdict; Chapter 19: When to stop; Chapter 20: Reporting a density; Chapter 21: Reporting a film; Chapter 22: What the fit can tell you about each layer; Chapter 24: Ten Ways a Fit Can Mislead You; Chapter 25: Ten Checks Before You Trust a Number; Appendix B: Menus, Buttons and Keys.

Open the image file