Changes in focusing script during the beamtime, this will need some more work

This commit is contained in:
2025-04-28 11:53:36 +02:00
parent 1bc2c38f62
commit 505c0ae6d4

View File

@ -50,8 +50,15 @@ def kbV_focusing_acquire(
aperture_width=0.15, aperture_width=0.15,
aperture_height=1.2, aperture_height=1.2,
n_pulses=1, n_pulses=1,
camera_name = "SARES30-CAMS156-XE",
): ):
""" Vertical KB mirror focusing acquisition with default parameters. """ Vertical KB mirror focusing acquisition with default parameters.
bender_us start and bender_ds start should be 0.3 below maximum focus.
aperture: list of absolute positions to scan (in width-direction)
aperture_width: width of the slit that is used to scan (beamlet size, should be small)
aperture_height: height setpoint (fixed, should be large)
""" """
return kb_focusing_acquire( return kb_focusing_acquire(
direction="vertical", direction="vertical",
@ -63,6 +70,7 @@ def kbV_focusing_acquire(
aperture_size=aperture_width, aperture_size=aperture_width,
aperture_size_pendicular=aperture_height, aperture_size_pendicular=aperture_height,
n_pulses=n_pulses, n_pulses=n_pulses,
camera_name =camera_name,
) )
@ -75,8 +83,14 @@ def kbH_focusing_acquire(
aperture_height=0.15, aperture_height=0.15,
aperture_width=1.8, aperture_width=1.8,
n_pulses=1, n_pulses=1,
camera_name = "SARES30-CAMS156-XE",
): ):
""" Horizontal KB mirror focusing acquisition with default parameters. """ Horizontal KB mirror focusing acquisition with default parameters.
aperture: list of absolute positions to scan (in height-direction)
aperture_width: width setpoint (fixed, should be large)
aperture_height: height of the slit that is used to scan (beamlet size, should be small)
""" """
return kb_focusing_acquire( return kb_focusing_acquire(
direction="horizontal", direction="horizontal",
@ -88,6 +102,7 @@ def kbH_focusing_acquire(
aperture_size=aperture_height, aperture_size=aperture_height,
aperture_size_pendicular=aperture_width, aperture_size_pendicular=aperture_width,
n_pulses=n_pulses, n_pulses=n_pulses,
camera_name = camera_name,
) )
@ -101,12 +116,14 @@ def kb_focusing_acquire(
aperture_size=0.15, aperture_size=0.15,
aperture_size_pendicular=1.2, aperture_size_pendicular=1.2,
n_pulses=1, n_pulses=1,
camera_name = "SARES30-CAMS156-XE",
): ):
""" KB mirror focusing acquisition routine for Cristallina. """ KB mirror focusing acquisition routine for Cristallina.
TODO: - split this up into separate routines TODO: - split this up into separate routines
- Make inner loop a generator, yielding: bender_us_rb, bender_ds_rb, beam_positions - Make inner loop a generator, yielding: bender_us_rb, bender_ds_rb, beam_positions
Input into live analysis. Input into live analysis.
Drive apertures back to start value....
""" """
# Benders # Benders
@ -169,10 +186,8 @@ def kb_focusing_acquire(
# Camera field name # Camera field name
data_field_name = "x_fit_mean" data_field_name = "x_fit_mean"
# Camera # Camera to be used
pip_instance_id = camera_name + "_sp"
CAMERA_NAME = "SARES30-CAMS156-XE"
pip_instance_id = CAMERA_NAME + "_sp"
### Acquisition start ### Acquisition start