From 99d32326a72f44ed23b7fd294f2bbf2c1bbdb5df Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Wed, 1 Oct 2025 17:04:56 +0200 Subject: [PATCH] diffraction_geometry: updated resolution and det_dist calculation to use theta not 2theta --- common/src/aaredaqlib/diffraction_geometry.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/aaredaqlib/diffraction_geometry.py b/common/src/aaredaqlib/diffraction_geometry.py index 3c541306..d91e9846 100644 --- a/common/src/aaredaqlib/diffraction_geometry.py +++ b/common/src/aaredaqlib/diffraction_geometry.py @@ -38,7 +38,7 @@ class DiffractionGeometry(BaseModel): if exp_dtz_mm <= 0: raise ValueError("Detector distance must be positive") - theta = math.atan(self.detector_radius_mm / exp_dtz_mm) + theta = math.atan(self.detector_radius_mm / exp_dtz_mm)*0.5 return self.wavelength_angstrom / (2 * math.sin(theta)) def calc_dtz_mm(self, exp_resolution_angstrom: float) -> float: @@ -48,4 +48,4 @@ class DiffractionGeometry(BaseModel): if x >= 1.0 or x <= -1.0: return 0.0 theta = math.asin(x) - return self.detector_radius_mm / math.tan(theta) \ No newline at end of file + return self.detector_radius_mm / math.tan(2*theta) \ No newline at end of file