Docs: data-analysis reference brought up to the rc.174 behaviour

Space group (13.1): every setting of a chosen rotation set is offered;
screws are claimed at 8 nats, with how that bound was set; the P1 search
merge is cut where a monotone fit of <I/sigma> drops under 1; the
operator-homogeneity gate reads the R gap between a subgroup and the rest;
a lattice-holohedral group is refused when merging under it narrows the
L-test like a twin.
Outliers (13.3): the rotation median is weighted at the expected
intensity, and the band's systematic part is multiplicative, with its
spread measured on the merge's own fulls.
Indexing: a sparse lattice is integrated on every frame; pass 1's lattice
is a hypothesis against a different re-index, and a pass sent back reuses
pass 1's indexing. Image: the flipped axis sign must beat chance; the
same-lattice beam-centre retry on an inconsistent merge.
Integration: five correction surfaces, not four; the .hkl carries no
amplitudes; the fulls' scale is smoothed differently from the partials'.
Tutorial: the correction surfaces are cross-validated on the half-set
correlation (as the reference says), not on an R_meas-like deviation.
Overview: the footprint, the 5 A indexing hypothesis, the centre of
symmetry, and the GPU pre-scan.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K5K8jvPPbmCrbqnWkddTuB
This commit is contained in:
leonarski_fandClaude Opus 5.5 committed 2026-10-05 16:34:31 +02:00
1 parent e7c4cb128c
commit e2084895db
6 files changed
+46 -22

No files matched your search

