csaxs_bec.scans.scans_v4.cont_grid.ContGrid#

class ContGrid(fast_axis: Annotated[DeviceBase, ScanArgument(display_name='Fast Axis', description='Axis with continuous motion.', tooltip=None, expert=False, hidden=False, example=None, units=None, reference_units=None, gt=None, ge=None, lt=None, le=None, reference_limits=None, precision=None, alternative_group=None)], fast_start: Annotated[float, ScanArgument(display_name='Fast Start', description='Start position for measurement points of the fast axis.', tooltip=None, expert=False, hidden=False, example=None, units=None, reference_units=None, gt=None, ge=None, lt=None, le=None, reference_limits=None, precision=None, alternative_group=None)], fast_end: Annotated[float, ScanArgument(display_name='Fast End', description='End position for measurement points of the fast axis.', tooltip=None, expert=False, hidden=False, example=None, units=None, reference_units=None, gt=None, ge=None, lt=None, le=None, reference_limits=None, precision=None, alternative_group=None)], fast_step_size: Annotated[float, ScanArgument(display_name='Fast Step Size', description='Step size for points of the continuous motion axis.', tooltip=None, expert=False, hidden=False, example=None, units=None, reference_units=None, gt=None, ge=None, lt=None, le=None, reference_limits=None, precision=None, alternative_group=None)], stepper_axis: Annotated[DeviceBase, ScanArgument(display_name='Step Axis', description='Step axis of the grid scan, stepping through the lines.', tooltip=None, expert=False, hidden=False, example=None, units=None, reference_units=None, gt=None, ge=None, lt=None, le=None, reference_limits=None, precision=None, alternative_group=None)], stepper_start: Annotated[float, ScanArgument(display_name='Step Start', description='Start position of the step axis.', tooltip=None, expert=False, hidden=False, example=None, units=None, reference_units=None, gt=None, ge=None, lt=None, le=None, reference_limits=None, precision=None, alternative_group=None)], stepper_stop: Annotated[float, ScanArgument(display_name='Step Stop', description='End position of the step axis.', tooltip=None, expert=False, hidden=False, example=None, units=None, reference_units=None, gt=None, ge=None, lt=None, le=None, reference_limits=None, precision=None, alternative_group=None)], stepper_step_size: Annotated[float, ScanArgument(display_name='Step Step Size', description='Step size of the step axis in units of the motor.', tooltip=None, expert=False, hidden=False, example=None, units=None, reference_units=None, gt=None, ge=None, lt=None, le=None, reference_limits=None, precision=None, alternative_group=None)], exp_time: Annotated[float, ScanArgument(display_name='Exposure Time', description='Exposure time in seconds', tooltip=None, expert=False, hidden=False, example=None, units='s', reference_units=None, gt=None, ge=0.0, lt=None, le=None, reference_limits=None, precision=None, alternative_group=None)], relative: Annotated[bool, ScanArgument(display_name='Relative', description='Whether the positions are relative to the current position', tooltip=None, expert=False, hidden=False, example=None, units=None, reference_units=None, gt=None, ge=None, lt=None, le=None, reference_limits=None, precision=None, alternative_group=None)] = False, fast_axis_always_in_pos_dir: bool = True, **kwargs)[source]#

Bases: ScanBase

Continuous grid scan with 2-axis. The scan requires the fast axis to properly implement base velocity as well as high velocity and high acceleration time

Parameters:
  • fast_axis (DeviceBase) – Axis with continuous motion.

  • fast_start (float) – Start position for measurement points of the fast axis.

  • fast_end (float) – End position for measurement points of the fast axis.

  • fast_step_size (float) – Step size for points of the continuous motion axis.

  • stepper_axis (DeviceBase) – Step axis of the grid scan, stepping through the lines.

  • stepper_start (float) – Start position of the step axis.

  • stepper_stop (float) – End position of the step axis.

  • stepper_step_size (float) – Step size of the step axis in units of the motor.

  • relative (bool) – Whether the positions are relative to the current position. Default is False, i.e. absolute positions.

  • exp_time (float) – Exposure time in seconds

  • fast_axis_always_in_pos_dir (bool) – Whether to always scan in the positive direction, default is True.

Returns:

ScanReport

Methods

at_each_point

Logic to be executed at each point of the scan.

