Merge branch 'erfc-partiality' into rc175: rotation partiality in the rocking-curve tail from erfc (CPU and GPU agree; last-bit change)
Validation Battery / Validation Battery (push) Canceled after 0s
Build Packages / Create release (push) Successful in 19s
Build Packages / build:portable:macos-arm64:nocuda (push) Successful in 3m29s
Build Packages / build:portable:windows-x86_64:nocuda (push) Successful in 21m13s
Build Packages / build:portable:linux-x86_64:nocuda (push) Successful in 14m35s
Build Packages / build:rugnux:linux-aarch64:cuda (push) Successful in 7m41s
Build Packages / HDF5 consumer tests (DIALS, XDS) (push) Successful in 27m35s
Build Packages / build:portable:windows-x86_64:cuda (push) Successful in 26m56s
Build Packages / build:portable:linux-x86_64:cuda (push) Successful in 18m2s
Build Packages / build:jfjoch:ubuntu2204:nocuda (push) Successful in 15m8s
Build Packages / build:jfjoch:rocky8:nocuda (push) Successful in 17m16s
Build Packages / build:jfjoch:rocky9:nocuda (push) Successful in 19m28s
Build Packages / build:jfjoch:ubuntu2404:nocuda (push) Successful in 19m21s
Build Packages / build:jfjoch:rocky8:cuda-sls9 (push) Successful in 21m43s
Build Packages / Generate python client (push) Successful in 26s
Build Packages / Build documentation (push) Successful in 1m10s
Build Packages / build:jfjoch:rocky9:cuda-sls9 (push) Successful in 22m56s
Build Packages / build:jfjoch:rocky8:cuda (push) Successful in 21m23s
Build Packages / build:jfjoch:ubuntu2204:cuda (push) Successful in 19m10s
Build Packages / build:jfjoch:rocky9:cuda (push) Successful in 23m1s
Build Packages / build:jfjoch:ubuntu2404:cuda (push) Successful in 21m24s
Build Packages / Unit tests (push) Successful in 2h1m27s
Validation Battery / Validation Battery (push) Canceled after 0s
Build Packages / Create release (push) Successful in 19s
Build Packages / build:portable:macos-arm64:nocuda (push) Successful in 3m29s
Build Packages / build:portable:windows-x86_64:nocuda (push) Successful in 21m13s
Build Packages / build:portable:linux-x86_64:nocuda (push) Successful in 14m35s
Build Packages / build:rugnux:linux-aarch64:cuda (push) Successful in 7m41s
Build Packages / HDF5 consumer tests (DIALS, XDS) (push) Successful in 27m35s
Build Packages / build:portable:windows-x86_64:cuda (push) Successful in 26m56s
Build Packages / build:portable:linux-x86_64:cuda (push) Successful in 18m2s
Build Packages / build:jfjoch:ubuntu2204:nocuda (push) Successful in 15m8s
Build Packages / build:jfjoch:rocky8:nocuda (push) Successful in 17m16s
Build Packages / build:jfjoch:rocky9:nocuda (push) Successful in 19m28s
Build Packages / build:jfjoch:ubuntu2404:nocuda (push) Successful in 19m21s
Build Packages / build:jfjoch:rocky8:cuda-sls9 (push) Successful in 21m43s
Build Packages / Generate python client (push) Successful in 26s
Build Packages / Build documentation (push) Successful in 1m10s
Build Packages / build:jfjoch:rocky9:cuda-sls9 (push) Successful in 22m56s
Build Packages / build:jfjoch:rocky8:cuda (push) Successful in 21m23s
Build Packages / build:jfjoch:ubuntu2204:cuda (push) Successful in 19m10s
Build Packages / build:jfjoch:rocky9:cuda (push) Successful in 23m1s
Build Packages / build:jfjoch:ubuntu2404:cuda (push) Successful in 21m24s
Build Packages / Unit tests (push) Successful in 2h1m27s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
commit
fca28f2728
3 files changed
+14
-4
No files matched your search
@@ -249,8 +249,7 @@ int BraggPredictionRot::Calc(const DiffractionExperiment &experiment, const Crys
|
||||
const float lorentz_reciprocal = std::fabs(m2 * (S % S0)) / (S.Length() * S0.Length());
|
||||
const float c1 = zeta_abs / (std::sqrt(2.0f) * mos_eff_rad);
|
||||
|
||||
const float partiality = (std::erf((phi + half_wedge_angle_rad) * c1)
|
||||
- std::erf((phi - half_wedge_angle_rad) * c1)) / 2.0f;
|
||||
const float partiality = RockingSlicePartiality(phi, half_wedge_angle_rad, c1);
|
||||
// Place the partial where this frame recorded it: at the centre of the frame's slice of
|
||||
// the rocking curve, which is the exact-condition position walked along its Debye ring by
|
||||
// the rotation between the two (RockingSlice.h). Walking along the ring is turning S
|
||||
|
||||
@@ -154,8 +154,7 @@ namespace {
|
||||
// c1 = sqrt(2) * sigma / zeta, where sigma = mosaicity
|
||||
float c1 = zeta_abs / (sqrtf(2.0f) * mos_eff_rad);
|
||||
float half_wedge = C.wedge_angle_rad / 2.0f;
|
||||
float partiality = (erff((phi + half_wedge) * c1)
|
||||
- erff((phi - half_wedge) * c1)) / 2.0f;
|
||||
float partiality = RockingSlicePartiality(phi, half_wedge, c1);
|
||||
|
||||
|
||||
// The partial sits at the centre of the frame's slice of its rocking curve, walked along
|
||||
|
||||
@@ -32,6 +32,18 @@
|
||||
#define ROCKING_SLICE_HD inline
|
||||
#endif
|
||||
|
||||
// The frame's slice of the rocking curve, (erf(b) - erf(a)) / 2 with a = (phi - w/2) c1, b = (phi + w/2) c1.
|
||||
// Where the slice lies in one tail of the curve both erf are near +-1 and their difference cancels to a
|
||||
// few float ulps of 1, so the same difference is taken from erfc, which keeps its relative precision there.
|
||||
ROCKING_SLICE_HD float RockingSlicePartiality(float phi, float half_wedge, float c1) {
|
||||
const float a = (phi - half_wedge) * c1, b = (phi + half_wedge) * c1;
|
||||
if (a > 0.0f)
|
||||
return (erfcf(a) - erfcf(b)) / 2.0f;
|
||||
if (b < 0.0f)
|
||||
return (erfcf(-b) - erfcf(-a)) / 2.0f;
|
||||
return (erff(b) - erff(a)) / 2.0f;
|
||||
}
|
||||
|
||||
// Flux-weighted centre of the frame's slice of the rocking curve, relative to the exact diffracting
|
||||
// condition, in radians of rotation. partiality is the slice's own mass (the caller has it already).
|
||||
ROCKING_SLICE_HD float RockingSliceCentroid_rad(float phi, float half_wedge, float c1, float partiality) {
|
||||
|
||||
Reference in new issue
Block a user