diffraction_geometry: updated resolution and det_dist calculation to use theta not 2theta

This commit is contained in:
2025-10-01 17:04:56 +02:00
parent ee626f83c2
commit 99d32326a7
@@ -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)
return self.detector_radius_mm / math.tan(2*theta)