DAQ: Small fix to handling zero detector distance in resolution calculation
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user