DAQ: Small fix to handling zero detector distance in resolution calculation

This commit is contained in:
2026-01-16 13:55:54 +01:00
parent 140eb6fe2a
commit 8ecf176cdf
+1 -1
View File
@@ -36,7 +36,7 @@ class DiffractionGeometry(BaseModel):
def resolution_angstrom(self, exp_dtz_mm: float) -> float:
if exp_dtz_mm <= 0:
raise ValueError("Detector distance must be positive")
raise ValueError(f"Detector distance must be positive {exp_dtz_mm}")
theta = math.atan(self.detector_radius_mm / exp_dtz_mm)*0.5
return self.wavelength_angstrom / (2 * math.sin(theta))