You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When constructing a cycler with a Spec that contains as one of its axes DURATION, the special string is not handled as duration. This is for a software scan.
@attach_data_session_metadata_decorator()@validate_call(config={"arbitrary_types_allowed": True})defspec_scan(
detectors: Annotated[
set[Readable],
Field(
description="Set of readable devices, will take a reading at each point, \ in addition to any Movables in the Spec",
),
],
spec: Annotated[
Spec[Movable],
Field(description="ScanSpec modelling the path of the scan"),
],
metadata: dict[str, Any] |None=None,
) ->MsgGenerator:
"""Generic plan for reading `detectors` at every point of a ScanSpec `Spec`. A `Spec` is an N-dimensional path. """# TODO: https://github.com/bluesky/scanspec/issues/154# support Static.duration: Spec[Literal["DURATION"]]_md= {
"plan_args": {
"detectors": {det.namefordetindetectors},
"spec": repr(spec),
},
"plan_name": "spec_scan",
"shape": spec.shape(),
**(metadataor {}),
}
yieldfrombp.scan_nd(tuple(detectors), _as_cycler(spec), md=_md)
def_as_cycler(spec: Spec[Movable]) ->Cycler:
""" Convert a scanspec to a cycler for compatibility with legacy Bluesky plans such as `bp.scan_nd`. Use the midpoints of the scanspec since cyclers are normally used for software triggered scans. Args: spec: A scanspec Returns: Cycler: A new cycler """midpoints=spec.frames().midpoints# Need to "add" the cyclers for all the axes together. The code below is# effectively: cycler(motor1, [...]) + cycler(motor2, [...]) + ...returnreduce(operator.add, (cycler(*args) forargsinmidpoints.items()))
The text was updated successfully, but these errors were encountered:
When constructing a cycler with a Spec that contains as one of its axes
DURATION
, the special string is not handled as duration. This is for a software scan.The text was updated successfully, but these errors were encountered: