diff --git a/image_analysis/bragg_integration/BraggIntegrationEngine.h b/image_analysis/bragg_integration/BraggIntegrationEngine.h index 4226ac93..7a982c82 100644 --- a/image_analysis/bragg_integration/BraggIntegrationEngine.h +++ b/image_analysis/bragg_integration/BraggIntegrationEngine.h @@ -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