sm_bluesky.common.plans
#
Bluesky plans common for S&M beamline.
Members
Does a fast non-stopping scan and move to the fitted position. |
|
Perform a step scan and move to the fitted position. |
|
Data table to help access the fit data. |
|
Perform a step scan with therange and starting motor position |
|
Perform a fast scan along one axis. |
|
Same as fast_scan_1d with an extra axis to step through forming a grid. |
|
Initiates a 2-axis scan, targeting a maximum scan speed of around 10Hz. |
|
Standard Bluesky grid scan adapted to use step size. |
|
Set the acquire time and trigger the detector to read data. |
- sm_bluesky.common.plans.fast_scan_and_move_fit(det: StandardReadable, motor: Motor, fitted_loc: StatPosition, detname_suffix: str, start: float, end: float, motor_speed: float | None = None) Generator[Msg, Any, P] [source]#
Does a fast non-stopping scan and move to the fitted position.
- Parameters:
det (StandardReadable,) – Detector to be use for alignment.
motor (Motor) – Motor devices that is being centre.
fitted_loc (StatPosition) – Which fitted position to move to see StatPosition.
detname_suffix (Str) – Name of the fitted axis within the detector
start (float,) – Starting position for the scan.
end (float,) – Ending position for the scan.
motor_speed (Optional[float] = None,) – Speed of the motor.
- sm_bluesky.common.plans.step_scan_and_move_fit(det: StandardReadable, motor: Motor, fitted_loc: StatPosition, detname_suffix: str, start: float, end: float, num: int) Generator[Msg, Any, P] [source]#
Perform a step scan and move to the fitted position.
- Parameters:
det (StandardReadable) – The detector to use for alignment.
motor (Motor) – The motor to center.
fitted_loc (StatPosition) – The fitted position to move to (see StatPosition).
detname_suffix (str) – The suffix for the detector name.
start (float) – The starting position for the scan.
end (float) – The ending position for the scan.
num (int) – The number of steps in the scan.
- Returns:
A Bluesky generator for the scan.
- Return type:
MsgGenerator
- class sm_bluesky.common.plans.StatPosition(*values)[source]#
Data table to help access the fit data.
Com: Centre of mass
CEN: Peak position
MIN: Minimum value
MAX: Maximum value
D: Differential
- sm_bluesky.common.plans.align_slit_with_look_up(motor: Motor, size: float, slit_table: dict[str, float], det: StandardReadable, centre_type: StatPosition) Generator[Msg, Any, P] [source]#
- Perform a step scan with therange 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 size/name in the motor_table.
motor_table (dict[str, float],) – Look up table for motor position, the str part should be the size of the slit in um.
det (StandardReadable,) – Detector to be use for alignment.
centre_type (StatPosition) – Which fitted position to move to see StatPosition.
- sm_bluesky.common.plans.fast_scan_1d(dets: list[Readable], motor: Motor, start: float, end: float, motor_speed: float | None = None, md: dict[str, Any] | None = None) Generator[Msg, Any, P] [source]#
Perform a fast scan along one axis.
- Parameters:
dets (list[Readable]) – List of readable objects (e.g., detectors).
motor (Motor) – The motor to move during the scan.
start (float) – The starting position of the motor.
end (float) – The ending position of the motor.
motor_speed (Optional[float], optional) – The speed of the motor during the scan. If None, the motor’s current speed is used.
- Returns:
A Bluesky generator for the scan.
- Return type:
MsgGenerator
- sm_bluesky.common.plans.fast_scan_grid(dets: list[Readable], step_motor: Motor, step_start: float, step_end: float, num_step: int, scan_motor: Motor, scan_start: float, scan_end: float, motor_speed: float | None = None, snake_axes: bool = False, md: dict[str, Any] | None = None) Generator[Msg, Any, P] [source]#
Same as fast_scan_1d with an extra axis to step through forming a grid.
- Parameters:
detectors (list) – list of ‘readable’ objects
step_motor – Motor (moveable, readable)
step_start – Starting position for slow/stepping motor.
step_end – Ending position for step motro.
num_step – Number of steps to take going from start to end.
scan_motor (Motor (moveable, readable)) – The motor that will not stop during measurements.
scan_start – Scan motor starting position.
scan_end – Scan motor ending position.
motor_speed (float optional.) – Speed of the scanning motor during measurements. If None, it will use current speed.
snake_axes – If Ture. Scan motor will start an other line where it ended.
md – place holder for meta data for future.
- sm_bluesky.common.plans.grid_fast_scan(dets: list[Readable], count_time: float, step_motor: Motor, step_start: float, step_end: float, scan_motor: Motor, scan_start: float, scan_end: float, plan_time: float, point_correction: float = 1, step_size: float | None = None, home: bool = False, snake_axes: bool = True, md: dict[str, Any] | None = None) Generator[Msg, Any, P] [source]#
Initiates a 2-axis scan, targeting a maximum scan speed of around 10Hz. Calculates the number of data points based on the detector’s count time. If no step size is provided, aims for a uniform distribution of points. Adjusts scan speed and step size to fit the desired scan duration.
- Parameters:
dets (list[Readable]) – List of detectors to use for the scan.
count_time (float) – Detector count time.
step_motor (Motor) – Motor for the slow axis.
step_start (float) – Starting position for the step motor.
step_end (float) – Ending position for the step motor.
scan_motor (Motor) – Motor for the continuously moving axis.
scan_start (float) – Starting position for the scan motor.
scan_end (float) – Ending position for the scan motor.
plan_time (float) – Desired duration of the scan in seconds.
point_correction (float, optional) – Scaling factor for the number of points, by default 1.
step_size (float, optional) – Step size for the slow axis, by default None.
home (bool, optional) – If True, move back to the original position after the scan, by default False.
snake_axes (bool, optional) – If True, perform a snake scan, by default True.
md (dict, optional) – Metadata for the scan, by default None.
- Returns:
A Bluesky generator for the scan.
- Return type:
MsgGenerator
- sm_bluesky.common.plans.grid_step_scan(dets: Sequence[Readable], count_time: float, x_step_motor: Motor, x_step_start: float, x_step_end: float, x_step_size: float, y_step_motor: Motor, y_step_start: float, y_step_end: float, y_step_size: float, home: bool = False, snake: bool = False, md: dict | None = None) Generator[Msg, Any, P] [source]#
Standard Bluesky grid scan adapted to use step size. Optionally moves back to the original position after scan.
- Parameters:
dets (Sequence[Readable]) – Area detectors or readable devices.
count_time (float) – Detector count time.
x_step_motor (Motor) – Motor for the X axis.
x_step_start (float) – Starting position for x_step_motor.
x_step_end (float) – Ending position for x_step_motor.
x_step_size (float) – Step size for x motor.
y_step_motor (Motor) – Motor for the Y axis.
y_step_start (float) – Starting position for y_step_motor.
y_step_end (float) – Ending position for y_step_motor.
y_step_size (float) – Step size for y motor.
home (bool, optional) – If True, move back to position before scan.
snake (bool, optional) – If True, do grid scan without moving scan axis back to start position.
md (dict, optional) – Metadata.
- Returns:
A Bluesky generator for the scan.
- Return type:
MsgGenerator
- sm_bluesky.common.plans.trigger_img(dets: Andor2Detector, acquire_time: int, md: dict[str, Any] | None = None) Generator[Msg, Any, P] [source]#
Set the acquire time and trigger the detector to read data.
- Parameters:
dets (Andor2Detector) – The detector to trigger.
value (int) – The acquire time to set on the detector.
- Returns:
A Bluesky generator for triggering the detector.
- Return type:
MsgGenerator