close_scan

Close the scan.

on_exception

Handle exceptions that occur during the scan.

open_scan

Open the scan.

post_scan

Post-scan steps to be executed after the main scan logic.

pre_scan

Pre-scan steps to be executed before the main scan logic.

prepare_scan

Prepare the scan.

scan_core

Core scan logic to be executed during the scan.

stage

Stage the devices for the upcoming scan.

unstage

Unstage the scan by executing post-scan steps.

update_scan_info

Update the scan info with the given keyword arguments.

Attributes

arg_bundle_size

arg_input

gui_config

is_scan

scan_name

scan_type

at_each_point(motors: list[str | DeviceBase], positions: ndarray, status_mcs, last_positions: ndarray | None = None)[source]#

Logic to be executed at each point of the scan. This is where the main scan logic should be implemented, e.g. triggering the readout devices. The at_each_point logic is typically implemented on the device itself.

close_scan()[source]#

Close the scan.

on_exception(exception: Exception)[source]#

Handle exceptions that occur during the scan. This is a good place to implement any cleanup logic that needs to be executed in case of an exception, such as returning the devices to a safe state or moving the motors back to their starting position.

open_scan()[source]#

Open the scan. This step must call self.actions.open_scan() to ensure that a new scan is opened. Make sure to prepare the scan metadata before, either in prepare_scan() or in open_scan() itself and call self.update_scan_info(…) to update the scan metadata if needed.

post_scan()[source]#

Post-scan steps to be executed after the main scan logic.

pre_scan()[source]#

Pre-scan steps to be executed before the main scan logic. This is typically the last chance to prepare the devices before the core scan logic is executed. For example, this is a good place to initialize time-criticial devices, e.g. devices that have a short timeout. The pre-scan logic is typically implemented on the device itself.

prepare_scan()[source]#

Prepare the scan. This can include any steps that need to be executed before the scan is opened, such as preparing the positions (if not done already) or setting up the devices.

scan_core()[source]#

Core scan logic to be executed during the scan. This is where the main scan logic should be implemented.

stage()[source]#

Stage the devices for the upcoming scan. The stage logic is typically implemented on the device itself (i.e. by the device’s stage method). However, if there are any additional steps that need to be executed before staging the devices, they can be implemented here.

unstage()[source]#

Unstage the scan by executing post-scan steps.

update_scan_info(num_points: int | None = None, num_monitored_readouts: int | None = None, positions: ndarray | None = None, exp_time: float | None = None, frames_per_trigger: int | None = None, settling_time: float | None = None, settling_time_after_trigger: float | None = None, burst_at_each_point: int | None = None, relative: bool | None = None, run_on_exception_hook: bool | None = None, scan_report_devices: Sequence[str | DeviceBase] | None = None, **kwargs)#

Update the scan info with the given keyword arguments. If the scan info model has an attribute with the same name as the keyword argument, it will be updated. Otherwise, the keyword argument will be added to the additional_scan_parameters dictionary. This allows for flexible scan info management, where standard parameters can be defined as attributes of the ScanInfo model, and any additional parameters can be stored in the additional_scan_parameters dictionary.

Parameters:
  • num_points (int, optional) – Number of points in the scan. Defaults to None.

  • num_monitored_readouts (int, optional) – Number of monitored readouts that will be collected during the scan. Defaults to None.

  • positions (np.ndarray, optional) – Positions for the scan, shape (num_points, num_motors). Defaults to None.

  • exp_time (float, optional) – Exposure time for the scan. Defaults to None.

  • frames_per_trigger (int, optional) – Number of frames per trigger. Defaults to None.

  • settling_time (float, optional) – Settling time before the software trigger. Defaults to None.

  • settling_time_after_trigger (float, optional) – Settling time after the software trigger. Defaults to None.

  • burst_at_each_point (int, optional) – Number of bursts at each point. Defaults to None.

  • relative (bool, optional) – Whether the positions are relative or absolute. Defaults to None.

  • run_on_exception_hook (bool, optional) – Whether to run the on_exception hook if the scan is interrupted. Defaults to None.

  • scan_report_devices (Sequence[str | DeviceBase], optional) – Devices to report during the scan. Device objects are stored by name. Defaults to None.

  • **kwargs – Keyword arguments to update the scan info with.