The Gaussian profile-fit (ProfileIntegrate2D) recovers more accurate intensities than the classical box-sum. On the HEWL rotation set its ANODE anomalous peak heights at the S/Cl sites rise from 0.46x to 0.53x of XDS (Met-S 6.0->7.1 sigma, Cys-S 5.6->6.1) and ISa 8.4->9.4, with R-meas unchanged. Box-sum stays available via --integrator boxsum. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
48 lines
2.1 KiB
C++
48 lines
2.1 KiB
C++
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#pragma once
|
|
|
|
#include <optional>
|
|
|
|
// Spot-intensity extraction method. ProfileGaussian (default) profile-fits with a measured-width
|
|
// Gaussian (ProfileIntegrate2D, Kabsch-style) - more accurate intensities than the classical uniform
|
|
// BoxSum (BraggIntegrate2D); validated on HEWL anomalous (stronger S/Cl peaks vs box-sum). BoxSum is
|
|
// the simpler, faster fallback. ProfileEmpirical learns the profile per resolution shell from strong
|
|
// spots (v2) - see bragg_integration/NEXTGEN_INTEGRATOR.md.
|
|
enum class IntegratorMode { BoxSum, ProfileGaussian, ProfileEmpirical };
|
|
|
|
class BraggIntegrationSettings {
|
|
IntegratorMode integrator_mode = IntegratorMode::ProfileGaussian;
|
|
float r_1 = 4;
|
|
float r_2 = 6;
|
|
float r_3 = 8;
|
|
float d_min_limit_A = 1.0;
|
|
std::optional<float> fixed_profile_radius;
|
|
float minimum_sigma_in_regards_to_i = 0.02;
|
|
// PixelRefine only: the measured (physical) tangential profile width is multiplied by
|
|
// this for the integration template, so the aperture is generous (XDS-style ~6 sigma)
|
|
// and tolerant of the centroid-floor scatter. Ignored by the classical integrator.
|
|
float profile_multiplier = 6.0;
|
|
|
|
public:
|
|
BraggIntegrationSettings& R1(float input);
|
|
BraggIntegrationSettings& R2(float input);
|
|
BraggIntegrationSettings& R3(float input);
|
|
BraggIntegrationSettings& DMinLimit_A(float input);
|
|
BraggIntegrationSettings& FixedProfileRadius_recipA(std::optional<float> input);
|
|
BraggIntegrationSettings& ProfileMultiplier(float input);
|
|
BraggIntegrationSettings& Integrator(IntegratorMode input);
|
|
|
|
|
|
[[nodiscard]] IntegratorMode GetIntegrator() const;
|
|
[[nodiscard]] float GetR1() const;
|
|
[[nodiscard]] float GetR2() const;
|
|
[[nodiscard]] float GetR3() const;
|
|
[[nodiscard]] float GetProfileMultiplier() const;
|
|
[[nodiscard]] std::optional<float> GetFixedProfileRadius_recipA() const;
|
|
[[nodiscard]] float GetDMinLimit_A() const;
|
|
|
|
[[nodiscard]] float GetMinimumSigmaInRegardsToI() const;
|
|
};
|