+9 -3
View File
@@ -28,7 +28,7 @@ $$\frac{I}{\sigma} \;\ge\; \frac{T}{\sqrt{1 + (T/\mathrm{ISa})^2}}$$
The converted cut lies strictly below $\mathrm{ISa}$ for every $\mathrm{ISa}$, so it is always reachable by the reflection the ceiling binds hardest, and it is within 1 % of $T$ on any merge with $\mathrm{ISa} \ge 21$ — a healthy merge is left exactly where it was. Multiplicity is taken as 1 deliberately rather than estimated, for the same reason. Where the merge reports no ISa (or $b = 0$) the cut is used as it stands.
The candidates are enumerated in **every setting the refined cell can host**, not only in the settings the International Tables call the reference one. A setting is a statement about direction — $P112_1$ puts its $2_1$ on $c$ where $P12_11$ puts it on $b$, and both are space group 4 — so a search restricted to reference settings can only ever put a screw or a centring on the axis the convention chose, whatever the data say. Two things bound the widened set. A candidate is offered only if the cell's own metric admits the rotations its setting names ($\alpha=\beta=90^\circ$ for a $2$-fold on $c$), and a candidate predicting exactly the absences another candidate already predicts is dropped as the same hypothesis under a second name. A non-reference setting is additionally refused when its centring class holds no reflection in this merge, since there is then nothing to confirm it with. Because the candidates of a point group all share its rotations, this cannot raise the symmetry: it decides *which axes* carry the screws and the centring, never how many operators there are. The setting found this way is the one the *decisions* are made in. The files are then written in the ITA standard setting (as XDS and POINTLESS write it: $P2_12_12$ with the pure axis on $c$ and $a<b$, monoclinic $b$-unique and $C$-centred with $\beta\ge 90^\circ$, the other orthorhombic groups $a\le b\le c$, triclinic reduced), or in the one the user supplied — a reference MTZ, a model that fits, the axis order of `-C`, a non-standard `-S` symbol, in that priority. That is an integer, determinant $+1$ change of basis applied after every decision, to the merged and unmerged files and the `_process.h5` alike, and reported as `SETTING_OPERATOR`; where the written group is not the reference setting (because the user asked for another) the report and the files name it by its full Hermann–Mauguin symbol. A group given with `-S` is placed on the axes its absences name before the merge: every change of basis that keeps its metric and centring is a candidate, each class of axial and zonal reflections some candidate predicts absent is read as the ratio of its mean $I/\sigma$ to that of the reflections none predicts absent, and the candidate that calls absent the classes that read weak and present the ones that read strong wins.
The candidates are enumerated in **every setting the refined cell can host**, not only in the settings the International Tables call the reference one. A setting is a statement about direction — $P112_1$ puts its $2_1$ on $c$ where $P12_11$ puts it on $b$, and both are space group 4 — so a search restricted to reference settings can only ever put a screw or a centring on the axis the convention chose, whatever the data say. Two things bound the widened set. The cell's own metric is asked once, when a point group's rotation set is chosen — a set whose rotations it does not host ($\alpha=\beta=90^\circ$ for a $2$-fold on $c$) is not offered — and every setting of a chosen set is then offered without asking again, because a cell refined free after integration sits a few tenths of a degree off $90^\circ$ and asking per setting kept only the reference one; and a candidate predicting exactly the absences another candidate already predicts is dropped as the same hypothesis under a second name. A non-reference setting is additionally refused when its centring class holds no reflection in this merge, since there is then nothing to confirm it with. Because the candidates of a point group all share its rotations, this cannot raise the symmetry: it decides *which axes* carry the screws and the centring, never how many operators there are. The setting found this way is the one the *decisions* are made in. The files are then written in the ITA standard setting (as XDS and POINTLESS write it: $P2_12_12$ with the pure axis on $c$ and $a<b$, monoclinic $b$-unique and $C$-centred with $\beta\ge 90^\circ$, the other orthorhombic groups $a\le b\le c$, triclinic reduced), or in the one the user supplied — a reference MTZ, a model that fits, the axis order of `-C`, a non-standard `-S` symbol, in that priority. That is an integer, determinant $+1$ change of basis applied after every decision, to the merged and unmerged files and the `_process.h5` alike, and reported as `SETTING_OPERATOR`; where the written group is not the reference setting (because the user asked for another) the report and the files name it by its full Hermann–Mauguin symbol. A group given with `-S` is placed on the axes its absences name before the merge: every change of basis that keeps its metric and centring is a candidate, each class of axial and zonal reflections some candidate predicts absent is read as the ratio of its mean $I/\sigma$ to that of the reflections none predicts absent, and the candidate that calls absent the classes that read weak and present the ones that read strong wins.
Several space groups may be indistinguishable on the measured data. Where they are, the search scores them identically and **all of them are named** in the result rather than one being reported as the answer: some are enantiomorph pairs, which merged intensities cannot distinguish in principle, others differ only by a screw condition that the centering condition already implies, so the screw has no observable signature at all, and others differ only on a zone the sweep never measured. Equality is keyed on the measured absence evidence, not on a count of predicted absences — two settings of one point group routinely predict a different *number* of absences on an unmeasured zone, which argues nothing either way. Among the tied candidates, where at least one axial zone *was* judged, the representative is the one claiming a screw on the rows this merge holds no control class for — a stated prior, not a measurement: a crystal that has already shown one screw is the group carrying the rest an order of magnitude more often than not, and a sweep short of half a turn routinely records one axial row and not the next. Centring-driven axial conditions do not count towards the claim, so a centred group and its screw partner still tie. What remains tied is represented by the lowest space-group number, which is a convention and not a measurement.
@@ -36,9 +36,11 @@ Several space groups may be indistinguishable on the measured data. Where they a
The Lorentz factor $\zeta$ (§8.3) governs how well a reflection can be measured, so when the spindle lies in a plane of the lattice, an operator permuting the two in-plane axes samples a different mixture of measurement qualities than one that only flips signs. The search is therefore run a second time on a merge of only the well-measured observations (`--search-min-zeta`, rotation default 0.85), both answers are reported, and **where they disagree the merge of all the observations decides**. The filter discards 40–80 % of the observations, which can starve an operator correlation the full merge confirms and can equally leave an operator confirmed that the full merge refuses, so the decision — the point group as well as the absences, which live in the weak reflections the filter removes — rests on the arm with every observation behind it. A tie (same order, different symmetry) is reported with both candidates named, for trying in molecular replacement.
Both search merges are cut in resolution where the data stop carrying signal: the shell means of $\langle I/\sigma\rangle$ are given their best non-increasing fit (pool-adjacent-violators, weighted by shell size) and the cut is where the **fit** drops under 1. Cutting at the first single shell to dip under 1 made the cut a coin toss on a merge whose $\langle I/\sigma\rangle$ is flat near 1: one crystal was cut at 0.85 Å or 1.19 Å depending on the compiler flags, and the coarser cut left its glide zones too few absences to be judged. The fit moves only as much as its input does, and on a profile that already falls monotonically the cut is unchanged.
Both search merges also drop the **frames whose fitted per-frame scale came out below a tenth of the run median** — the stretches where the crystal was barely in the beam. The scale enters as $1/G$, so such a frame's intensities arrive amplified tenfold or more, with their $\sigma$ amplified by the identical factor and the scale's own error nowhere in it; the production merge survives that because a reflection in the determined symmetry is measured ten or twenty times and `--reject-outliers` removes the amplified observation, but the search merges in $P1$, where a reflection has two or three observations and no majority exists to call any of them an outlier. On a crystal that repeatedly left the beam over a full turn this cost the $422$ point group outright, its operators reading $0.08$–$0.38$ on a merge that gives $\mathrm{CC}_{1/2} = 96\,\%$ in that same point group once it is assumed. Like the $\zeta$ filter, this is a filter of the search passes alone — the production merge keeps every frame.
**Screw axes** are scored **per axial zone**, not pooled over them. The conditions on $h00$, $0k0$ and $00l$ are independent, so their log-likelihoods add, and a zone that was never measured is allowed to **abstain** rather than to argue: pooling let one unmeasured row veto a confirmed one, and it read three genuine screws as weaker than two whenever the third row was shallow.
**Screw axes** are scored **per axial zone**, not pooled over them. The conditions on $h00$, $0k0$ and $00l$ are independent, so their log-likelihoods add, and a zone that was never measured is allowed to **abstain** rather than to argue: pooling let one unmeasured row veto a confirmed one, and it read three genuine screws as weaker than two whenever the third row was shallow. A screw is claimed when its absence evidence reaches **8 nats**. The bound is set on the zones themselves, every single-axis candidate of a battery of rotation datasets labelled against the deposited group: a false zone with no violation reads at most +4 nats, a true one from +10, and the true zones below the former bound of 20 were all short rows — a $2_1$ along a monoclinic axis of 25–30 Å reaches four to six odd reflections inside the search's resolution range, which on weak data sit at a few per cent of their row rather than at zero. Two absences clear the bound if both read below about 2 % of their row.
**A pseudo-translation is divided out before an axial absence is judged.** A translational pseudo-symmetry (§13.2) splits the reflections into two classes by the parity of the index along the translation, one systematically strong and the other systematically weak. Where the translation is half-integer along an axis, those two classes are exactly the absent class and the control class of a screw on that same axis, so the absence test would divide one by the other and pay the suppression twice — reading a class that is present but suppressed as extinct, and buying a screw the crystal does not have. The modulation is therefore measured along each axis from the intensities themselves — per axis, not pooled, since one row can be strongly modulated while its neighbours are not — and divided out of both the absence evidence and the violation count before the screw is scored. Only order-two screws are treated this way; a three-fold with a one-third translation is left unanswered rather than answered no.
@@ -50,6 +52,10 @@ Both search merges also drop the **frames whose fitted per-frame scale came out
**On a merge that reads twinned, the search asks the zone itself.** A twin of an index-2 subgroup by exactly the operators a promotion adds defeats every agreement gate once its fraction is high — the added operators then agree like real ones — so where the P1 merge's $\langle|L|\rangle$ lies in the partial-twin band (0.375 to 0.44) and the candidate does not hold every rotation of its lattice (so a twin law outside it is possible), the candidate is refused when the twin-immune zone of one of its index-2 subgroups reads acentric by 20 nats. Below 0.375 something other than a twin compresses the intensities, the zones with them, and they are not read. A $P3_1$ crystal twinned at $\alpha \ge 0.4$ by its 321 law, whose 32 promotion every agreement gate passed, reads −230 nats there.
**A point group's own operators must agree with each other.** A point group is the claim that all of its operators are symmetries of one crystal, and a mixture of real and false operators has a specific shape: the real ones form a subgroup — the true group's intersection with the candidate — and everything outside it is false. The gate therefore reads the operators sorted by their $R$ against the merge, finds every prefix that closes into a subgroup, and takes the largest factor by which every operator outside such a subgroup reads worse than every operator inside it; above 3.2 the candidate is refused. A genuine group whose operators merely spread over a continuum — anisotropic systematic error spreads a cubic crystal's operators twofold — has no such gap. The earlier form, worst-agreeing over best-agreeing operator, divided by an extreme order statistic and refused a genuine $432$ as soon as one of its operators happened to agree unusually well.
**A group that holds every rotation of its lattice is refused when merging under it narrows the L-test like a twin.** Every gate above compares the added operators with a reference, and a pseudo-symmetric structure or a twin defeats them all. For a candidate that holds every rotation its lattice admits no twin law exists, so intensities merged under it that read like a twin's are not a twin. The Padilla–Yeates $L$-test is read twice on the same pairs of the $P1$ merge — as measured, and with every intensity replaced by the mean of its orbit under the candidate — and the candidate is refused where the merged $\langle|L|␍angle$ reads twin-like ($0.375 \le \langle|L|␍angle < 0.44$) and the averaging closed a third or more of the gap from the unmerged value to 0.375. Genuine lattice-holohedral groups close 0.01–0.25 of it. A merge reading below 0.375 is not read: nothing a twin or a false operator does reaches that, so something else compresses the intensities.
**The lattice class is re-asked where the metric knows more.** The Bravais class comes from Niggli reduction and a lattice-character lookup (§6), and that lookup can land short of the truth or beside it: near the Niggli type-I/type-II boundary it is decided by the last digits of the refined cell, and a lattice that is nearly but not exactly hexagonal matches the hexagonal character even when no point group that class can host carries the two-folds the data actually have. Two recoveries run, both settled by the intensities. Every rotation the cell metric can host beyond the named class — read off Le Page's two-fold search on the lattice itself, which measures each rotation's obliquity in a primitive basis and owes nothing to the character table — is put to the intensities as a single operator, scored exactly as the search scores its own operators, on the same reflection population and the same $E^2$ normalisation. And where the metric group is larger than the adopted class's holohedry, the merge is reindexed into the metric group's conventional cell and the space-group search is run again there, with every gate live; the reindex is committed only where the search in the new setting confirms a strictly higher point group *and* the centring the new cell describes, so a pseudo-symmetric metric leaves the answer already in hand standing.
### 13.2 Twinning check, and translational pseudo-symmetry
@@ -64,7 +70,7 @@ Beside them, on rotation data, the run reports **twin-immune zone evidence** for
### 13.3 Outlier rejection
Merging applies an optional per-observation median-based $N\sigma$ cut (`--reject-outliers`, default 6σ for `rot3d`, off otherwise). The same $N\sigma$ cut is fed back into the error model: after an initial $a,b$ fit the parameters are re-fit once on the reflections that survive rejection (dropping any whose squared deviation exceeds $N^2\,[a\,\sigma^2 + (b\,\langle I\rangle)^2]$), so the calibrated errors describe the reflections that actually enter the merge rather than the pre-rejection pool.
Merging applies an optional per-observation median-based $N\sigma$ cut (`--reject-outliers`, default 6σ for `rot3d`, off otherwise). On the rotation path the median is weighted by each full's counting variance taken at the reflection's **expected** intensity, as the merge weights are (§10.4): an observation's own Poisson variance falls with its own intensity, so own-variance weights hand the median to whichever equivalents came out low — on a strongly absorbing crystal, where some frames read equivalents ten to a hundred times down, the median sat on the absorbed ones and the test removed correct measurements far above it. The band about the median keeps the counting part linear, $\pm N\sigma_\text{counting}$, but takes the systematic part as a **factor**, $e^{\pm N s}$ about the expected intensity: the error model's systematic term is multiplicative — absorption, illuminated volume, a scale that is off — and as likely to be a factor $1/f$ as $f$, while a band symmetric in $I$ reaches far below the median and only a little above it once that term is large. $s$ is the spread of $\ln(I/\text{median})$ measured on the merge's own fulls (their weighted median of $|\ln(I/\text{median})|$, weighted by $(\langle I\rangle/\sigma_\text{counting})^2$ so the fulls whose ratio counting noise does not blur carry it), with the error model's $b$ as the fallback where it cannot be measured; to first order in $Ns$ the band is the linear one. The same $N\sigma$ cut is fed back into the error model: after an initial $a,b$ fit the parameters are re-fit once on the reflections that survive rejection (dropping any whose squared deviation exceeds $N^2\,[a\,\sigma^2 + (b\,\langle I\rangle)^2]$), so the calibrated errors describe the reflections that actually enter the merge rather than the pre-rejection pool.
The median needs three observations, so a reflection measured once or twice — typically one good observation and one artefact (a hot pixel, a zinger) after Friedel merging — is never tested by it, and an artefact that looks precise (thousands of counts, a small relative $\sigma$) can outweigh mates from weak frames and become the median itself. Every observation of the written merge is therefore also judged by **Wilson statistics**. Beyond 4 Å its $E^2 = I/(\varepsilon\,\langle I/\varepsilon\rangle_\mathrm{shell})$ is compared with a bound set by a budget of $\alpha = 0.01$ expected false rejections per dataset: with $N$ observations tested, $\ln(2N/\alpha)$ for acentrics and twice that for centrics, and the observation's lower confidence limit $I - z\sigma$ (with its own $\sigma$, and $z$ from the same budget) must exceed it, so noise in weak shells does not trigger it; a shell whose $\langle I\rangle$ is not itself established at that significance is not judged. The bound is widened by the tail scale of the dataset's own intensity distribution, measured on its well-measured observations (1 for a Wilson crystal; larger under a pseudo-translation or anisotropy). An improbable singleton is dropped; an improbable observation with company only when most of the reflection's other observations are probable and it disagrees with their mean beyond the errors — several large observations confirm each other. An observation whose signal disk lost pixels to the mask or to saturation is never counted as such a witness, since its profile estimate may be low: a strong reflection is not replaced by its clipped mate. The count is `OBSERVATIONS_REJECTED_WILSON=` in the report (included in `OBSERVATIONS_REJECTED=`), and the developer report lists each observation with its image and detector position.
+13 -1
View File
@@ -186,6 +186,16 @@ materially more of the spots than the file's. Where the two disagree only in Bra
at the same primitive volume, that is said separately from a volume ratio that is an axis harmonic,
which is the one the centre decides.
**The same lattice at both centres is not proof that the file's is right.** A centre off by about one
reflection spacing indexes the same cell just as well, with part of the sweep given indices one out,
and only the merge shows it. So where the measured centre lies further from the file's than this
geometry absorbs (and than three standard errors of its own fit), it is kept as a hypothesis, and the
first pass is run there when the file's centre merged inconsistently: $\mathrm{CC}_{1/2}$ below 0.9 in
the lowest-resolution shell of the search merge, where every reflection is strong and runs read
0.97–1.00. The run then keeps whichever centre merges better — more reflections at $I/\sigma \ge 2$,
or a clearly higher $\mathrm{CC}_{1/2}$ in that inner shell. Asked unconditionally it would cost a
second first pass on about half of all runs.
Two things keep that comparison honest. The **depth** of the spot list is asked at *both* centres: the
first-pass ladder of §6 reads how much of each frame the pass uses, and a count taken at the measured
centre against the whole spot list at the file's differs in two things at once, so it cannot say which
@@ -207,7 +217,9 @@ the right answer indexes and the wrong one does not.
* **The rotation-axis sign.** A miniCBF header names the axis but gives no direction, and an NXmx
vector is only meaningful together with the detector mounting. So after a poor first pass the
opposite sign is tried and whichever indexes more validation frames is kept; the decision then
opposite sign is tried and whichever indexes more validation frames is kept, the flipped one only
where its lattice also beats chance on the pooled spots (§4.1), so that one frame against none on a
sparse pattern cannot flip it; the decision then
holds for the rest of the run, and it flips the **axis**, not the angles, because prediction reads
the axis too. It runs before the long-axis rescue, since with the sign wrong every candidate
lattice is wrong.
+3 -3
View File
@@ -39,7 +39,7 @@ A spot is indexed if $\delta^2 < \tau^2$, where $\tau$ is the configured toleran
For indexed spots, the reciprocal lattice point $\mathbf{p} = h\mathbf{a}^*+k\mathbf{b}^*+l\mathbf{c}^*$ is used to compute $\Delta_\mathrm{Ewald}(\mathbf{p})$ (stored as a diagnostic and later used in profile-radius estimation).
A frame is taken to be this crystal's when at least a fraction $g = 0.20$ of its in-resolution, non-ice spots index. On rotation data that decision is what admits the frame to integration, so its denominator matters: every spot handed to it that is not a reflection of this crystal argues against the frame.
A frame is taken to be this crystal's when at least a fraction $g = 0.20$ of its in-resolution, non-ice spots index. On rotation data that decision is what admits the frame to integration, so its denominator matters: every spot handed to it that is not a reflection of this crystal argues against the frame. Where it cannot do that job — a lattice whose pooled spots fall below $g$ and which fewer than half the validation frames clear — every frame is integrated instead: the frames that clear $g$ are then only the upper tail of the same sparse population, not the frames the crystal was in, and admitting them alone dropped most of a small-molecule sweep and its completeness with it.
That test decides a **frame**. Whether a rotation run has a lattice **at all** is decided on the spots instead. A frame count comes from serial crystallography, where each image is its own experiment; a rotation sweep is one crystal and one orientation matrix, its frames are not independent of each other, and what such a count mostly measures is how many spots happen to land on a frame — a sweep carrying four spots an image cannot reach a six-spot bar on three frames in four however right the lattice is. The refusal therefore compares the fraction of *all* spots in the sampled frames that the lattice explains against what the same lattice explains when each frame's spots are put at **another frame's angle**: same lattice, same spots, same detector, same refinement, with only the claim that these spots were seen at *these* angles removed. That difference is the evidence, and it carries no spots-per-frame number anywhere, so nothing has to be chosen for a crystal that diffracts weakly. Measured over a hundred datasets the permuted level never exceeds 2.6 % and the smallest true margin is seventeen points. `--min-indexed-spots` (default 6, floor 4 — four is where a lattice stops being fitted by any three spots) still sets the reported indexing rate and the count the first pass *ranks* candidate lattices by; every rescue and every arbiter still counts frames.
@@ -329,11 +329,11 @@ The refinement above (§7.2) runs per image against that image's spots. For rota
The geometry the run commits is re-fitted on all the reflections once the held-out half has approved it — a walk from where it arrived, one step wide; everything else from nominal in the wide box — and the bounds are asked again of that fit rather than only of the half that earned it. A move outside them leaves the geometry at nominal, as every other refusal does, and the refusal says so in the report (`POSTREFINE_REFUSED`, with what the fit wanted) rather than passing silently. Detector tilt is held fixed, being gauge-coupled to the crystal orientation on a single crystal.
**Whether the data determine the distance at all is asked, not assumed.** At a detector far enough away that no reflection reaches more than a few degrees of $2\theta$, a longer distance and a larger cell move every spot the same way to first order — the difference is of order $\sin^2\theta$ of the spot's own position, about 0.4 px rms per per cent of distance over a 2M detector at 820 mm against 2–3 px at the distances a crystal is usually collected at. The joint fit then finds a distance/cell pair that fits its own spot positions a little better than the header, commits it, and the pass re-integrated there finds the next pair: a walk along the degenerate direction that the realised residual never ratifies (measured on such a sweep: a header at 820 mm walked to 846 mm with the cell 3.3 % too large, the realised held-out residual flat at every round). So the same fit is asked once more with the distance **held at the header**, every other block as free as before — the nested hypothesis "the header distance is right" — and the two are compared on the one residual family that can tell them apart: the **excitation** residual. It never involves the detector, so it is blind to the distance itself; what it sees is the cell scale, and a held fit at a wrong header distance is forced into a wrong cell scale by the spot positions, which the rocking angles then refuse (measured: a header 1.4 % long leaves the held fit's excitation residual seventeen times the free fit's). Where freeing the distance lowers the held-out excitation residual below the held fit's by more than that residual's own standard error, the free fit is committed exactly as before; where it does not, the held fit is — header distance, refined beam, cell, orientation and axis — and the report says so (`POSTREFINE_DISTANCE_HELD`). The positional residual is deliberately not consulted for this: it is the family whose in-fit gain along the degenerate direction re-integration erases, and pooled with the excitation family it either drowns a decisive excitation gain in its own noise (a 54 % excitation gain read as 9 % pooled against a 9 % noise) or lends the degenerate direction a gain that is not there. Nothing is tuned here: the only input is the standard error of the residual itself, the same noise the geometry walk's rounds have to beat. The wavelength is never refined on a single crystal for the same reason in its exact form: it scales the spot positions and the rocking angles identically to the cell, so no sweep can tell the two apart at any $2\theta$.
3. **Pass 2** re-indexes de novo and re-integrates at the committed geometry. Only the **detector distance and beam centre** carry over: the refined cell, orientation and axis are what make the distance identifiable, but pass 2 re-indexes from scratch, so they are not propagated. Where that re-index indexes too few frames the run falls back to pass 1's lattice and integrates it at the refined geometry — and the cell is then **scaled to the distance it will be used at**, since a real-space cell is measured against the distance its spots were seen at, and carrying it across a distance change otherwise scales the whole cell by the ratio of the two. The orientation is untouched.
3. **Pass 2** re-indexes de novo and re-integrates at the committed geometry. Only the **detector distance and beam centre** carry over: the refined cell, orientation and axis are what make the distance identifiable, but pass 2 re-indexes from scratch, so they are not propagated. Where the re-index finds a **different** lattice — the two compared on their Niggli-reduced primitive edges, within 2 %, so a symmetric setting is never told apart from its own primitive cell — pass 1's lattice is scored at the refined geometry as a hypothesis of its own, and integrated when it indexes more validation frames; the same lattice found again is kept as the re-index refined it. The run likewise falls back to pass 1's lattice where the re-index indexes too few frames, and integrates it at the refined geometry — and the cell is then **scaled to the distance it will be used at**, since a real-space cell is measured against the distance its spots were seen at, and carrying it across a distance change otherwise scales the whole cell by the ratio of the two. The orientation is untouched.
Pass 2 measures the post-refinement again, and where it still moves the geometry the run **walks**: it re-indexes and re-integrates at what the fit asks for, and repeats. A round is kept only for what it *realises*, not for what the fit predicts, and it can realise a gain in two ways, either of which has to beat its own noise: a lower held-out residual (the standard errors of the two means combined), or a larger share of the validation spots on the lattice beyond chance (the binomial noise of the two shares, z = 3.29). The residual alone misses exactly the errors that cost resolution: it is dominated by the low-resolution reflections, where a distance and the cell scale that compensates it move every spot alike, and its centroids are taken inside a disc centred on the prediction, so they follow the prediction part of the way; the high-resolution validation spots are the first to leave the lattice (measured: 0.6 % of distance read 0.74 of the residual's noise and 70.4 % against 58.1 % of the validation spots, and cost 0.07 Å of resolution). A move of a trust-region step or more starts the walk outright. A smaller one is first tried as two indexing probes on the validation frames — at the fit's geometry and at the one in hand, each stopping once the lattice is scored — and pays for a re-integrated round only where the fit's geometry scores higher. The run keeps the best round it reached.
The space group is determined **after** pass 2, on the geometry the run refined, and pass 1 does not search at all: a decision taken on the worse of the two passes and then carried forward is a constraint on the better one, and would have to be reconciled with what pass 2 later found. The guard that chooses which pass is written compares each pass's **first** merge — $P1$ on both sides, full resolution range, before the correction surfaces — which both passes produce anyway, so it never compares statistics computed in two different space groups. What it compares there is the **signal each pass measured**: the count of unique reflections merged at $I/\sigma \ge 2$, less the count at $I/\sigma \le -2$. An empty reflection is as likely to land in either tail, so the second count is the merge's own measure of how much of the first is noise — which is what makes two passes on different lattices comparable: a pass on an $n$-fold supercell merges $n$ times the reflections, most of them empty, and their noise alone once out-counted the crystal's own lattice. Self-consistency cannot do this job — against an external arbiter the signal count named the more accurate geometry on 23 of 27 arm-dataset pairs where $R_\mathrm{meas}$, $CC_{1/2}$ and ISa managed 13, a coin flip — and that merge's own $CC_{1/2}$ least of all, being pooled over the whole range, uncut and uncorrected, so the shells with no signal in them dominate it and they are exactly the shells a geometry move disturbs (it reads 0.13 on a crystal whose data merge at 0.995). The refined pass is sent back only where it merges more unique reflections than its cell can hold, where it measured decisively less signal (10 %, and only where it covers no more of reciprocal space either — a wider integration disk pulls weak reflections in and dilutes the strong fraction without measuring less; between two lattices the reflection count of the smaller is scaled by the integer index of one in the other), or where it lost the axial rows the systematic absences are read off. One index-time veto remains and is keyed to pass 1's **lattice** rather than its group: a centred pass-1 lattice against a primitive pass-2 one.
The space group is determined **after** pass 2, on the geometry the run refined, and pass 1 does not search at all: a decision taken on the worse of the two passes and then carried forward is a constraint on the better one, and would have to be reconciled with what pass 2 later found. The guard that chooses which pass is written compares each pass's **first** merge — $P1$ on both sides, full resolution range, before the correction surfaces — which both passes produce anyway, so it never compares statistics computed in two different space groups. What it compares there is the **signal each pass measured**: the count of unique reflections merged at $I/\sigma \ge 2$, less the count at $I/\sigma \le -2$. An empty reflection is as likely to land in either tail, so the second count is the merge's own measure of how much of the first is noise — which is what makes two passes on different lattices comparable: a pass on an $n$-fold supercell merges $n$ times the reflections, most of them empty, and their noise alone once out-counted the crystal's own lattice. Self-consistency cannot do this job — against an external arbiter the signal count named the more accurate geometry on 23 of 27 arm-dataset pairs where $R_\mathrm{meas}$, $CC_{1/2}$ and ISa managed 13, a coin flip — and that merge's own $CC_{1/2}$ least of all, being pooled over the whole range, uncut and uncorrected, so the shells with no signal in them dominate it and they are exactly the shells a geometry move disturbs (it reads 0.13 on a crystal whose data merge at 0.995). The refined pass is sent back only where it merges more unique reflections than its cell can hold, where it measured decisively less signal (10 %, and only where it covers no more of reciprocal space either — a wider integration disk pulls weak reflections in and dilutes the strong fraction without measuring less; between two lattices the reflection count of the smaller is scaled by the integer index of one in the other), or where it lost the axial rows the systematic absences are read off. One index-time veto remains and is keyed to pass 1's **lattice** rather than its group: a centred pass-1 lattice against a primitive pass-2 one. A pass sent back is pass 1 as it was judged — its whole indexing result is reused, not indexed again de novo at the header geometry, which is a hypothesis nobody had judged.
Only pass 2 is written, as the canonical `<prefix>_*` output. Pass 1's merge exists to give the guard something to judge pass 2 against, so it stops short of the parts of the merge that only fill in a file — the correction surfaces, the twinning and radiation-damage analyses, the R-free flags and the amplitudes — and writes no merged files of its own.
+3 -3
View File
@@ -322,7 +322,7 @@ Reflections below a minimum partiality can be rejected from merging to avoid uns
### 10.3 Smoothing of per-frame scales
The per-frame scales $G_i$ are fit by robust (Cauchy) inverse-variance-weighted ratios; there is no explicit $G\approx1$ prior. For rotation datasets, optional smoothing enforces the expectation that scale and mosaicity vary slowly across a sweep: **after** the per-frame fit, $\log G_i$ (and the mosaicity) are replaced by a centred **moving average** over a window spanning a configurable rotation range (XDS DELPHI-like; `--smooth-g`, default 5° for rot3d, off otherwise). It is a post-fit smoothing pass, not a curvature penalty inside the least-squares objective.
The per-frame scales $G_i$ are fit by robust (Cauchy) inverse-variance-weighted ratios; there is no explicit $G\approx1$ prior. For rotation datasets, optional smoothing enforces the expectation that scale and mosaicity vary slowly across a sweep: **after** the per-frame fit, $\log G_i$ (and the mosaicity) are replaced by a centred **moving average** over a window spanning a configurable rotation range (XDS DELPHI-like; `--smooth-g`, default 5° for rot3d, off otherwise). It is a post-fit smoothing pass, not a curvature penalty inside the least-squares objective. (The per-frame scale refitted on the combined fulls, §10.6, is smoothed differently: by a penalised smoother whose smoothness is chosen by cross-validation.)
The **crystal orientation** is smoothed the same way, and for the same reason. Geometry is re-refined independently on every frame against that frame's spots alone — as few as a dozen on a sparse crystal — so the per-frame orientation carries a real slow drift (crystal slippage, up to ~1.3° across a sweep) on top of fit noise that scales with spots per frame. Before scaling, the per-frame lattices are de-rotated to a common reference, averaged in frame order, rotated back, and every partial's $\Delta\phi$ — hence its partiality — is recomputed from the smoothed lattice. The window is chosen per dataset by leave-one-out cross-validation (does a frame's neighbours predict its orientation?) rather than fixed, because drift and noise both vary by two orders of magnitude between crystals; it is capped, because the per-frame fit also absorbs a real per-frame systematic that smoothing too wide destroys. Only frames that actually indexed take part: a frame that did not carries an all-zero lattice, which is *finite* and so passes a validity check written as a finite test, and would otherwise be both averaged into its neighbours' orientation and scored in the cross-validation that picks the window. Refining *less* is not an alternative: with per-image refinement off the space group is lost on several crystals.
@@ -388,7 +388,7 @@ Before the combine a per-frame scale can also be fitted on the partials themselv
How smooth that scale is over the rotation is left to the data rather than to a fixed window. Each round fits every frame on its own fulls against the current reference, giving a scale $G_f$ and its information $D_f=\sum w^2c^2$; the scale is then the curve $x=\log G$ minimising $\sum_f J_f\,(x_f-y_f)^2+\lambda\sum_f(\Delta^2 x)_f^2$, with $y_f$ the frame's own fit in log scale and $J_f$ its information carried there — a penalised (Whittaker–Eilers) smoother, solved as a five-band linear system. $\lambda$ is chosen by cross-validation: blocks of frames one rocking curve wide are left out in turn and predicted from the curve through the rest (neighbours closer than a rocking curve share their measurement, since a full sums those frames). A frame of hundreds of fulls is then followed frame by frame, a frame of two or three is carried by its neighbours, a stretch with none is bridged by a straight line, and a scale that falls a hundredfold over a few degrees — an absorbing crystal turning edge-on — is followed where a window would average across it. Once the curve settles, one free fit is shrunk toward it frame by frame by how much of each frame's deviation its neighbour shares (the lag-1 covariance), which hands back a real per-frame systematic and discards fit noise.
After scale-fulls, four **correction surfaces** are fitted on the combined fulls (rotation path, **on by default**; disable all with `--no-scaling-corrections`), each an alternating multiplicative refinement of the per-full scale against the merged reference:
After scale-fulls, five **correction surfaces** are fitted on the combined fulls (rotation path, **on by default**; disable all with `--no-scaling-corrections`), each an alternating multiplicative refinement of the per-full scale against the merged reference:
- **Decay.** Radiation damage weakens later frames more at higher resolution — a resolution×time (Debye–Waller) systematic the resolution-flat per-image scale cannot capture. A single global relative-$B$ rate is fitted, $\ln(I_\mathrm{ref}/I_\mathrm{obs}) = 2\,(\mathrm{d}B/\mathrm{d}n)\,(n-\bar n)\,s^2$ (frame $n$, $s^2 = 1/4d^2$), and folded into the scale. It engages only when the total relative-$B$ over the run exceeds a physical floor (2 Ų); below that the decay is negligible and "correcting" it only spreads symmetry equivalents (same $s^2$, different frames). An optional **per-batch relative-$B$** (`--relative-b[=deg]`, off unless requested; 10°-of-rotation batches by default) extends the single global rate to a smooth $B(n)$ curve — the same $s^2$-weighted decay fit solved independently over short frame batches, curvature-penalized so it cannot over-fit and cross-validated like the surfaces below — for crystals whose decay is non-linear in dose. Its cross-validation splits on **ASU-group parity**, not the frame parity the surfaces below use: a per-batch parameter owns whole frames and so cannot be scored on a held-out frame, whereas splitting the symmetry equivalents tests whether a batch's $B$ generalises to reflections it was not fitted on.
- **Absorption.** A smooth multiplicative factor over the diffracted-beam direction expressed in the goniometer (crystal) frame: each full's predicted detector position gives the lab diffracted direction, de-rotated by the spindle so a fixed crystal-frame direction is sampled at many rotation angles and its grid cell is well-determined. Negligible at hard X-rays / thin crystals; it matters at low photon energy.
@@ -439,7 +439,7 @@ $
The prior mean is $\Sigma = \varepsilon\,K_\mathrm{shell}\,a(\mathbf{h})$, where $\varepsilon$ is the reflection's epsilon (symmetry-enhancement) multiplicity, $a(\mathbf{h}) = \exp(-\tfrac12\mathbf{s}^\mathsf{T}B\,\mathbf{s})$ carries the deviatoric anisotropy tensor $B$ of §13.5 along the reflection's own direction, and $K_\mathrm{shell} = \sum I/\varepsilon \,/ \sum a$ over its resolution shell, so the priors of a shell still average to its measured Wilson mean. The amplitudes are first made with $a = 1$ at the end of the merge and made again once the tensor has been fitted; only $F$/$\sigma_F$ change, never an intensity. With an isotropic prior the weak direction of an anisotropic crystal gets a prior set mostly by the strong direction, which turns its noise into amplitude; for isotropic data the tensor is near zero and the prior reduces to the shell mean, so it is used whenever a tensor was fitted. A shell whose $K$ is not positive takes that of the nearest lower-resolution shell. As in `ctruncate`, an intensity more than 3.7σ below zero gets no amplitude (the intensity is kept) and does not enter the shell mean. Strong reflections ($I>20\sigma$) short-circuit to $|F|=\sqrt{I}$, where the French–Wilson bias is below 0.3%; a reflection with an unusable $I/\sigma$ falls back to $\sqrt{\max(I,0)}$. The integral is evaluated numerically with a log-shift for stability.
Amplitudes are written as MTZ `F`/`SIGF`, mmCIF `_refln.F_meas_au`/`F_meas_sigma_au`, and appended to the text HKL, alongside the intensity columns. The **same** $|F|$ feed the model-validation step (§14), so the reflection file and the maps use one consistent set of amplitudes.
Amplitudes are written as MTZ `F`/`SIGF` (and `F(+)`/`F(-)`) and mmCIF `_refln.F_meas_au`/`F_meas_sigma_au`, alongside the intensity columns; the SHELX `.hkl` holds intensities only. The **same** $|F|$ feed the model-validation step (§14), so the reflection file and the maps use one consistent set of amplitudes.
### 10.9 Reference data: fixing the space group and resolving the indexing ambiguity
+8 -4
View File
@@ -15,7 +15,9 @@ scattered background and compares it with the file's ([§1.4](CPU_DATA_ANALYSIS_
reads how wide this crystal's spots are, which sets the integration radius
([§9.5](CPU_DATA_ANALYSIS_INTEGRATION.md)), and how much longer they are along their radius than
across it, which is the beam's bandwidth where the file does not state one
([§9.6](CPU_DATA_ANALYSIS_INTEGRATION.md)).
([§9.6](CPU_DATA_ANALYSIS_INTEGRATION.md)), and how much wider still they grow away from the beam,
which sets the integration footprint ([§9.1](CPU_DATA_ANALYSIS_INTEGRATION.md)). In a GPU build the
pre-scan runs on the card.
**Spots.** Every image is decoded — on the GPU straight from the compressed chunk
([§0](CPU_DATA_ANALYSIS_IMAGE.md)) — and one fused pass computes the azimuthal profile and finds
@@ -26,8 +28,9 @@ the spots against each image's own per-resolution-ring noise
FFT search looks for periodicity over thousands of directions; candidate cells are
Niggli-reduced, classified by Bravais lattice, refined both constrained and triclinic, and decided
on how many validation frames each actually indexes
([§4–§7](CPU_DATA_ANALYSIS_INDEXING.md)). A failed pass triggers the discrete rescues — the
rotation-axis sign, the beam-centre search — before anything is given up on.
([§4–§7](CPU_DATA_ANALYSIS_INDEXING.md)). A de-novo run also tries a second hypothesis with the
shortest accepted axis lowered from 10 to 5 Å, for small-molecule cells. A failed pass triggers the
discrete rescues — the rotation-axis sign, the beam-centre search — before anything is given up on.
**First integration pass.** At the geometry in the file, every frame is predicted
([§8](CPU_DATA_ANALYSIS_INTEGRATION.md)) and profile-fit integrated
@@ -44,7 +47,8 @@ pass is the canonical output, and a guard compares the two passes and keeps the
**Space group.** On the P1 merge of the final pass, the point group is scored operator by operator
on resolution-normalised intensities and the screw axes, glide planes and centring are read from the
systematic absences ([§13.1](CPU_DATA_ANALYSIS_DECISIONS.md)); twinning and translational
systematic absences, with the centre of symmetry from the intensity distribution where the absences
leave it open ([§13.1](CPU_DATA_ANALYSIS_DECISIONS.md)); twinning and translational
pseudo-symmetry are checked beside it ([§13.2](CPU_DATA_ANALYSIS_DECISIONS.md)). `CANNOT_DETERMINE` and an enantiomorphic pair are real
answers here, not evasions.
+10 -8
View File
@@ -120,7 +120,7 @@ refined pass against, and writes no merged files of its own — no `<prefix>_01.
`--write-process-h5`, each pass still writes its own, so `<prefix>_01_process.h5` appears beside
`<prefix>_process.h5`.) Disable it with `--rotation-no-postrefine`.
After the per-frame scale-fulls step, rotation scaling applies three **correction surfaces**, **on by
After the per-frame scale-fulls step, rotation scaling applies three kinds of **correction surface**, **on by
default** (`--no-scaling-corrections` disables all):
- **Decay** — a global Debye–Waller relative-*B* over the run, for the radiation damage that weakens
@@ -130,8 +130,9 @@ default** (`--no-scaling-corrections` disables all):
(default 10°-of-rotation batches when bare, off otherwise), cross-validated like the surfaces here, for
crystals whose decay is non-linear in dose.
- **Absorption** — a smooth multiplicative factor over the diffracted-beam direction in the goniometer
frame (path length through the crystal). Negligible at hard X-rays / thin crystals; it matters at
low photon energy. Its benefit shows up most on model-based metrics: a smooth absorption error
frame (path length through the crystal), offered as a grid, as spherical harmonics and as a
surface that also varies with the rotation angle. Negligible at hard X-rays / thin crystals; it
matters at low photon energy and on strongly absorbing crystals. Its benefit shows up most on model-based metrics: a smooth absorption error
largely cancels among symmetry mates (little effect on the error model / ISa) but still biases the
intensities, so it measurably lowers *R*<sub>free</sub>.
- **Modulation** — a smooth multiplicative factor over the position where a reflection lands on the
@@ -142,11 +143,12 @@ default** (`--no-scaling-corrections` disables all):
JUNGFRAU data — it lowers *R*<sub>meas</sub> by several to tens of percent on datasets that carry a
detector systematic, while holding or improving CC1/2 and the anomalous signal.
All three are **cross-validated** — fitted on even-numbered frames and kept only if they improve the
held-out odd-frame symmetry-equivalent agreement by a clear margin (and vice versa). The agreement is
scored as a σ-independent, *R*<sub>meas</sub>-like fractional deviation, so a surface can never pass
cross-validation by merely reshaping the sigmas; where the systematic is absent the surface is a no-op
rather than a source of added noise, which is why they are safe to leave on.
All of them are **cross-validated** — fitted on even-numbered frames and used to merge the odd ones,
and the other way round, and kept only if the correlation between the two half-set means, within
resolution shells, rises over the same halves merged without the surface. The score does not involve
the sigmas, so a surface can never pass by merely reshaping them; where the systematic is absent the
surface is a no-op rather than a source of added noise, which is why they are safe to leave on
([§10.6](CPU_DATA_ANALYSIS_INTEGRATION.md#106-rotation-datasets-combining-partials-into-fulls-3d-integration)).
Independently of any correction, a rotation run prints a **radiation-damage report** — the per-image
scale correlation-to-merge and mosaicity versus dose, and the relative *B*-factor change over the run