config, added lens_magnfiication to alter pixel_to_mm calculation
This commit is contained in:
@@ -27,6 +27,7 @@ daq:
|
||||
redis_url: "x06da-redis.psi.ch"
|
||||
aarelc_url: "http://sls-gpu-003:9094"
|
||||
dtz_safe_position: null
|
||||
lens_magnification: 10 #or 5 currently
|
||||
|
||||
db:
|
||||
aaredb_url: "https://mx-aaredb-dmz-01.psi.ch/dispatcher"
|
||||
|
||||
@@ -26,6 +26,7 @@ daq:
|
||||
redis_url: "x10sa-redis.psi.ch"
|
||||
aarelc_url: "http://sls-gpu-003:9090"
|
||||
dtz_safe_position: 300
|
||||
lens_magnification: 10 #or 5 currently
|
||||
|
||||
db:
|
||||
aaredb_url: "https://mx-aaredb-dmz-01.psi.ch/dispatcher"
|
||||
|
||||
+12
-1
@@ -47,6 +47,7 @@ ABR_POS_MOUNT = AerotechCoordinate(
|
||||
omega_deg=0
|
||||
)
|
||||
ABR_OMEGA_MOUNT = 0.0
|
||||
DEFAULT_LENS_MAGNIFICATION = 10.0
|
||||
|
||||
logger = setup_logger("aareDAQ")
|
||||
|
||||
@@ -608,10 +609,20 @@ class BeamlineConfig:
|
||||
|
||||
def pixel_to_mm(self, zoom: float) -> float:
|
||||
cfg = self.settings
|
||||
return 1.0 / (
|
||||
base_pixel_in_mm = 1.0 / (
|
||||
cfg.camera_translation_factor_b
|
||||
* np.exp(cfg.camera_translation_factor_a * zoom)
|
||||
)
|
||||
# Apply lens magnification correction relative to the default 10x lens.
|
||||
# A lower magnification lens (e.g. 5x) makes each pixel cover more physical space.
|
||||
lens_magnification = cfg_get("daq.hardware.lens_magnification", DEFAULT_LENS_MAGNIFICATION)
|
||||
try:
|
||||
lens_magnification = float(lens_magnification)
|
||||
except (TypeError, ValueError):
|
||||
lens_magnification = DEFAULT_LENS_MAGNIFICATION
|
||||
if lens_magnification <= 0:
|
||||
lens_magnification = DEFAULT_LENS_MAGNIFICATION
|
||||
return base_pixel_in_mm * (DEFAULT_LENS_MAGNIFICATION / lens_magnification)
|
||||
|
||||
@property
|
||||
def beam_center(self) -> Tuple[float, float]:
|
||||
|
||||
Reference in New Issue
Block a user