Improved number of darks, to be tested

This commit is contained in:
gac-x05la
2024-12-16 17:25:22 +01:00
parent e22cdeba30
commit 476a454dd3
2 changed files with 21 additions and 13 deletions

View File

@@ -7,16 +7,28 @@ from bec_server.scan_server.scans import Acquire, AsyncFlyScanBase
class AcquireDark(Acquire):
scan_name = "acquire_dark"
required_kwargs = ["num"]
gui_config = {"Acquisition parameters": ["num"]}
required_kwargs = ["exp_burst"]
gui_config = {"Acquisition parameters": ["exp_burst"]}
def __init__(self, num: int, **kwargs):
def __init__(self, exp_burst: int, **kwargs):
"""
Acquire a dark image. This scan is used to acquire a dark image. The dark image is an image taken with the shutter
closed and no beam on the sample. The dark image is used to correct the data images for dark current.
Acquire dark images. This scan is used to acquire dark images. Dark images are images taken with the shutter
closed and no beam on the sample. Dark images are used to correct the data images for dark current.
Args:
num (int): number of dark images to acquire
exp_burst : int
Number of dark images to acquire (no default)
exp_time : float, optional
Exposure time [ms]. If not specified, the currently configured value on the camera will be used
exp_period : float, optional
Exposure period [ms]
image_width : int, optional
ROI size in the x-direction [pixels]
image_height : int, optional
ROI size in the y-direction [pixels]
acq_mode : str, optional
Predefined acquisition mode (default=)
Returns:
ScanReport
@@ -26,7 +38,7 @@ class AcquireDark(Acquire):
"""
super().__init__(**kwargs)
self.burst_at_each_point = num
self.burst_at_each_point = 1 # At each point, how many times I want to individually trigger
self.scan_motors = ["eyex"] # change to the correct shutter device
#self.shutter = "eyex" # change to the correct shutter device
self.dark_shutter_pos = 0 ### change with a variable

View File

@@ -17,11 +17,9 @@ def fede_darks(nimages_dark, exposure_time=None, exposure_period=None, roix=None
acq_mode : str, optional
Predefined acquisition mode (default=)
Example:
--------
tutorialdarks(num=100, exp_time=5)
fede_darks(100, exposure_time=5)
"""
dev.es1_tasks.enabled = False
dev.es1_psod.enabled = False
@@ -56,6 +54,4 @@ def fede_darks(nimages_dark, exposure_time=None, exposure_period=None, roix=None
### TODO: camera reset
print("Handing over to 'scans.acquire_dark")
scans.acquire_dark(num=1, exp_burst=nimages_dark, exp_time=exposure_time, exp_period=exposure_period, image_width=roix, image_height=roiy)
scans.acquire_dark(exp_burst=nimages_dark, exp_time=exposure_time, exp_period=exposure_period, image_width=roix, image_height=roiy, acq_mode=acq_mode)