Bragg integration: say why the peak rule cuts on any unreadable pixel
The comment justified the rule by informative missingness alone - a pixel over the detector's range goes missing BECAUSE the reflection was bright - and explicitly excused a gap, a mask and the sensor edge as unbiased. The code cuts on all of them, so the comment described a narrower rule than the one implemented. The code is right and the reason was incomplete. Renormalising over the surviving pixels is unbiased only while the profile MODEL is exact; lose the peak and the amplitude is set by the wings alone, so the result stops being a measurement of the reflection and becomes a measurement of how well the fitted shape describes it. That holds whatever made the pixel unreadable. The overload remains what motivated the rule and what biases hardest, since the loss then concentrates on the strong low-resolution reflections that are the largest terms of R_meas. Comment only; no logic changes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -86,13 +86,15 @@ constexpr float MAX_STENCIL_GROW_OVER_R3 = 2.0f;
|
||||
constexpr double PROFILE_SUMMATION_MAX_NSIGMA = 10.0;
|
||||
|
||||
// MINPK keeps a reflection while enough of its expected profile is readable. It says nothing about
|
||||
// WHERE the unreadable part is, and the two are not the same question. A pixel lost to a gap, a mask
|
||||
// or the edge of the sensor is lost for reasons that have nothing to do with this reflection, and the
|
||||
// fit renormalises over what is left with no bias. A pixel lost because the flux it saw put it over
|
||||
// the detector's range is lost BECAUSE the reflection was bright, and it is the peak: the fit then has
|
||||
// only the wings to set the amplitude from, and reads low - measured at -50% on the strongest
|
||||
// low-resolution reflections, which are also the largest terms of R_meas. So no unreadable pixel may
|
||||
// carry more than this fraction of the profile's own peak value.
|
||||
// WHERE the unreadable part is, and the two are not the same question. Renormalising over the pixels
|
||||
// that remain is unbiased only while the profile MODEL is exact: lose the peak and the amplitude is
|
||||
// set by the wings alone, so the estimate stops being a measurement of the reflection and becomes a
|
||||
// measurement of how well the fitted shape describes it. That holds whatever made the pixel
|
||||
// unreadable, so the rule below cuts on any of them. The overload is the case that motivated it and
|
||||
// the one that biases hardest - a pixel over the detector's range went missing BECAUSE the reflection
|
||||
// was bright, so the loss is concentrated on the strongest low-resolution reflections, which are the
|
||||
// largest terms of R_meas, and there the fit reads -50% against the symmetry mates. So no unreadable
|
||||
// pixel may carry more than this fraction of the profile's own peak value.
|
||||
//
|
||||
// A fraction of the peak rather than a radius in pixels, because the peak is as wide as the spot: for
|
||||
// a Gaussian the cut sits at sqrt(-2 ln f) sigma, i.e. 0.46 sigma here, which is the peak pixel alone
|
||||
|
||||
Reference in New Issue
Block a user