pcdsdevices.utils.generate_scan_points
- pcdsdevices.utils.generate_scan_points(start: int | float | Decimal, end: int | float | Decimal, step: int | float | Decimal, prec: int, bidirectional: bool)
Generate scan positions in the forward and optionally reverse directions.
Example
positions = list(generate_scan_points(1, 10, 0.1, 9, True)) RE(list_scan(dets, motor, positions))
- Parameters:
start (int, float, or Decimal) – Starting scan position. Must be nonnegative and less than
end.step (int, float, or Decimal) – Positive spacing between consecutive positions. Must be less than both
startandend.prec (int) – Generated scan points precision.
bidirectional (bool) – If True, generate a reverse pass after the forward pass.
- Yields:
Decimal – Scan positions, beginning at
startand increasing bystepwhile less than or equal toend. Ifbidirectionalis True, additional positions begin atend - stepand decrease bystepwhile greater than or equal tostart.- Raises:
ValueError – If
startis negative,startis greater than or equal toend,precis smaller than 1 orstepis greater than or equal to either boundary.
Notes
Sets the active decimal context precision to nine significant digits. Inputs are converted directly to
Decimal; float inputs may retain binary floating-point representation artifacts.The forward pass includes
endonly if stepping reaches it exactly. The reverse pass is anchored toend, so its positions may differ from the forward positions if the interval is not divisible bystep.