Feat: Fixed per-beamline raster parameters in automation
CI / lint (pull_request) Successful in 46s
CI / test (3.12) (pull_request) Successful in 1m3s
CI / test (3.13) (pull_request) Successful in 1m3s
CI / test (3.14) (pull_request) Successful in 1m8s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Successful in 1m10s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 1m12s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Successful in 1m24s
CI / test-with-coverage (pull_request) Successful in 1m35s
CI / coverage-analysis (pull_request) Failing after 5s
Docs build and publish / docker (push) Successful in 9s
CI / lint (push) Successful in 30s
Build and Publish / release (push) Successful in 21s
CI / test (3.12) (push) Successful in 1m4s
CI / test (3.13) (push) Successful in 1m5s
CI / test (3.14) (push) Failing after 1m12s
CI / test-with-beamline-plugins (pxi_bec) (push) Successful in 1m15s
CI / test-with-beamline-plugins (pxii_bec) (push) Successful in 1m20s
CI / test-with-beamline-plugins (pxiii_bec) (push) Successful in 1m22s
CI / test-with-coverage (push) Successful in 1m31s
CI / coverage-analysis (push) Skipped
CI / lint (pull_request) Successful in 46s
CI / test (3.12) (pull_request) Successful in 1m3s
CI / test (3.13) (pull_request) Successful in 1m3s
CI / test (3.14) (pull_request) Successful in 1m8s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Successful in 1m10s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 1m12s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Successful in 1m24s
CI / test-with-coverage (pull_request) Successful in 1m35s
CI / coverage-analysis (pull_request) Failing after 5s
Docs build and publish / docker (push) Successful in 9s
CI / lint (push) Successful in 30s
Build and Publish / release (push) Successful in 21s
CI / test (3.12) (push) Successful in 1m4s
CI / test (3.13) (push) Successful in 1m5s
CI / test (3.14) (push) Failing after 1m12s
CI / test-with-beamline-plugins (pxi_bec) (push) Successful in 1m15s
CI / test-with-beamline-plugins (pxii_bec) (push) Successful in 1m20s
CI / test-with-beamline-plugins (pxiii_bec) (push) Successful in 1m22s
CI / test-with-coverage (push) Successful in 1m31s
CI / coverage-analysis (push) Skipped
The raster in the automated measurement sequence no longer reads exposure/transmission/resolution from the spreadsheet. It uses fixed per-beamline values from the dispatch: - X06DA: 0.04 s, 100% transmission, 150 mm - X10SA: 0.02 s, 10% transmission, 200 mm Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit was merged in pull request #237.
This commit is contained in:
@@ -58,3 +58,8 @@ class DefaultDispatch(BeamlineDispatch, ABC):
|
|||||||
@property
|
@property
|
||||||
def default_rotation_parameters(self) -> dict[str, Any]:
|
def default_rotation_parameters(self) -> dict[str, Any]:
|
||||||
return {"exp_time_s": 0.04, "dtz": 110, "incr_omega_deg": 0.2}
|
return {"exp_time_s": 0.04, "dtz": 110, "incr_omega_deg": 0.2}
|
||||||
|
|
||||||
|
@property
|
||||||
|
def default_auto_raster_parameters(self) -> dict[str, Any]:
|
||||||
|
"""Fixed raster parameters used by the automated measurement sequence."""
|
||||||
|
return {"exp_time_s": 0.04, "transmission": 1.0, "dtz": 200}
|
||||||
|
|||||||
@@ -67,3 +67,6 @@ class BeamlineDispatch(ABC):
|
|||||||
@property
|
@property
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def default_rotation_parameters(self) -> dict[str, Any]: ...
|
def default_rotation_parameters(self) -> dict[str, Any]: ...
|
||||||
|
@property
|
||||||
|
@abstractmethod
|
||||||
|
def default_auto_raster_parameters(self) -> dict[str, Any]: ...
|
||||||
|
|||||||
@@ -124,3 +124,7 @@ class X06daDispatch(DefaultDispatch):
|
|||||||
def default_rotation_parameters(self) -> dict[str, Any]:
|
def default_rotation_parameters(self) -> dict[str, Any]:
|
||||||
default = super().default_rotation_parameters
|
default = super().default_rotation_parameters
|
||||||
return default | {"transmission": 1.0}
|
return default | {"transmission": 1.0}
|
||||||
|
|
||||||
|
@property
|
||||||
|
def default_auto_raster_parameters(self) -> dict[str, Any]:
|
||||||
|
return {"exp_time_s": 0.04, "transmission": 1.0, "dtz": 150}
|
||||||
|
|||||||
@@ -125,3 +125,7 @@ class X10saDispatch(DefaultDispatch):
|
|||||||
def default_rotation_parameters(self) -> dict[str, Any]:
|
def default_rotation_parameters(self) -> dict[str, Any]:
|
||||||
default = super().default_rotation_parameters
|
default = super().default_rotation_parameters
|
||||||
return default | {"transmission": 0.1}
|
return default | {"transmission": 0.1}
|
||||||
|
|
||||||
|
@property
|
||||||
|
def default_auto_raster_parameters(self) -> dict[str, Any]:
|
||||||
|
return {"exp_time_s": 0.02, "transmission": 0.1, "dtz": 200}
|
||||||
|
|||||||
+4
-48
@@ -2346,55 +2346,11 @@ class AareDAQ:
|
|||||||
)
|
)
|
||||||
|
|
||||||
def get_auto_raster_params(self) -> SimpleScanParameters:
|
def get_auto_raster_params(self) -> SimpleScanParameters:
|
||||||
default_params = self.get_beamline_default_raster_params()
|
"""Raster parameters for the automated measurement sequence.
|
||||||
if self.status.sample is None:
|
|
||||||
return default_params
|
|
||||||
|
|
||||||
aaredb_params = (
|
Fixed per beamline; spreadsheet parameters only apply to data collection.
|
||||||
self.status.sample.aaredb_params
|
"""
|
||||||
if hasattr(self.status.sample, "aaredb_params")
|
return SimpleScanParameters(**self._dispatch.default_auto_raster_parameters)
|
||||||
else None
|
|
||||||
)
|
|
||||||
|
|
||||||
if aaredb_params is None:
|
|
||||||
return default_params
|
|
||||||
|
|
||||||
params = default_params
|
|
||||||
|
|
||||||
# Exposure
|
|
||||||
exp = getattr(aaredb_params, "exposure", None)
|
|
||||||
if exp is not None:
|
|
||||||
params.exp_time_s = exp
|
|
||||||
else:
|
|
||||||
params.exp_time_s = 0.04 # Default
|
|
||||||
|
|
||||||
# Transmission
|
|
||||||
trans = getattr(aaredb_params, "transmission", None)
|
|
||||||
if trans is not None:
|
|
||||||
logger.debug(f"transmission: {trans}")
|
|
||||||
params.transmission = trans / 100.0 if trans > 1.0 else trans
|
|
||||||
else:
|
|
||||||
params.transmission = 1.0 # Default
|
|
||||||
|
|
||||||
# Resolution and DTZ
|
|
||||||
res = getattr(aaredb_params, "targetresolution", None)
|
|
||||||
if res is not None:
|
|
||||||
logger.debug(f"resolution: {res}")
|
|
||||||
try:
|
|
||||||
params.dtz = self.diffraction_geometry.calc_dtz_mm(res)
|
|
||||||
logger.debug(f"dtz: {params.dtz}")
|
|
||||||
except Exception:
|
|
||||||
logger.exception(f"Failed to calculate dtz for resolution {res}")
|
|
||||||
|
|
||||||
# Adjust exposure time based on resolution
|
|
||||||
if res <= 1.5:
|
|
||||||
params.exp_time_s = 0.02
|
|
||||||
elif 1.5 < res <= 3.0:
|
|
||||||
params.exp_time_s = 0.04
|
|
||||||
else:
|
|
||||||
params.exp_time_s = 0.08
|
|
||||||
|
|
||||||
return params
|
|
||||||
|
|
||||||
def get_collection_params(self, prefer_smart: bool = False) -> tuple[SimpleScanParameters, str]:
|
def get_collection_params(self, prefer_smart: bool = False) -> tuple[SimpleScanParameters, str]:
|
||||||
spreadsheet_params, _file_prefix = self.spreadsheet_params()
|
spreadsheet_params, _file_prefix = self.spreadsheet_params()
|
||||||
|
|||||||
Reference in New Issue
Block a user