bragg integration: clarify that the trimmed background applies to stills too
The background trimmed mean is gated on the beam (monochromatic vs broadband), not on the acquisition mode: a monochromatic still (zero bandwidth) already gets the trim by default, only broadband (non-zero bandwidth: pink-beam / DMM) data keep the high-side sigma-clip. The comments, the settings doc and the --background-trim help wrongly implied the trim was rotation-only / that stills keep the sigma-clip. Wording only; no behaviour change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -24,8 +24,9 @@ class BraggIntegrationSettings {
|
||||
// Symmetric trimmed-mean fraction for the r2..r3 background ring: drop the lowest and highest this
|
||||
// fraction of ring pixels before averaging. Resists the high-side contamination (neighbour-spot
|
||||
// wings, tails, zingers) that biases the plain ring mean up and makes it over-subtract weak
|
||||
// high-angle reflections. Applied to monochromatic (rotation) data; the integration engine keeps
|
||||
// the tuned high-side sigma-clip for stills instead. 0 = plain ring mean (rugnux --background-trim).
|
||||
// high-angle reflections. Applied to monochromatic data (rotation and still); the integration engine
|
||||
// keeps the tuned high-side sigma-clip for broadband (non-zero bandwidth) data instead. 0 = plain ring
|
||||
// mean (rugnux --background-trim).
|
||||
float bkg_trim_fraction = 0.10f;
|
||||
|
||||
public:
|
||||
|
||||
@@ -68,8 +68,9 @@ BraggIntegrationEngine::BraggIntegrationEngine(const DiffractionExperiment &expe
|
||||
beam_y = geom.GetBeamY_pxl();
|
||||
use_ellipse = !empirical && (bw_sigma > 0.0 || c_radial > 0.0);
|
||||
|
||||
// Trimmed-mean background applies to monochromatic (rotation) data; broadband (stills) keep the tuned
|
||||
// high-side sigma-clip, so the trim is forced off there. The fraction itself comes from the settings.
|
||||
// Trimmed-mean background applies to monochromatic data - both rotation AND stills (the discriminator
|
||||
// is the beam, not the acquisition mode). Broadband (non-zero bandwidth: pink-beam / DMM) data keep the
|
||||
// tuned high-side sigma-clip instead, so the trim is forced off there. The fraction comes from settings.
|
||||
bkg_trim = broadband ? 0.0f : settings.GetBackgroundTrimFraction();
|
||||
|
||||
polarization = experiment.GetPolarizationFactor();
|
||||
|
||||
@@ -112,7 +112,7 @@ void print_usage() {
|
||||
std::cout << " Integration" << std::endl;
|
||||
std::cout << " --bandwidth <num> Relative X-ray bandwidth FWHM (e.g. 0.01 for 1% DMM); default from file or 0" << std::endl;
|
||||
std::cout << " --integration-radius <r> Signal-box radius r1, or r1,r2,r3 (px). One value => r2=r1+2, r3=r1+4" << std::endl;
|
||||
std::cout << " --background-trim <f> Rotation: symmetric trimmed-mean fraction for the background ring (0<=f<0.5, default 0.10; 0 = plain mean). Removes the high-side bias that over-subtracts weak high-angle spots" << std::endl;
|
||||
std::cout << " --background-trim <f> Monochromatic (rotation + still): symmetric trimmed-mean fraction for the background ring (0<=f<0.5, default 0.10; 0 = plain mean). Removes the high-side bias that over-subtracts weak high-angle spots (broadband data keep the sigma-clip instead)" << std::endl;
|
||||
std::cout << " --integrator <txt> Spot integrator boxsum|gaussian|empirical (default: gaussian profile-fit; boxsum is the classical fallback)" << std::endl;
|
||||
std::cout << " --still-partiality Experimental: weight stills reflections by a Gaussian excitation-error partiality exp(-dist_ewald^2/2sigma^2) instead of treating each as a full" << std::endl;
|
||||
std::cout << " -q, --azim-q-spacing <num> Azimuthal-integration Q bin spacing (1/A) (default: 0.01)" << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user