sm_bluesky.common.plan_stubs#

Members

set_area_detector_acquire_time

Set the acquire time on an area detector.

MotorTable

RootModel for motor tables

move_motor_with_look_up

Perform a step scan with the range and starting motor position

set_slit_size

Set opening of x-y slit.

check_within_limit

Check if the given values are within the limits of the motor.

get_motor_positions

Get the motor positions of the given motors and store them in a list.

get_velocity_and_step_size

Adjust the step size if the required velocity is higher than the max value.

sm_bluesky.common.plan_stubs.set_area_detector_acquire_time(det: AreaDetector | SingleTriggerDetector, acquire_time: float, wait: bool = True) Generator[Msg, Any, P][source]#

Set the acquire time on an area detector.

Parameters:
  • det (AreaDetector | SingleTriggerDetector) – The detector whose acquire time is to be set.

  • acquire_time (float) – The desired acquire time.

  • wait (bool, optional) – Whether to wait for the operation to complete, by default True.

Returns:

A Bluesky generator for setting the acquire time.

Return type:

MsgGenerator

class sm_bluesky.common.plan_stubs.MotorTable(root: RootModelRootType = PydanticUndefined)[source]#

RootModel for motor tables

sm_bluesky.common.plan_stubs.move_motor_with_look_up(slit: Motor, size: float, motor_table: dict[str, float], use_motor_position: bool = False, wait: bool = True, group: Hashable | None = None) Generator[Msg, Any, P][source]#
Perform a step scan with the range and starting motor position

given/calculated by using a look up table(dictionary). Move to the peak position after the scan and update the lookup table.

Parameters:
  • motor (Motor) – Motor devices that is being centre.

  • size (float) – The motor position or name in the motor_table.

  • motor_table (dict[str, float],) – Look up table for motor position,

  • use_motor_position (bool = False,) – If Ture it will take motor position as size.

  • wait (bool = True,) – If Ture, it will wait until position is reached.

  • group (Hashable | None = None,) – Bluesky group identifier used by ‘wait’.

sm_bluesky.common.plan_stubs.set_slit_size(xy_slit: Slits, x_size: float, y_size: float | None = None, wait: bool = True, group: Hashable | None = None) Generator[Msg, Any, P][source]#

Set opening of x-y slit.

Parameters:
  • xy_slit (Slits) – A slits device.

  • x_size (float) – The x opening size.

  • y_size (float) – The y opening size.

  • wait (bool) – If this is True it will wait for all motions to finish.

  • (optional) (group) – Bluesky group identifier used by ‘wait’.

sm_bluesky.common.plan_stubs.check_within_limit(values: list[float], motor: Motor)[source]#

Check if the given values are within the limits of the motor. :param values: The values to check. :type values: List[float] :param motor: The motor to check the limits of. :type motor: Motor

Raises:

ValueError – If any value is outside the motor’s limits.

sm_bluesky.common.plan_stubs.get_motor_positions(*arg: Motor) Iterator[tuple[str, float]][source]#

Get the motor positions of the given motors and store them in a list.

Parameters:

arg (Motor) – The motors to get the positions of.

Returns:

An iterator of tuples containing the motor name and its position.

Return type:

Iterator[Tuple[str, float]]

sm_bluesky.common.plan_stubs.get_velocity_and_step_size(scan_motor: Motor, ideal_velocity: float, ideal_step_size: float) Iterator[Any][source]#

Adjust the step size if the required velocity is higher than the max value.

Parameters:
  • scan_motor (Motor) – The motor which will move continuously.

  • ideal_velocity (float) – The desired velocity.

  • ideal_step_size (float) – The non-scanning motor step size.

Returns:

An iterator containing the adjusted velocity and step size.

Return type:

Iterator[Tuple[float, float]]